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

Mark Miller erights at gmail.com
Sat Sep 15 16:40:25 EDT 2007


On 9/15/07, Kevin Reid <kpreid at mac.com> wrote:
> ? e`def a : ::"" := c`
> # value: e`def a :::"" := c`
>
> ? e`def a :::"" := c`
> # syntax error:
> #   def a :::"" := c
> #          ^
>
> The obvious printed form fails to parse since the lexer is producing
> [::,:] rather than [:,::].
>
> The fix is obvious: arrange for a space or parentheses to be
> inserted. But how should the printer know to do this?
>
> 1) Should an artificial precedence level be introduced?
>
> 2) Should guard-syntax printing look 'down' to see if the guard
> expression will start with ":"?
>
> 3) Should the syntax used for arbitrary nouns be changed?
>
> 4) Should the lexer's interpretation of ":::" be changed?
[I inserted numbers on your proposals above.]


Is there any other case in the grammar that, whitespace aside, could
correctly allow three consecutive colons? I believe not. If not, then
I believe we should at least do #4. Once we do #4, then the immediate
technical problem is solved, but the printing behavior remains
unpleasant. I think we should do #1 as well.

-- 
Text by me above is hereby placed in the public domain

    Cheers,
    --MarkM


More information about the e-lang mailing list