File tree Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Expand file tree Collapse file tree 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -166,17 +166,38 @@ CommentedArrayEntry
166166 * Identifiers and Values
167167 */
168168Identifier
169- = id :[A-Za-z0-9] +
170- { return id . join ( ' ' ) }
169+ = id :[A-Za-z0-9_] + { return id . join ( ' ' ) }
170+ / QuotedString
171171
172172Value
173173 = Object / Array / NumberValue / StringValue
174174
175175NumberValue
176+ = DecimalValue / IntegerValue
177+
178+ DecimalValue
179+ = IntegerValue "." IntegerValue
180+
181+ IntegerValue
176182 = ! Alpha number :Digit + ! Alpha
177183 { return parseInt (number, 10 ) }
178184
179185StringValue
186+ = QuotedString / LiteralString
187+
188+ QuotedString
189+ = DoubleQuote str :QuotedBody DoubleQuote { return str }
190+
191+ QuotedBody
192+ = str :NonQuote + { return str .join (' ' ) }
193+
194+ NonQuote
195+ = EscapedQuote / ! DoubleQuote char :. { return char }
196+
197+ EscapedQuote
198+ = "\\ " DoubleQuote { return ' \" ' }
199+
200+ LiteralString
180201 = literal :LiteralChar + { return literal .join (' ' ) }
181202
182203LiteralChar
@@ -203,6 +224,9 @@ Digit
203224Alpha
204225 = [A-Za-z]
205226
227+ DoubleQuote
228+ = '"'
229+
206230_ "whitespace"
207231 = whitespace *
208232
You can’t perform that action at this time.
0 commit comments