epfl-dlab / epfl-dlab/transformers-CFG

Json grammar doesn't allow array

Open
#102 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
139
Forks
23
PR merge metrics
No merged PRs in 30d

Description

https://github.com/epfl-dlab/transformers-CFG/blob/main/examples/grammars/json.ebnf#L6

I just realise that the grammar here for json only allows json object at root level.

In fact, json grammar accepts array and other atomic values like string or number at root level.

So a string itself is a valid json.

Here is the spec of JSON standard: https://www.json.org/json-en.html

Probably we just need to replace the root grammar rule `json::=object` to `json::= value` and fix the potentially impacted tests.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.