Re: [code] Oddity in Rexx syntax colouration

From: Michael Richter <ttmrichter.att.gmail.com>
Date: Wed, 16 Dec 2015 19:19:34 +0800

I've come into a bit of a problem with the Rexx lexer. The problem is that
it *is* a lexer. And lexing isn't enough for properly highlighting Rexx
code.

As an example of what I mean, *every* word in the following code is an
identifier in some circumstances and a keyword in others:

/**************************************** 'do' is a
variable***************************************/do = 1say
do/**************************************** 'do' is a keyword* 'while'
is a variable***************************************/do while = 1 to 5
 say whileend/**************************************** 'do' is a
keyword* 'while' is a keyword* 'forever' is a
variable***************************************/forever = 1do while
forever <= 5 say forever forever = forever +
1end/**************************************** 'do' is a keyword*
'forever' is a keyword* 'while' is a
variable***************************************/while = 1do forever
if while > 5 then do leave end say while while = while + 1end
>
>
This means that when I use the (newly-corrected) Rexx lexer, each one of
those words is marked in blue as a keyword, even though this is not always
the case.

Is it feasible to make a smarter "lexer" that can tell the difference
between "do" as a statement with "while" as a keyword on it in one context
while having do as a variable in another and while as a variable in yet
another?

On 1 December 2015 at 23:18, Michael Richter <ttmrichter.att.gmail.com> wrote:

> Oh wow. I never even thought to check priorities like that. :-o
>
> On 1 December 2015 at 23:00, Mitchell <m.att.foicica.com> wrote:
>
>> Hi Michael,
>>
>> On Tue, 1 Dec 2015, Michael Richter wrote:
>>
>> Identifiers that have more than one consecutive numerical digit in them
>>> will colour extra digits as numbers even in the middle of an identifier
>>> that continues past the digits in question. This is easier to illustrate
>>> than to explain:
>>>
>>>
>>> ‚ÄčI've checked with Ctrl+I and yes, it is indeed splitting "a12b34c" into
>>> identifier (a1), number (2), identifier (b3), number (4), identifier (c).
>>> I peeked into the Rexx lexer and couldn't find what the problem was.
>>> AFAICT "identifier" is correctly defined and it is properly placed ahead
>>> of
>>> number in the check order. It's a bit of a mystery to me what's going
>>> on.
>>>
>>
>> Thanks for the report. I've committed a fix[1] for this bug that will
>> show up in the next nightly.
>>
>> Cheers,
>> Mitchell
>>
>> [1]: http://foicica.com/hg/scintillua/rev/d8bef6295358
>
>
>
>
> --
> "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 Wed 16 Dec 2015 - 06:19:34 EST

This archive was generated by hypermail 2.2.0 : Wed 16 Dec 2015 - 06:45:44 EST