Skip to content

Inconsistent parsing errors with nested comments and trailing semicolon #63

@benny779

Description

@benny779

Description

There is inconsistent and unexpected behavior when parsing expressions that include nested comments.
Depending on whether a semicolon is present after the comment block, different and misleading errors are thrown.

Reproduction

Input A

/*
  a ?? b;
  /* nested comment */
  a ?? b;
*/
1

Error

The left side of the "/" operator must evaluate to a number

Input B

/*
  a ?? b;
  /* nested comment */
  a ?? b;
*/;
1

Error

Semicolon ";" cannot be used here. Semicolons are used to separate sub-expressions in top-level mappings, parenthesis blocks and function definitions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions