Skip to content

Commit

Permalink
fix: grammar //// parsing error. (fixes #817) (#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Mar 4, 2023
1 parent 18ca64f commit ebb1ccd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions grammars/src/grammars/json.pest
Expand Up @@ -19,6 +19,10 @@ pair = { string ~ ":" ~ value }

array = { "[" ~ value ~ ("," ~ value)* ~ "]" | "[" ~ "]" }


//////////////////////
/// Matches value, e.g.: `"foo"`, `42`, `true`, `null`, `[]`, `{}`.
//////////////////////
value = { string | number | object | array | bool | null }

string = @{ "\"" ~ inner ~ "\"" }
Expand Down
2 changes: 1 addition & 1 deletion meta/src/grammar.pest
Expand Up @@ -171,6 +171,6 @@ space = _{ " " | "\t" }
/// A top-level comment.
grammar_doc = ${ "//!" ~ space? ~ inner_doc }
/// A rule comment.
line_doc = ${ "///" ~ space? ~ !"/" ~ inner_doc }
line_doc = ${ "///" ~ space? ~ inner_doc }
/// A comment content.
inner_doc = @{ (!newline ~ ANY)* }

0 comments on commit ebb1ccd

Please sign in to comment.