Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag names with dashes are not accepted by the parser #58

Open
meiao opened this issue May 20, 2020 · 0 comments
Open

Tag names with dashes are not accepted by the parser #58

meiao opened this issue May 20, 2020 · 0 comments

Comments

@meiao
Copy link

meiao commented May 20, 2020

While going thru the increment demo, I tried to add a polymer webcomponent to the page.
The grammar seemed fine with it, but I got the following compilation error (macro panic).

error: proc macro panicked
  --> src/lib.rs:80:9
   |
80 | /         view! {
81 | |             <div>
82 | |                 <iron-icon icon="check"/>
83 | |             </div>
84 | |         }
   | |_________^
   |
   = help: message: called `Result::unwrap()` on an `Err` value: Error { variant: ParsingError { positives: [tag, text], negatives: [] }, location: Pos(8), line_col: Pos((1, 9)), path: None, line: "< div > < iron - icon icon = \"check\" / > < / div >", continued_line: None }

To untrained eyes, it looks like it is trying to separate the tag name using the '-'.

Testing the grammar on pest.rs shows the tokens just fine.

- tag
  - tag_name: "div"
  - attributes: ""
  - children > tag
    - tag_name: "iron-icon"
    - attributes
      - key: "icon"
      - string: "check"
- EOI: ""

Changing the iron-icon tag to ironicon allows the code to compile, but then the tag is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant