aboutsummaryrefslogtreecommitdiff
path: root/lib/style-reader.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-05-04 16:17:21 +0100
committerMichael Williamson <mike@zwobble.org>2013-05-04 16:17:21 +0100
commit3b13af8c30ea45149b900faebc2a439e9a2be84e (patch)
tree448cde8049e5ad85f5482cb6e89fa8b23d44367d /lib/style-reader.js
parentefca7fab18dfc9d6cc384bd133ecb57016784260 (diff)
Parse choice operator in HTML paths
Diffstat (limited to 'lib/style-reader.js')
-rw-r--r--lib/style-reader.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/style-reader.js b/lib/style-reader.js
index 2f3fcf3..463edc5 100644
--- a/lib/style-reader.js
+++ b/lib/style-reader.js
@@ -113,8 +113,13 @@ function htmlPathRule() {
}
);
+ var tagNamesRule = lop.rules.oneOrMoreWithSeparator(
+ identifierRule,
+ lop.rules.tokenOfType("choice")
+ );
+
var styleElementRule = lop.rules.sequence(
- capture(identifierRule),
+ capture(tagNamesRule),
capture(lop.rules.zeroOrMore(classRule)),
capture(freshRule)
).map(function(tagName, classNames, fresh) {
@@ -178,7 +183,8 @@ function tokenise(string) {
{name: "arrow", regex: /=>/},
{name: "open-paren", regex: /\(/},
{name: "close-paren", regex: /\)/},
- {name: "integer", regex: /([0-9]+)/}
+ {name: "integer", regex: /([0-9]+)/},
+ {name: "choice", regex: /\|/}
]);
return tokeniser.tokenise(string);
}