Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Conversation

- added `prelude` - moved `ast` to `parser` - moved `Lexer` from `crate::lexer::lexer::Lexer` to `crate::lexer::Lexer` - renamed `LexerError` to `SyntaxError` - moved `SyntaxError` to `token::error` - implemented `Display` for `SyntaxError` - add `tokens.txt` to integration tests - removed all unit tests for `Lexer` ( everything is tested in integration tests ) - improved syntax error assertations
Comment on lines +32 to +33
content.push_str("static PARSER: Parser = Parser::new();\n");
content.push_str("static LEXER: Lexer = Lexer::new();\n\n");
Copy link
Collaborator Author

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.

@azjezz
Copy link
Collaborator Author

azjezz commented Dec 1, 2022

now that we can know what scope we are in, we can improve the type parser, and be able to figure out if self, parent, static are valid in the current context/scope.

more things we can do with this new state Scope:

  • error on __CLASS__ outside class scope
  • error on __METHOD__ outside method scope
  • error on __FUNCTION__ outside function scope
  • error on readonly for properties when inside a readonly class scope ( this is allowed 🙄 )
Signed-off-by: azjezz <azjezz@protonmail.com>
Signed-off-by: azjezz <azjezz@protonmail.com>
@ryangjchandler ryangjchandler merged commit 5c92f7f into php-rust-tools:main Dec 4, 2022
@azjezz
Copy link
Collaborator Author

azjezz commented Dec 4, 2022

🎉

@azjezz azjezz deleted the develop branch December 4, 2022 08:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants