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

From: Michael Richter <ttmrichter.att.gmail.com>
Date: Fri, 20 Sep 2019 08:56:50 +0800

(I should mention that directive is now the very first rule of the file and
whitespace the second.)

On Fri, 20 Sep 2019 at 08:56, Michael Richter <ttmrichter.att.gmail.com> wrote:

> Still not working. The rules are like this:
>
> lex:add_rule('directive', token(lexer.WHITESPACE, lexer.starts_line(S('
> \t')^0)) *
> token(lexer.OPERATOR, P':-') *
> token(lexer.WHITESPACE, S(' \t')^0) *
> token(lexer.PREPROCESSOR,
> P(word_match(directives[dialect]))))
>
> -- Whitespace.
> lex:add_rule('whitespace', token(lexer.WHITESPACE, lexer.space^1))
>
> If the directives are at the start of a line, they're all recognized,
> complete with switched dialects and all that. However put a single space
> in front of one and it switches to identifier (which is defined
> waaaaaaaaaaaaaaaaaaaaaaaaaaay later in the file!) instantly. What
> incredibly obvious thing am I misreading here?
>
> On Fri, 20 Sep 2019 at 08:33, Michael Richter <ttmrichter.att.gmail.com>
> wrote:
>
>>
>>
>> On Thu, 19 Sep 2019 at 21:21, Mitchell <m.att.foicica.com> wrote:
>>
>>>
>>> Remember that lexers match rules in the order that you add them.
>>>
>>
>> *sigh*
>>
>> Yeah, I need to keep remembering this. :-/
>>
>> --
>> "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.
>>
>
>
> --
> "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.
>

-- 
"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 Thu 19 Sep 2019 - 20:56:50 EDT

This archive was generated by hypermail 2.2.0 : Fri 20 Sep 2019 - 06:32:21 EDT