Commit Graph

12 Commits (master)

Author SHA1 Message Date
Benno Schulenberg 375b30507e syntax: ruby: colorize embedded documentation as a comment
Vim and Emacs do this too.

Reference:
  https://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Lexicology

Also, when colorizing double-hashed comments specially anyway,
avoid colorizing ##.* as a single-hashed comment.
2021-10-25 13:45:21 +02:00
Benno Schulenberg 7691527f35 tweaks: remove redundant parentheses, trim comments, fold some regexes 2021-10-25 12:45:45 +02:00
Hussam al-Homsi ef6ccc47c8 syntax: perl, ruby: remove arbitrary highlighting of here documents
The rules assume that 'STOP' (for Perl) or EOT (for Ruby) is the
terminating string while it could be anything.  Also, the rules
don't take quotes nor backticks nor a tilde into account.

In short: these coloring rules are far too limited.

References:
  https://perldoc.perl.org/perlop#%3C%3CEOF
  https://docs.ruby-lang.org/en/3.0.0/doc/syntax/literals_rdoc.html#label-Here+Documents+-28heredocs-29

Signed-off-by: Hussam al-Homsi <sawuare@gmail.com>
2021-08-09 09:56:50 +02:00
Benno Schulenberg 227467adb9 syntaxes: remove some superfluous outer parentheses from regexes
Also, standardize some comments, condense a few regexes, add some
word-edge anchors, and remove some superfluous backslashes.
2020-04-21 12:49:29 +02:00
Benno Schulenberg fea5d7c612 syntaxes: uniformize the initial comment 2020-04-20 19:21:56 +02:00
Benno Schulenberg 3f3698640b syntax: ruby: colorize also lowercase global/instance variables
And avoid recoloring the reserved words BEGIN and END as constants.

Inspired-by: Rory Thrasher <thrasher@redhat.com>
2019-10-27 16:34:06 +01:00
Benno Schulenberg f2f367ba9c syntaxes: change some unneeded 'icolor' commands to 'color' commands 2019-08-17 17:01:19 +02:00
Benno Schulenberg 636e9ac3e8 syntaxes: remove several redundant end-of-line anchors from regexes 2018-11-03 21:12:44 +01:00
Benno Schulenberg c524fbe6d0 tweaks: remove some ineffectual parts from header-line regexes
Adding "[abc]*" does not restrict the recognized header line in any way.

Also, improve the header-line regex for shell scripts, because it should
not match "barunscript" (for example).
2018-08-28 19:53:36 +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 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