[code] [textadept] How to embed parent lexer in child lexer?

From: Joshua Krämer <joshua.kraemer.att.gmail.com>
Date: Sat, 18 Oct 2014 20:33:18 +0200

Hi all,

I have a lexer that embeds another lexer (for some special text in the
code). That works fine using the following code:

-- parent lexer code is above this line

local special_text = {_NAME = 'special_text'}

local special_word = token(l.IDENTIFIER, l.word)

special_text._rules = {
        {'special_word', special_word},
}

l.embed_lexer(M, special_text, start, stop)

return M

Now I also need to return to the top-level lexing inside the special
text area, i. e. I need to embed the parent lexer inside the child
lexer. Is this possible? If so, how? Unfortunately, I could not come
up with a working solution.

Thanks and kind regards,
Joshua

-- 
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 Sat 18 Oct 2014 - 14:33:18 EDT

This archive was generated by hypermail 2.2.0 : Sun 19 Oct 2014 - 06:34:24 EDT