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

fix(frontend): Remove usage of chumsky fork #901

Closed
wants to merge 3 commits into from

Conversation

0xYYY
Copy link
Contributor

@0xYYY 0xYYY commented Feb 23, 2023

Related issue(s)

Resolves #853.

Description

Summary of changes

Replace recovier_via of the chumsky fork with skip_parser from chumsky 0.9.0.

Dependency additions / changes

- chumsky = { git = "https://github.com/jfecher/chumsky", rev = "ad9d312" }
+ chumsky = "0.9.0"

Test additions / changes

N/A

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.
  • This PR requires documentation updates when merged.

Additional context

Tests that aren't passing yet:

  • parse_block
    • { [0,1,2,3,4]
    • { [0,1,2,3 }
  • statement_recovery
    • ("let a: = 4 + 3", 1, "let a: error = (4 + 3)")
    • ("let = 4 + 3", 1, "let $error: unspecified = (4 + 3)")

Copy link
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a stab at this. When I tried it previously, I couldn't get the parser recovery tests to pass either.

@0xYYY
Copy link
Contributor Author

0xYYY commented Feb 23, 2023

for now, i comment out the failing test cases in order to point them out

will look further into these cases, also looking for some insights from those more familiar with the parser

parse_block

{ [0,1,2,3,4] case fails with the following error

---- parser::parser::test::parse_block stdout ----
thread 'parser::parser::test::parse_block' panicked at 'Repeated parser iteration succeeded but consumed no inputs (i.e: continuing iteration would likely lead to an infinite loop, if the parser is pure). This is likely indicative of a parser bug. Consider using a more specific error recovery strategy.'

{ [0,1,2,3 } case fail due to span mismatch between multiple errors, causing the following assertion to fail

assert_eq!(self.span, other.span);

---- parser::parser::test::parse_block stdout ----
thread 'parser::parser::test::parse_block' panicked at 'assertion failed: `(left == right)`
  left: `Span(Span { start: ByteIndex(11), end: ByteIndex(11) })`,
 right: `Span(Span { start: ByteIndex(2), end: ByteIndex(9) })`', crates/noirc_frontend/src/parser/errors.rs:133:9

statement_recovery

both cases are actually hanging instead of failing, possibly due to infinite recursion introduced by this change in the parser?

@pczarn
Copy link
Contributor

pczarn commented Apr 23, 2023

I picked up this work.

@jfecher
Copy link
Contributor

jfecher commented Apr 24, 2023

@pczarn thanks. It may be a valid option to replace the failing recovery tests with new recovery tests as long as we can still have some form of statement recovery. I'd also like to know the reasoning behind the infinite looping after the update since it is something we'll likely need to keep in mind for future changes.

@jfecher
Copy link
Contributor

jfecher commented Aug 3, 2023

Closing this since it is outdated. We're going to retry removing our chumsky fork once chumsky merges 1.0.0 with its zero copy branch.

@jfecher jfecher closed this Aug 3, 2023
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

Successfully merging this pull request may close these issues.

Remove chumsky fork
3 participants