[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nano-devel
Subject:    Re: [Nano-devel] [PATCH] syntax: javascript: add newer keywords/syntax
From:       Benno Schulenberg <bensberg () telfort ! nl>
Date:       2017-12-25 15:25:52
Message-ID: 43849fd3-ece2-d14b-beb6-81d8efd933be () telfort ! nl
[Download RAW message or body]


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.

In subsequent patches I have added some more keywords, changed the color
of strings (to distinguish them from keywords), 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.

Looking at https://developer.mozilla.org/en-US/docs/Web/JavaScript, there
appear to be still some more keywords: instanceof, super...  And the three
other editors color "true" and "false" specially too.

Benno

_______________________________________________
Nano-devel mailing list
Nano-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/nano-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic