[erlang-questions] Are newlines significant in Erlang grammar?

Daniel Dormont dan@REDACTED
Wed Dec 21 00:51:40 CET 2011


On Tue, Dec 20, 2011 at 6: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.
>
> Ah of course. I knew I was missing something. Just a brain fart.



> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111220/4c786da6/attachment.htm>


More information about the erlang-questions mailing list