Skip to content

SyntaxError: Invalid regular expression returned when parsing #21

Open
@jillyj

Description

@jillyj

Grammar file: https://github.com/opencybersecurityalliance/kestrel-lang/blob/develop/src/kestrel/syntax/kestrel.lark
Generated parser:
kestrelParser.js.zip

When parsing this statement procs2 = GET process abc, the parser throws the exception like below which is not caught by parser.
image

Code

function handle_errors(e) { return true; }

  try {
    treeData = parser.parse(text, null, handle_errors).children[0];
  } catch (e) {
    console.debug("uncaught error:", e)
  }

Expected:
This kind of error can be handled by the parser, so we can get the parsing tree and the error info like Unexpected character or Unexpected Token.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions