Re: Scan "=<<" as something useful

Robert Virding <[email protected]>
Newsgroups gmane.comp.lang.erlang.patches
Message-ID <1303427187.105453962.1368131031834.JavaMail.root@erlang-solutions.com>
Sorry Raimo,

But I have been travelling and not really following erlang-patches. I still hold the same opinion. Consider yourself lectured. :-)

Robert

----- Original Message -----
> From: "Raimo Niskanen" <[email protected]>
> 
> On Sun, Apr 21, 2013 at 10:15:28PM +0200, Anthony Ramine wrote:
> > Hello,
> > 
> > I've noticed that Erlang/OTP own code tend to be space-free, e.g.
> > {a,
> > b} is rather written as {a,b}. Then there is the occasional Bin=
> > <<42>> with a space because erl_scan will scans "=<<" as '=<','<'
> > instead of '=','<<'. This patch teaches erl_scan how to not do
> > that.
> > 
> > There is no backwards compatibility problem as '=<','<' can't
> > appear
> > in valid code.
> 
> When I tried to fix this years ago while rewriting the scanner just
> after
> the binary syntax was introduced I got lecutured (I think by Robert)
> that it was a bad change because it introduces syntax knowledge
> into the scanner.
> 
> The scanner is today greedy so it collects as many characters as it
> can into a valid token, and "=<" is a valid token.  When it is
> followed by "<" that becomes a syntax error in the parser.
> 
> I kind of miss this argument this time around...
> 
> > 
> >         git fetch https://github.com/nox/otp.git
> >         disambiguate-equal-binary
> > 
> >         https://github.com/nox/otp/compare/disambiguate-equal-binary
> >         https://github.com/nox/otp/compare/disambiguate-equal-binary.patch
> > 
> > Regards,
> > 
> > --
> > Anthony Ramine
> > _______________________________________________
> > erlang-patches mailing list
> > [email protected]
> > http://erlang.org/mailman/listinfo/erlang-patches
> 
> --
> 
> / Raimo Niskanen, Erlang/OTP, Ericsson AB
> _______________________________________________
> erlang-patches mailing list
> [email protected]
> http://erlang.org/mailman/listinfo/erlang-patches
> 
_______________________________________________
erlang-patches mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.