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

The parser ignores lexer errors #3125

Closed
ghost opened this issue Oct 12, 2023 · 1 comment · Fixed by #3163
Closed

The parser ignores lexer errors #3125

ghost opened this issue Oct 12, 2023 · 1 comment · Fixed by #3163
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Oct 12, 2023

Aim

/*

Expected Behavior

Compilation error

Bug

Currently, the parser is ignoring lexer errors:

pub fn parse_program(source_program: &str) -> (ParsedModule, Vec<ParserError>) {
let (tokens, _lexing_errors) = Lexer::lex(source_program);
let (module, parsing_errors) = program().parse_recovery_verbose(tokens);
(module.unwrap(), parsing_errors)
}

To Reproduce

Installation Method

Compiled from source

Nargo Version

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@ghost ghost added the bug Something isn't working label Oct 12, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Oct 12, 2023
@kevaundray kevaundray assigned ghost Oct 14, 2023
@kevaundray
Copy link
Contributor

@f01dab1e good catch -- can you pick this up?

This change was made in this PR: #2760

Pinging at @jfecher for visibility.

Naively, I would see if we could convert a LexerError into a ParserError so there is no change in the API

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant