Skip to content

Lack of precedence in OR clause causes lexical ambiguity for comments #2079

@kayabaNerve

Description

@kayabaNerve

/**/* */*/, in its entirety, is a valid BLOCK_COMMENT_OR_DOC if and only if the outer comment is interpreted as an OUTER_BLOCK_DOC AFAICT. The beginning of the stream also matches as a BLOCK_COMMENT however, which will match only /**/, leaving the rest as remaining tokens (which appears to be the compiler's current behavior).

The notation gives precedence to sequences over the OR operator but does not define precedence when multiple branches are candidates.

I believe the latter may be too notable of a change over updating the comment syntax here, but I'm also unsure the likelihood this was an assumption never actually written which should be included. I also know the comment syntax is also incredibly verbose. I'm happy to leave that question to those with experience.

Also, apologies if I did make a mistake or miss something. I'd be happy to hear why this is invalid :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lexerArea: Lexical specification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions