nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH] syntax: lua: fix word boundaries on standard li


From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] syntax: lua: fix word boundaries on standard library functions
Date: Thu, 28 Dec 2017 21:56:42 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0


Hello Tom,

Op 27-12-17 om 14:31 schreef Tom Levy:
I've attached a patch to fix a small bug in the syntax highlighting
rules for Lua files.

Functions such as "io.close" should only be highlighted when the
package name ("io") is at the beginning of a word, otherwise code such
as "fooio.close" gets unexpected partial highlighting.

Thanks!  Makes sense.  Applied and pushed, 4f2b01c7.

But... there are other things:

  # File handle methods
  color brightyellow "\:\<(close|flush|lines|read|seek|setvbuf|write)\>"

In this regex, I think the leading backslash is unneeded, and the \< is
unneeded too.  Can you confirm?  (As I have no clue about Lua.)

And the earlier regex:

# Keywords
color brightyellow "\<(io|math|os|string|table|coroutine|debug)\>\."

Isn't this superfluous?  Because the regexes that you corrected will
color those same strings again -- at least, if the used functions are
covered by those regexes.  Do "your" regexes cover *all* existing
functions, or could there be more?

And this seems incorrect too:

# Hex literals
color red "0x[0-9a-fA-F]*"

The * should be +, right?  Because 0x by itself would be wrong?

Benno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]