forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lexer + Parser recovery & Gathering errors in sway-error (FuelLabs#2891)
This PR achieves a couple of related things. 1. All compiler errors are moved into the common `sway-error` crate. The `Handler` type is now also moved there, and now uses `CompileError` instead of `ParseError`. That's also the main goal, to generalize `Handler` to all sorts of errors, which will help solve FuelLabs#2734 soon. 2. Using 1, we can now also emit `LexError`s into the `Handler`, so this enables lexer recovery. 3. Lexer recovery is added for e.g., `42y8`, which fixes FuelLabs#2865. 4. Lexer recovery is added for `'abc'` char literals, which fixes FuelLabs#2864. The AST supports them, but the rest of the compiler does not, so this will be useful later on, but was good for recovery framework testing. 5. Lexer recovery is added for mismatched open/close delimiters, e.g., `fn foo() { )`. 6. Lexer recovery is added for unexpected closing delimiters, e.g., `fn foo() }`. 7. Lexer recovery is added for unclosed delimiters. 8. Parser recovery is added for `let x =`, which fixes FuelLabs#2815. 9. Misc lexer refactoring and simplifications are made.
- Loading branch information
Showing
128 changed files
with
1,986 additions
and
1,718 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.