nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] [PATCH] syntax: lua: patch series


From: Tom Levy
Subject: [Nano-devel] [PATCH] syntax: lua: patch series
Date: Sun, 31 Dec 2017 20:02:26 +1300

Hi nano devs,

I attached a series of patches for syntax/lua.nanorc following
discussion with Benno on this mailing list. Commit messages below.

Benno: This is what we agreed, except I used "icolor" in the hex
literal rule for readability and conciseness.

Cheers,
Tom


Commit messages (with prefix stripped):

[PATCH 1/6] hex literals: require 1+ digits, add word boundaries

Use "+" instead of "*" in digits regex because "0x" by itself is
invalid. Suggested by Benno Schulenberg on the mailing list:
https://lists.gnu.org/archive/html/nano-devel/2017-12/msg00112.html

Add word boundaries so that e.g. "00x1" (which is invalid) does not
get partial highlighting.

[PATCH 2/6] number literals: support fractional part and exponent

The new regex does not match a leading or trailing dot, but it's good
enough. Discussion on the mailing list:
https://lists.gnu.org/archive/html/nano-devel/2017-12/msg00121.html

[PATCH 3/6] hex literals: support fractional part and exponent

As of Lua 5.2,

"Hexadecimal constants also accept an optional fractional part plus an
optional binary exponent, marked by a letter 'p' or 'P'."

(from https://www.lua.org/manual/5.2/manual.html#3.1 , search for
"numerical constant").

[PATCH 4/6] remove redundant backslashes from string regex

1. Backslashes inside bracket expressions "[...]" lose their special
meaning so they don't need to be doubled.

2. From doc/nanorc.5:

"Quotes inside these string parameters don't have to be escaped with
backslashes. The last double quote in the string will be treated as
its end."

So \" should be changed to ".

[PATCH 5/6] add new and missing standard library functions

The list now includes all the Lua 5.3 functions listed on
https://www.lua.org/manual/5.3/#index

[PATCH 6/6] remove names of libraries from keyword list

In the case of known functions (e.g. "io.close"), the rules in the
"Standard library" section would highlight the function so the
"Keywords" rule that highlights "io." is superfluous.

In other cases, we decided it's best not highlight partial names.

Discussion:
https://lists.gnu.org/archive/html/nano-devel/2017-12/msg00112.html

Attachment: 0001-syntax-lua-hex-literals-require-1-digits-add-word-bo.patch
Description: Text Data

Attachment: 0002-syntax-lua-number-literals-support-fractional-part-a.patch
Description: Text Data

Attachment: 0003-syntax-lua-hex-literals-support-fractional-part-and-.patch
Description: Text Data

Attachment: 0004-syntax-lua-remove-redundant-backslashes-from-string-.patch
Description: Text Data

Attachment: 0005-syntax-lua-add-new-and-missing-standard-library-func.patch
Description: Text Data

Attachment: 0006-syntax-lua-remove-names-of-libraries-from-keyword-li.patch
Description: Text Data


reply via email to

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