Skip to content

invalid literals are accepted in object #60

@jialinli98

Description

@jialinli98

Aim

#[test]
fn test_incorrect_json_parsing() {
    let text = "{ \"name\":fal }";
    let mut json: JSON<153, 10, 60, 60, 2> = JSON::parse_json_from_string(text);

This test passes. For literal scans, we only check if each letter is part of a literal, but are not checking if the combination is a valid literal. We should add a check is_false as Field + is_null as Field + is_true as Field == 1 at the end of literal scan.

Expected Behavior

Only true, false, null should be accepted as literals.

Bug

We are only checking on individual letters, but not the full string.

To Reproduce

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

No response

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions