[erlang-questions] Are newlines significant in Erlang grammar?
Fri Dec 23 23:24:37 CET 2011
On Tue, Dec 20, 2011 at 3:39 PM, Jeff Schultz <jws@REDACTED>wrote:
> On Tue, Dec 20, 2011 at 01:33:18PM -0500, Daniel Dormont wrote:
> > Actually that's an interesting point. Is there really no other place in
> > Erlang grammar where whitespace is required? My gut instinct tells me
> > must be a few, because every language has a few right? I mean, if nothing
> > else to separate two identifiers? But thinking a little more, I realize
> > Erlang doesn't have "identifiers" in the sense most other languages do
> > even then, there's always some sort of punctuation. Is this period
> > the only exception?
> Erlang has operators that are alphabetic. X orelse Y really does
> need the whitespace. And 1.5 is not the same thing as 1 . 5.
> Handling whitespace is a job for the lexer. Just ensure that the '.'
> <whitespace> sequence produces an end-of-term token instead of some
> dot token and treat other unquoted whitespace as a token terminator.
> Jeff Schultz
That did the trick, thanks! Had to massage some regular expressions in my
lexer but it seems to be working properly now.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions