From c2c46022df8140f7340d84287ee329eba4eccfe7 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Tue, 26 Jun 2018 21:00:39 -0500 Subject: [PATCH] Fix json in_string --- examples/json/json.bnf | 2 +- spec/marpa_spec.cr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/json/json.bnf b/examples/json/json.bnf index 6269bdb..1b24e10 100644 --- a/examples/json/json.bnf +++ b/examples/json/json.bnf @@ -20,7 +20,7 @@ elements ::= value* proper => 1 separator => comma comma ~ ',' string ::= '"' in_string '"' action => do_string -in_string ~ /([^"\\]|\\[\"\\\/bftnrt]|\\u[a-fA-F0-9]{4})+/ +in_string ~ /([^"\\]|\\[\"\\\/bftnrt]|\\u[a-fA-F0-9]{4})*/ number ~ /-?([\d]+)(\.\d+)?([eE][+-]?\d+)?/ diff --git a/spec/marpa_spec.cr b/spec/marpa_spec.cr index 84341a7..066e76f 100644 --- a/spec/marpa_spec.cr +++ b/spec/marpa_spec.cr @@ -3,7 +3,7 @@ require "./spec_helper" describe Marpa do it "parses json" do grammar = File.read("examples/json/json.bnf") - input = %q([1,"abc\nd\"ef",true,-2.3,null,[],[1,2,3],{},{"a":1,"b":2}]) + input = %q([1,"abc\nd\"ef","",true,-2.3,null,[],[1,2,3],{},{"a":1,"b":2}]) parser = Marpa::Parser.new actions = JSON_Actions.new