Syntax file for JavaScript

Vlad Romanenko VladRomanenko at ukr.net
Tue Sep 17 13:21:59 UTC 2002


> From: Pavel Roskin [mailto:proski at gnu.org] 
[...]

> I don't really understand why you implemented number 
> highlighting in such strange way.
> Maybe you just had a problem figuring out how to do it
> right?  That's understandable, since the syntax is weird.
Yes, you're right!  ;)
Thank you for clearing this out.

> I also moved the numbers before "-",
> so that negative numbers are highlighted too.

Based on you rules for numbers I created more powerful rules, that cover
everything from hex numbers and numbers with decimal point to scientific
notation. ("-" before negative numbers is highlighted as unary operator,
not as a part of number).
You can test all these rules using attached file js-number-test.js.

Please, look at new js.syntax.
I applied to it changes from CVS, added new number highlighting rules
and made some smaller changes.

I think you also need to add js.syntax to syntax/Makefile.am
Here is a trivial patch for that. (Makefile.am.patch)

Regards,
Vlad Romanenko.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: js-numbers-test.js
Type: application/octet-stream
Size: 377 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20020917/a8ac025e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: js.syntax
Type: application/octet-stream
Size: 5149 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20020917/a8ac025e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile.am.patch
Type: application/octet-stream
Size: 239 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20020917/a8ac025e/attachment-0002.obj>


More information about the mc-devel mailing list