Changes between Initial Version and Version 1 of Ticket #2145, comment 3
- Timestamp:
- 02/29/20 06:31:07 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #2145, comment 3
initial v1 4 4 And different problem. It looks that current JS highlighting rules doesn't 5 5 include case for regexps at all. Finding regular expression isn't hard, 6 scan non-comments and non-strings for /\/.+(?<!\\)\//[igmy]*regexp.6 scan non-comments and non-strings for `/\/.+(?<!\\)\//[igmy]*` regexp. 7 7 8 As i understand problem is that / can be both division operator and beginig of the regexp. Simples difference is that before / in regexp we need to have: { or ( or [ or , or ; or = or other oprator ( + - / & && || | ^ ~). But befor division operator we need to have ) or digit or letter or dot. (We inore of course whitespaces in the match)8 As i understand problem is that / can be both division operator and beginig of the regexp. Simples difference is that before / in regexp we need to have: { or ( or [ or , or ; or = or other oprator (`+ - / & && || | ^ ~`). But befor division operator we need to have ) or digit or letter or dot. (We inore of course whitespaces in the match) 9 9 10 .+ becuase 'var a = //;' is illegal as this is empty regexp (would always match), and actually it is a commened ';'string10 `.+` becuase `'var a = //;'` is illegal as this is empty regexp (would always match), and actually it is a commened `';'` string 11 11 12 12