[Top][All Lists]

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

Re: [Nano-devel] [PATCH] syntax: javascript: add newer keywords/syntax

From: Mike Frysinger
Subject: Re: [Nano-devel] [PATCH] syntax: javascript: add newer keywords/syntax
Date: Thu, 4 Jan 2018 04:58:13 -0500

On 25 Dec 2017 16:25, Benno Schulenberg wrote:
> Op 19-12-17 om 19:58 schreef Benno Schulenberg:
> > Op 18-12-17 om 20:26 schreef Mike Frysinger:
> >> -color green "\<(const|function|let|this|typeof|var|void)\>" +color green 
> >> "\<(async|await|class|const|export|extends|function|import|let|this|typeof|var|void)\>"
> >>  color brightyellow "\<(for|if|while|with|do|else|case|default|switch)\>" 
> >>  color brightyellow "\<(export|try|throw|catch|new|delete)\>"
> > 
> > This duplicates the word "export".  I'm guessing that "import" and "export" 
> > should preferably have the same color.  So... should "import" be moved to 
> > the
> > brightyellow, or should "export" be removed from it?
> Looking at vim and Emacs and Geany, the latter two color most keywords in
> a single color.  But vim distinguishes two groups, and colors "import" and
> "export" the same way.  So I have done that for nano too.
> Also, "await" seems to belong in the same group as "import" and "export",
> so I have moved it there -- it is not a `declarational` keyword but an
> `active` one.

i don't feel strongly about the specific choices.  i went with green for import
and export since they are in the "decleration" category (they're explicitly
declaring symbols to import or export).

> have removed the coloring
> of uppercase words and of some special single-quoted strings whose purpose
> I did not understand -- they seemed to want to color octal and hexadecimal
> numbers, plus something mysterious -- and have put in another method of
> coloring octal/decimal/hexadecimal numbers.

i'm assuming you mean these rules:
color brightred "\<[A-Z_][0-9A-Z_]+\>"
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" 

i think you've misread them entirely.

the first is meant to capture constant variable names which are commonly
written using uppercase.  that should be restored imo, especially since we
do it for many other languages in nano.

the second is for colorizing escape sequences, not arbitrary numbers.  then
again, i think they end up always being clobbered by the following string
highlighting rule.  so probably best to delete both it and your new number

your commit ab62d28817ed7ba46aa04113aa9b99f0fe827d9d breaks valid syntax.
        var foo = 'value';// some comment.

Attachment: signature.asc
Description: Digital signature

reply via email to

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