[e-lang] Bug: three adjacent colons in printed ENodes

Jon Leonard jleonard at oasis.slimy.com
Mon Sep 24 16:54:31 EDT 2007


On Mon, Sep 24, 2007 at 04:13:49PM -0400, Kevin Reid wrote:
> On Sep 15, 2007, at 16:40, Mark Miller wrote:
> > On 9/15/07, Kevin Reid <kpreid at mac.com> wrote:

[ #4 is change how the lexer deals with ::: ] 
> > If not, then I believe we should at least do #4.
> 
> Dean said that it's nontrivial to get the ANTLR lexer to do this.

The ANTLR lexer is indeed fairly uncooperative for this.  With Lex, it'd
be a matter of a state change or trailing context.  The 'easiest' way
looks like adding a token-stream filter that turns a (new) ::: token
into two tokens, : followed by ::.  It also looks like it'd be possible
to use zzchar to disambiguate.

To be honest, it seems like a better idea to disallow :::, or at least
consider it bad enough style to not autogenerate it.  It's kind of like
"j = i+++j;" in C:  Legal, but too confusing.

Jon Leonard


More information about the e-lang mailing list