<p dir="ltr">Hi,</p>
<p dir="ltr">Probably because blanks between dot and something are useless and could be removed without impact.<br>
a. b.  Is same as a.b.  while it is not necessary the case with other blanks separating other tokens.<br>
I do not try to justify this, just trying to understand the logic behind.<br>
BTW I understand better now the code style recommendation to remove any extra blanks...  :-) </p>
<div class="gmail_quote">Le 21 avr. 2015 14:15, Vlad Dumitrescu <vladdu55@gmail.com> a écrit :<br type='attribution'><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi!<div><br /></div><div>Why should the first whitespace be part of the dot token and not a separate white_space token? The dot is recognized anyway (and it can also be followed by a comment, in which case the % character is correctly kept together with the rest of the comment). </div><div><br /></div><div>Of course I can handle this case specially, but it feels that it is unnecessary to have special cases without a meaningful reason. If there is a reason, I suppose it should be documented in the file, like other conventions about how the syntax is handled are.</div><div><br /></div><div>regards,<br /></div><div>Vlad</div><div><br /></div></div><div><br /><div class="elided-text">On Tue, Apr 21, 2015 at 2:04 PM, Éric Pailleau <span dir="ltr"><<a href="mailto:eric.pailleau@wanadoo.fr">eric.pailleau@wanadoo.fr</a>></span> wrote:<br /><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<br />
I suppose because a dot, as well any further blanks and a newline is the normal end of an Erlang term.<br />
Using scan for another purpose may result in this unespected behaviour.<br />
Regards<br />
<div><div><br />
<br />
<br />
Le 21 avr. 2015 13:53, Vlad Dumitrescu <<a href="mailto:vladdu55@gmail.com">vladdu55@gmail.com</a>> a écrit :<br />
><br />
> Hi!<br />
><br />
> I found some unexpected behaviour for erl_scan and I hope someone can shed a light as to if it's supposed to be like that or it's a bug. IMHO the latter applies.<br />
><br />
> > erl_scan:string("a. b",{1,1},[return,text]).<br />
> {ok,[{atom,[{line,1},{column,1},{text,"a"}],a},<br />
>      {dot,[{line,1},{column,2},{text,". "}]},<br />
>      {atom,[{line,1},{column,4},{text,"b"}],b}],<br />
>     {1,5}}<br />
><br />
> In short, the first newline or whitespace after a dot is included in the textual representation of the token. Why would anyone have that?<br />
><br />
> regards,<br />
> Vlad<br />
><br />
</div></div></blockquote></div><br /></div>
</blockquote></div>