Changes between Initial Version and Version 1 of Ticket #2145, comment 3


Ignore:
Timestamp:
02/29/20 06:31:07 (19 months ago)
Author:
andrew_b
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2145, comment 3

    initial v1  
    44And different problem. It looks that current JS highlighting rules doesn't 
    55include case for regexps at all. Finding regular expression isn't hard, 
    6 scan non-comments and non-strings for /\/.+(?<!\\)\//[igmy]* regexp.  
     6scan non-comments and non-strings for `/\/.+(?<!\\)\//[igmy]*` regexp.  
    77 
    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) 
     8As 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) 
    99 
    10 .+ becuase 'var a = //;' is illegal as this is empty regexp (would always match), and actually it is a commened ';'  string 
     10`.+` becuase `'var a = //;'` is illegal as this is empty regexp (would always match), and actually it is a commened `';'`  string 
    1111 
    1212