[erlang-questions] literal character syntax
Mon May 19 15:03:18 CEST 2014
To sum up the issue of literal whitespace, nobody had anything against
adding warnings pointing out the existence of such literals.
I will try to implement it, but as I mentioned before, the only way to
detect these literals at the linter level is by checking the text of the
tokens. We don't want to always return the text for all tokens, so I have
to find a special solution for this case.
I see two alternatives: return the text for literal character tokens either
always or only when the compiler option is set. The first way uses a bit
more memory (but not much, as there are relatively few literal characters
in source code). The second way won't work for compile:forms unless the
scanning was done with the 'text' option. Adding this option means adding
complexity to the code.
My inclination is to go for always returning the text for literal chars.
The code remains simpler at the price of (if I am counting correctly) 6
words per instance of a literal char. The only real problem could be if
some code assumes that if no options are sent to the scanner, the attribute
list includes no text. I would say that this is the wrong thing to do
anyway, but for the sake of compatibility it means that we should be able
to control this with a (global) option...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions