Skip to content

Syntax rule for non-doc line comments #608

@mattheww

Description

@mattheww

§2.5 (fls_q8l2jza7d9xa) provides the following syntax rule for a non-doc line comment:

LineComment ::=
    //
  | // (~[! /] | //) ~[\n]*

The ~[! /] expression is there to make sure this rule doesn't match an outer line doc.

But that expressions matches too broadly: it accepts LF, which it shouldn't (the notation ~[X Y] is defined in §1.1.4:14 (fls_blvsfqeevosr) and means to match a single character other than X or Y).

That means that this syntax rule says, for example, that the following input
is a single LineComment:

//
x = 1

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