aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-05-03 21:52:52 +0100
committerMichael Williamson <mike@zwobble.org>2013-05-03 21:52:52 +0100
commit4746d8f52c7287f9f71f393f6a5220130ed3d984 (patch)
tree1893734a164fd7beb705875c7d5299e540c2eee4 /lib
parent2558a4cc0df494f7b9380e9b34b85c5dd1c83010 (diff)
Add parsing for run matchers
Diffstat (limited to 'lib')
-rw-r--r--lib/style-reader.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/style-reader.js b/lib/style-reader.js
index 757dc30..be5ab20 100644
--- a/lib/style-reader.js
+++ b/lib/style-reader.js
@@ -18,8 +18,20 @@ function readDocumentMatcher(string) {
}
);
+ var runRule = lop.rules.then(
+ lop.rules.token("identifier", "r"),
+ function() {
+ return documentMatchers.run;
+ }
+ );
+
+ var elementTypeRule = lop.rules.firstOf("p or r",
+ paragraphRule,
+ runRule
+ );
+
var matcherRule = sequence(
- sequence.capture(paragraphRule),
+ sequence.capture(elementTypeRule),
sequence.capture(lop.rules.optional(classRule))
).map(function(createMatcher, styleName) {
return createMatcher(styleName.valueOrElse());