[erlang-questions] erl_scan issues

Richard A. O'Keefe ok@REDACTED
Wed Apr 22 02:35:47 CEST 2015


Erlang syntax is adapted from Prolog syntax.
It is traditional in Prolog parsers to distinguish
between a "." token such as you might find in
a.b.[] (the really old-fashioned way to write a list)
and a ". " token which ends a clause.
And it turns out that erl_scan:string/3 makes exactly
the same distinction:  "a. b" contains a ". " (dot) token
while "a.b" contains a "." ('.') token.  Now a full stop
at the end of a string is also a dot token, but it has
text ".".  White space as such is never a token.

This does not look like a bug at all to me.

I will say that it would be nice if the
http://www.erlang.org/doc/man/erl_scan.html
page contained or linked to an explicit statement
of what the tokens ARE.

At a minimum, the type category() should be a bit
more explicit than "atom()".

For that matter,
http://www.erlang.org/doc/man/erl_parse.html
should contain or link to an explicit statement
of what the grammar is.





More information about the erlang-questions mailing list