[code] embed_lexer --- bug or feature?

From: Carl Sturtivant <sturtivant.att.gmail.com>
Date: Mon, 22 Feb 2016 10:56:24 -0600

Hello,

In the lexer I am writing, embedded D code can occur in two completely
different ways.

First, inline between #{ and }, and for now I will assume no braces in
the D code between these.

Second, line based, following a special symbol like
        -
        |=
and so forth. There may be braces in this embedded code, which could
interfere with the first case when setting an end rule for the embedded
D lexer.

To avoid this, I tried calling embed_lexer once to set up the first
case, and once to set up the second case. But the second call simply
replaced the effect of the first one, instead of adding a new instance
of embedded lexing. If the language had been different for the second
call, this would not have happened.

I see this as a bug. Maybe there's a work-around. Could I get a copy of
the lexer object with a different name in a simple way, and use that to
avoid the name collision that causes the above behavior?

Carl.

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 22 Feb 2016 - 11:56:24 EST

This archive was generated by hypermail 2.2.0 : Tue 23 Feb 2016 - 06:50:34 EST