aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-04-27 16:18:42 +0100
committerMichael Williamson <mike@zwobble.org>2014-04-27 16:18:42 +0100
commita8b849523b1ef72810309068835aa123573f9dd0 (patch)
tree28cfea27907f854f90369e8b94e91dd53ca13f52 /lib
parent869d5b2a725db8e41dc447227468c173d5292c18 (diff)
Create styleRule once
Diffstat (limited to 'lib')
-rw-r--r--lib/style-reader.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/style-reader.js b/lib/style-reader.js
index b28579c..b76478f 100644
--- a/lib/style-reader.js
+++ b/lib/style-reader.js
@@ -11,10 +11,10 @@ exports.readStyle = readStyle;
function readStyle(string) {
- return parseString(styleRule(), string);
+ return parseString(styleRule, string);
}
-function styleRule() {
+function createStyleRule() {
return lop.rules.sequence(
lop.rules.sequence.capture(documentMatcherRule()),
lop.rules.tokenOfType("whitespace"),
@@ -217,3 +217,6 @@ function tokenise(string) {
]);
return tokeniser.tokenise(string);
}
+
+
+var styleRule = createStyleRule();