mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Remove regex from TextMateGrammar's Pattern class
We build a native `OnigScanner` object at the `Rule` level which tries to match every regex for the entire rule, rather than using an individual regex for each pattern from the JS side.
This commit is contained in:
@@ -121,7 +121,6 @@ class Pattern
|
||||
pushRule: null
|
||||
popRule: false
|
||||
scopeName: null
|
||||
regex: null
|
||||
captures: null
|
||||
backReferences: null
|
||||
|
||||
@@ -131,11 +130,9 @@ class Pattern
|
||||
if @hasBackReferences = hasBackReferences ? /\\\d+/.test(match)
|
||||
@match = match
|
||||
else
|
||||
@regex = new OnigRegExp(match)
|
||||
@regexSource = match
|
||||
@captures = captures
|
||||
else if begin
|
||||
@regex = new OnigRegExp(begin)
|
||||
@regexSource = begin
|
||||
@captures = beginCaptures ? captures
|
||||
endPattern = new Pattern(@grammar, { match: end, captures: endCaptures ? captures, popRule: true})
|
||||
|
||||
Reference in New Issue
Block a user