Fixed array problem with one element.

This commit is contained in:
yhirose 2015-07-25 20:22:06 -04:00
parent 4fbbdf708a
commit ea9dd315ae
2 changed files with 4 additions and 1 deletions

View File

@ -86,7 +86,7 @@ inline peglib::peg& get_parser()
throw std::logic_error("invalid peg grammar");
}
parser.enable_ast(true, { "PARAMETERS", "ARGUMENTS", "OBJECT" });
parser.enable_ast(true, { "PARAMETERS", "ARGUMENTS", "OBJECT", "ARRAY" });
}
return parser;

View File

@ -49,6 +49,9 @@ test_array = fn () {
b = []
assert(b.size() == 0)
c = [1]
assert(c.size() == 1)
}
g_ = 1