Re: [code] [scintillua] Match patterns between embedded lexer start/end?

From: Mitchell <m.att.foicica.com>
Date: Fri, 4 Oct 2013 08:52:42 -0400 (Eastern Daylight Time)

> [snip]
>
> local end_rule = P(function(text, index)
> if state == --[[one of your starts]] then
> local _, e = text:find(--[[Lua pattern matching end]], index)
> if e then return e + 1 end
> elseif state == --[[another start]] then
> ...
> end
> end)

I forgot to match a token for the end rule. It should be:

   local end_patt = --[[LPeg pattern matching range of ends]]
   local end_rule = #P(function(text, index)
     ...
   end) * end_patt

Cheers,
Mitchell

-- 
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 Fri 04 Oct 2013 - 08:52:42 EDT

This archive was generated by hypermail 2.2.0 : Sat 05 Oct 2013 - 06:49:52 EDT