[erlang-questions] erl_scan:scan_dot issue

Anthony Ramine <>
Fri Feb 7 16:51:41 CET 2014


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