lexer: made REGEX more accurate
This commit is contained in:
parent
b0e34edf99
commit
24a0015148
|
@ -605,7 +605,7 @@
|
|||
MULTI_DENT = /^(?:\n[ \t]*)+/;
|
||||
SIMPLESTR = /^'[^\\']*(?:\\.[^\\']*)*'/;
|
||||
JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/;
|
||||
REGEX = /^\/(?!\s)(?:[^[\/\n\\]+|\\.|\[([^\\\]]+|\\.)*])+\/[imgy]{0,4}(?![A-Za-z])/;
|
||||
REGEX = /^\/(?!\s)(?:[^[\/\n\\]+|\\[\s\S]|\[([^\]\n\\]+|\\[\s\S])*])+\/[imgy]{0,4}(?![A-Za-z])/;
|
||||
HEREGEX = /^\/{3}([\s\S]+?)\/{3}([imgy]{0,4})(?![A-Za-z])/;
|
||||
HEREGEX_OMIT = /\s+(?:#.*)?/g;
|
||||
MULTILINER = /\n/g;
|
||||
|
|
|
@ -557,10 +557,10 @@ JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/
|
|||
|
||||
# Regex-matching-regexes.
|
||||
REGEX = /// ^
|
||||
/ (?!\s) # disallow leading whitespace
|
||||
(?: [^ [ / \n \\ ]+ # every other thing
|
||||
| \\. # anything escaped
|
||||
| \[ ( [^\\\]]+ | \\. )* ] # character class
|
||||
/ (?!\s) # disallow leading whitespace
|
||||
(?: [^ [ / \n \\ ]+ # every other thing
|
||||
| \\[\s\S] # anything escaped
|
||||
| \[ ( [^ \] \n \\ ]+ | \\[\s\S] )* ] # character class
|
||||
)+
|
||||
/ [imgy]{0,4} (?![A-Za-z])
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue