Re: [code] [textadept] Parsing character literal with LPeg lexer

From: Robert Gieseke <rob.g.att.web.de>
Date: Tue, 18 Feb 2014 13:09:42 +0100

Hi,

are you aware of the module and lexer (work-in-progress) at
https://bitbucket.org/a_baez/ta-rust/ ?

Maybe you can join contribute your efforts …

Cheers,
Robert

Am 18/02/14 11:28, schrieb suharik:
> I'm trying to implement a rust lexer.
>
> Character literal are described here: http://static.rust-lang.org/doc/master/rust.html#character-and-string-literals
> So I wrote this:
>
> local char_body = -P("'") + P("\\") * P("'") + P("\\") * ("\\" + S("nrt0") + "x"*l.xdigit^2 + "u"*l.xdigit^4 + "U"*l.xdigit^8)
> local char_lit = "'" + char_body + "'"
>
> But there is a problem:
>
> Lua Error: /usr/share/textadept/lexers/lexer.lua:933: loop body may accept empty string.
>
> So, what's gone wrong and what “loop body may accept empty string” means? Textadept version: 7.1.
>
> PS: no, l.delimited_range doesn't cut it: language have things like “BitsNStrings<'a>”.
>

-- 
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 Tue 18 Feb 2014 - 07:09:42 EST

This archive was generated by hypermail 2.2.0 : Wed 19 Feb 2014 - 06:46:06 EST