Skip to content

Parse failure when correct interpretation is an identifier #2297

Open
@fraser-wilson-anago

Description

@fraser-wilson-anago

Describe the bug

The attached Syntax.rsc is used to parse some small examples. A valid parse is not found.

Syntax.rsc.txt

To Reproduce

Steps to reproduce the behavior:

  1. import Syntax.rsc
  2. parse("class X feature x : T y : T end");
  3. the parse fails at position 1.

I believe it is failing to go from the identifier in the rule TypeMark to the identifier in the rule Identifier of FeatureDeclaration. The following examples do work:

  1. parse("class X feature x : T feature y : T end")
  2. parse("class X feature x : T; y : T end")
  3. parse("class X feature x : T do end y : T end")

Each of these three working examples inserts an extra token which cuts off certain branches. But I think the syntax is unambiguous without these alterations.

Expected behavior
The string class X feature x : T y : T end should be parsed without errors.

Desktop (please complete the following information):

  • Context: VSCode plugin
  • Rascal Version 0.40.17

Additional context
The Syntax.rsc is from an Eiffel grammar, stripped down for bug reproduction

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions