Commit Graph

11 Commits (2e81023553ca9fb14c3e58861a6f51cc08b1355a)

Author SHA1 Message Date
Mark-Weston bf5949395d syntax: lua: do not color strings inside comments, and add a linter
Also, don't partially color "..." as an operator, because it isn't,
and color also the unary operator "#".

Signed-off-by: Mark-Weston <markweston@cock.li>
2018-08-28 20:16:16 +02:00
Benno Schulenberg 3e1fc6385b syntaxes: remove quotes from each syntax name, and color it differently
The different color will make the name stand out, as it should, instead
of looking the same as all the regex strings.
2018-02-14 17:36:50 +01:00
Benno Schulenberg c6f367268b syntax: lua: do not color debug.setinfo as it doesn't exist
Reported-by: Tom Levy <tomlevy93@gmail.com>
2018-01-06 17:59:28 +01:00
Benno Schulenberg 21cd953e85 syntax: lua: condense some regexes, tweak comments, reorder things
Also remove some redundant backslashes and parentheses.
2018-01-01 14:59:00 +01:00
Tom Levy 058b9da9b9 syntax: lua: 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.

Also, remove the coloring of just the library name, so that
only known library functions get highlighted.

Signed-off-by: Tom Levy <tomlevy93@gmail.com>
2018-01-01 14:35:19 +01:00
Tom Levy 38a10a62d0 syntax: lua: support fractional part and exponent for decimal and hex
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'"
(see at the end of https://www.lua.org/manual/5.2/manual.html#3.1).

The new regexes do not match a leading nor a trailing dot, but they
are good enough.  Discussion on the mailing list:
https://lists.gnu.org/archive/html/nano-devel/2017-12/msg00121.html

Signed-off-by: Tom Levy <tomlevy93@gmail.com>
2018-01-01 14:15:14 +01:00
Tom Levy 091e8faf6d syntax: lua: require at least one digit for hexadecimal numbers
Since a "0x" by itself is invalid.  Also add word boundaries, so that
e.g. "00x1" (which is invalid) does not get partial highlighting.

Also remove some redundant backslashes from the strings regex.

Signed-off-by: Tom Levy <tomlevy93@gmail.com>
2018-01-01 13:51:10 +01:00
Benno Schulenberg 1f48ed0412 syntaxes: remove redundant word-boundary markers 2017-12-30 17:32:15 +01:00
Tom Levy 4f2b01c7e5 syntax: lua: correct the word boundaries on standard library functions
Functions such as "io.close" should only be highlighted when the
package name ("io") is a word by itself, otherwise code such as
"fooio.close" gets unexpected partial highlighting.

Signed-off-by: Tom Levy <tomlevy93@gmail.com>
2017-12-28 21:46:26 +01:00
Benno Schulenberg bacb0f717d syntax: adjust the magic strings for the changes since file-5.10
Since file-5.10 (end of 2011), libmagic identifies a C file in most
cases as "C source" instead of as "C program".  Nano's magic strings
for some other files didn't match any more what file-5.32 currently
produces, either.  So, they have been adjusted, new ones added, and
old ones deleted.

This fixes https://savannah.gnu.org/bugs/?52445.
2017-11-19 11:24:30 +01:00
Benno Schulenberg b0ef2e2803 build: move the syntax files out of the doc/ directory
They are not documentation, they are functional elements of nano.
2016-12-30 22:05:01 +01:00