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

CDDL parsing fails with carefully placed newline. #80

Closed
d3zd3z opened this issue Dec 9, 2020 · 2 comments · Fixed by #81
Closed

CDDL parsing fails with carefully placed newline. #80

d3zd3z opened this issue Dec 9, 2020 · 2 comments · Fixed by #81
Assignees
Labels
bug Something isn't working parser
Milestone

Comments

@d3zd3z
Copy link

d3zd3z commented Dec 9, 2020

In the following block of CDDL:

top-level = top-group

;; This fails to parse with the newline after the "=>"
top-group //= (identifier-a =>
    int)

;; It parses without the newline, or if the newline is before the
;; arrow.
top-group //= (identifier-b => int)
top-group //= (identifier-c
    => int)

identifier-a = 1
identifier-b = 2
identifier-c = 3

The first top-group declaration cause a parse error. It seems to require both using an identifier as the key, and having the newline after the arrow. It is easy to work around by either moving the arrow to the new line, or just joining the lines.

error: parser errors
  ┌─ input:4:31
  │
4 │   top-group //= (identifier-a =>
  │ ╭──────────────────────────────^
5 │ │     int)
  │ ╰^ invalid group entry syntax

Error: "Parser error"
@anweiss anweiss self-assigned this Dec 11, 2020
@anweiss anweiss added the bug Something isn't working label Dec 11, 2020
@anweiss anweiss added this to the v1.0.0 milestone Dec 11, 2020
@anweiss
Copy link
Owner

anweiss commented Dec 11, 2020

Thanks for reporting @d3zd3z. Will get this fixed!

@anweiss
Copy link
Owner

anweiss commented Jan 25, 2021

This has been fixed as of v0.8.6. Pleas reopen if you are still experiencing issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants