From 33c6fe80098a009bd3bfd2d00276f064fdab2452 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 25 Oct 2012 12:07:13 -0600 Subject: [PATCH] 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. --- src/app/text-mate-grammar.coffee | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/text-mate-grammar.coffee b/src/app/text-mate-grammar.coffee index ea7d70cda..1e8eab8fc 100644 --- a/src/app/text-mate-grammar.coffee +++ b/src/app/text-mate-grammar.coffee @@ -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})