Skip to content

Found inconsistent error due to inconsistency in pest file #97

Closed
@thehiddenwaffle

Description

@thehiddenwaffle

Was writing code to parse the AST and noticed that function names are currently accepted by the pest schema as comparison ops.

let parse_result_normal = parse_json_path("$[? 5 >= 5]").unwrap();

let parse_result = parse_json_path("$[? 5 badName 5]").unwrap_err();
assert!(matches!(parse_result, JsonPathError::PestError(_)), "{parse_result} should be a pest error");

// Currently returns JsonPathError::InvalidJsonPath
let parse_result2 = parse_json_path("$[? 5 noneOf 5]").unwrap_err();
assert!(matches!(parse_result2, JsonPathError::PestError(_)), "{parse_result2} should be a pest error"); // <-- this fails

I believe the pest grammar rule comp_op should not include function names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions