Skip to content

Home page example doesn't work as described #46

@eugenesvk

Description

@eugenesvk

upd: the website Editor should try to pick the semantically top-level rule instead of the first in an alphabetically sorted order, or if it's not possible, at least do this for the example from the homepage

Or maybe the easier option is to just document that the user needs to select the general rule manually

Describe the bug

I was trying out the example from the home page and instead of getting the error mentioned there got a working - alpha: "a"

To Reproduce

  1. add the grammar from the home page
alpha = { 'a'..'z' | 'A'..'Z' }
digit = { '0'..'9' }

ident = { (alpha | digit)+ }

ident_list = _{ !digit ~ ident ~ (" " ~ ident)+ }
          // ^
          // ident_list rule is silent (produces no tokens or error reports)
  1. paste ab *

Expected behavior

Get the error message

thread 'main' panicked at ' --> 1:1
  |
1 | ab *
  |    ^---
  |
  = expected ident', src/main.rs:12

Actual behavior

Happy parsing outcome - alpha: "a"

Additional context

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