[erlang-questions] Are newlines significant in Erlang grammar?
Ryan Molden
ryanmolden@REDACTED
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
> the
> > Erlang grammar where whitespace is required? My gut instinct tells me
> there
> > 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
> and
> > even then, there's always some sort of punctuation. Is this period
> business
> > 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.
Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111223/5b220440/attachment.htm>
More information about the erlang-questions
mailing list