[erlang-questions] erl_scan:scan_dot issue

Vlad Dumitrescu <>
Fri Feb 7 17:07:05 CET 2014

I am now using erl_scan and the problem is that I had assumed that the
text representing the dot is always of length 1, which is no longer
the case. I have added a layer that converts, but now I must remember
to use this layer instead of erl_scan...

Anyway, I don't think that the whitespace must be part of the dot
token. It is use to recognize it, of course, but the scanner worked
without problems without this up to R12 or R13. So what I wondered is
if there is a reason for the change.


On Fri, Feb 7, 2014 at 4:51 PM, Anthony Ramine <> wrote:
> That surprised me too but I found that quite logical when you think about how to distinguish 'dot' from '.'.
> Why don't you just include these clauses in your own scanner?
> --
> Anthony Ramine
> Le 7 févr. 2014 à 10:35, Vlad Dumitrescu <> a écrit :
>> Hi,
>> This is something from at least R13, the git repository only goes that far.
>> erl_scan:scan_dot contains these clauses
>> scan_dot([$\n=C|Cs], St, Line, Col, Toks, Ncs) ->
>>    Attrs = attributes(Line, Col, St, Ncs++[C]),
>>    {ok,[{dot,Attrs}|Toks],Cs,Line+1,new_column(Col, 1)};
>> scan_dot([C|Cs], St, Line, Col, Toks, Ncs) when ?WHITE_SPACE(C) ->
>>    Attrs = attributes(Line, Col, St, Ncs++[C]),
>>    {ok,[{dot,Attrs}|Toks],Cs,Line,incr_column(Col, 2)};
>> Why is whitespace conflated with the dot in the token? I have an old
>> version of the scanner that doesn't have these clauses and when I am
>> now trying to use the OTP scanner, there are errors all over the place
>> because of that....
>> best regards,
>> Vlad
>> _______________________________________________
>> erlang-questions mailing list
>> http://erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list