Added ABNF grammar to library(charsio) as well as octet character type that it depends on. Modified library(json) to use the new ABNF grammar.

This commit is contained in:
panasenco
2021-04-27 22:48:03 -07:00
parent 061221b073
commit 0198fe90b6
5 changed files with 139 additions and 27 deletions

View File

@@ -36,7 +36,7 @@ minify_sample_json :-
test_path("pass_everything.min.json", MinPath),
setup_call_cleanup(
open(MinPath, write, Stream),
format(Stream, "~s", [MinChars]),
format(Stream, "~s~n", [MinChars]),
close(Stream)
).
@@ -45,7 +45,8 @@ test_json_minify :-
once(phrase_from_file(seq(RefChars), MinPath)),
name_parse("pass_everything.json", Json),
time(once(phrase(json_chars(Json), MinChars))),
RefChars = MinChars.
append(MinChars, "\n", MinFileChars),
RefChars = MinFileChars.
test_json_int_float :-
once(phrase(json_chars(number(ZeroInt)), "0")),