Re: [code] Fixes to Prolog and Logtalk lexers in 10.6

From: Michael Richter <ttmrichter.att.gmail.com>
Date: Thu, 19 Sep 2019 08:28:22 +0800

Ooh! I didn't know we could use token() that way! Cool!

(This makes a LOT of my lexer issues just go away.)

On Thu, 19 Sep 2019 at 06:45, Mitchell <m.att.foicica.com> wrote:

> Hi Michael,
>
> On Thu, 19 Sep 2019, Michael Richter wrote:
>
> > That colours the whole line, including the :-, as lexer.PREPROCESSOR.
> It's
> > not a show-stopper (it's the solution I have in place right now, in fact)
> > but it looks a bit ugly.
> >
> > Is there some trick I could use involving captures maybe?
>
> Sorry, I read one thing you said, but interpreted your provided code in
> another way. Perhaps you can try:
>
> lex:add_rule('directive',
> token(lexer.DEFAULT, ':-' * lexer.space^0) *
> token(lexer.PREPROCESSOR, word_match[[foo bar baz]]))
>
> 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.
>
>

-- 
"Perhaps people don't believe this, but throughout all of the discussions
of entering China our focus has really been what's best for the Chinese
people. It's not been about our revenue or profit or whatnot."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
-- 
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 Wed 18 Sep 2019 - 20:28:22 EDT

This archive was generated by hypermail 2.2.0 : Thu 19 Sep 2019 - 06:48:16 EDT