File tree Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Expand file tree Collapse file tree 1 file changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ EmptyBody
3636 { return Object .create (null ) }
3737
3838AssignmentList
39- = _ head :Assignment _ tail :(( AssignmentList ) * ) _
39+ = _ head :Assignment _ tail :AssignmentList * _
4040 {
4141 if (tail) return merge (head,tail)
4242 else return head
@@ -130,7 +130,36 @@ DelimitedSectionEnd
130130 * Arrays: lists of values, possible wth comments
131131 */
132132Array
133- = "(" [^)]+ ")"
133+ = "(" arr :(ArrayBody / EmptyArray ) ")" { return arr }
134+
135+ EmptyArray
136+ = _ { return [] }
137+
138+ ArrayBody
139+ = _ head :ArrayEntry _ tail :ArrayBody ? _
140+ {
141+ if (tail) {
142+ tail .unshift (head);
143+ return tail;
144+ } else {
145+ return [head];
146+ }
147+ }
148+
149+ ArrayEntry
150+ = SimpleArrayEntry / CommentedArrayEntry
151+
152+ SimpleArrayEntry
153+ = val :Value "," { return val }
154+
155+ CommentedArrayEntry
156+ = val :Value _ comment :InlineComment ","
157+ {
158+ var result = Object .create (null );
159+ result .value = val;
160+ result .comment = comment;
161+ return result;
162+ }
134163
135164/*
136165 * Identifiers and Values
You can’t perform that action at this time.
0 commit comments