This repository was archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
merge develop into main
#148
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5b1962c
chore: refactor project structure
azjezz 9bde28a
chore: don't use class member flags for interface member flags
azjezz 7c38723
feat: make parser, and lexer immutable
azjezz 66bfa1b
feat: add parser state scope
azjezz acce902
fix: enum parser
azjezz 2a66520
fix: properties parser
azjezz 9f87dae
fix: namespace parser
azjezz db1eae4
fix: make sure that properties have the correct type
azjezz 6a5c1ec
fix: require comma between parameters
azjezz be93a3c
fix: use by reference in anonymous functions (#10)
azjezz 1e487ea
fix: multiple issues regarding optional comma
azjezz 5888e3a
fix: don't allow multiple default arms for match expression
azjezz 988b93e
fix: support scoped types
azjezz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,6 @@ jobs: | |
| run: | | ||
| cargo fmt --all -- --check | ||
| cargo clippy | ||
|
|
||
| - name: test | ||
| run: ./meta/test --all -- --skip third_party | ||
This file contains hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| use std::fmt::Display; | ||
|
|
||
| use crate::lexer::token::Span; | ||
|
|
||
| pub type SyntaxResult<T> = Result<T, SyntaxError>; | ||
|
|
||
| #[derive(Debug, Eq, PartialEq)] | ||
| pub enum SyntaxError { | ||
| UnexpectedEndOfFile(Span), | ||
| UnexpectedError(Span), | ||
| UnexpectedCharacter(u8, Span), | ||
| InvalidHaltCompiler(Span), | ||
| InvalidOctalEscape(Span), | ||
| InvalidOctalLiteral(Span), | ||
| InvalidUnicodeEscape(Span), | ||
| UnpredictableState(Span), | ||
| } | ||
|
|
||
| impl Display for SyntaxError { | ||
| fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
| match self { | ||
| Self::UnexpectedEndOfFile(span) => write!( | ||
| f, | ||
| "Syntax Error: unexpected end of file on line {} column {}", | ||
| span.0, span.1 | ||
| ), | ||
| Self::UnexpectedError(span) => write!( | ||
| f, | ||
| "Syntax Error: unexpected error on line {} column {}", | ||
| span.0, span.1 | ||
| ), | ||
| Self::UnexpectedCharacter(char, span) => write!( | ||
| f, | ||
| "Syntax Error: unexpected character `{:?}` on line {} column {}", | ||
| *char as char, span.0, span.1 | ||
| ), | ||
| Self::InvalidHaltCompiler(span) => write!( | ||
| f, | ||
| "Syntax Error: invalid halt compiler on line {} column {}", | ||
| span.0, span.1 | ||
| ), | ||
| Self::InvalidOctalEscape(span) => write!( | ||
| f, | ||
| "Syntax Error: invalid octal escape on line {} column {}", | ||
| span.0, span.1 | ||
| ), | ||
| Self::InvalidOctalLiteral(span) => write!( | ||
| f, | ||
| "Syntax Error: invalid octal literal on line {} column {}", | ||
| span.0, span.1 | ||
| ), | ||
| Self::InvalidUnicodeEscape(span) => write!( | ||
| f, | ||
| "Syntax Error: invalid unicode escape on line {} column {}", | ||
| span.0, span.1 | ||
| ), | ||
| Self::UnpredictableState(span) => write!( | ||
| f, | ||
| "Syntax Error: Reached an unpredictable state on line {} column {}", | ||
| span.0, span.1 | ||
| ), | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can now be sent across threads safely, meaning we can have multiple threads parsing different files using the same parser, previously that was not possible.