summaryrefslogtreecommitdiff
path: root/parser/parser.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'parser/parser.fnl')
-rw-r--r--parser/parser.fnl20
1 files changed, 14 insertions, 6 deletions
diff --git a/parser/parser.fnl b/parser/parser.fnl
index 7e9469e..3a4d563 100644
--- a/parser/parser.fnl
+++ b/parser/parser.fnl
@@ -74,12 +74,20 @@
(fn [name value] (*
(^ (peg.P name) 1)
(if (~= value "")
- (* "=\""
- ;; wildcard for any value
- (if (= value "*")
- (till "\"")
- (peg.P value))
- "\"")
+ (+
+ ;; attributes may be wrapped in both " and '
+ (* "=\""
+ ;; wildcard for any value
+ (if (= value "*")
+ (till "\"")
+ (peg.P value))
+ "\"")
+ (* "='"
+ ;; wildcard for any value
+ (if (= value "*")
+ (till "'")
+ (peg.P value))
+ "'"))
(maybe (.. "=\" name \""))))))
(local attrs-peg
(accumulate [sum pegs.spaces