Repository navigation
New Lexer: Minimal amount to allow compiling - #477
Conversation
Razican
left a comment
There was a problem hiding this comment.
Thanks for this! Check my comments so that we can clean up a bit more the code, and I will merge it in the branch, so that we can start implementing more stuff.
| impl Error { | ||
| /// Creates a new syntax error. | ||
| pub(super) fn syntax<M>(err: M) -> Self | ||
| pub(crate) fn syntax<M>(err: M) -> Self |
There was a problem hiding this comment.
Why is this public at the crate level? I think we should only be creating lexer errors in the lexer.
There was a problem hiding this comment.
I agree, however when I was trying it I found the syntax function is currently used elsewhere (outside crate) and so this change was needed to get code compiling.
There was a problem hiding this comment.
I decided it was easier just to make it super for now and then go back and make the change later (starting at a baseline of code which compiles / can be tested)
There was a problem hiding this comment.
This is where it is used:
boa/boa/src/syntax/ast/token.rs
Lines 117 to 130 in 496278c
I'm wondering if the token.rs file should actually be in the lexer directory rather than ast because the lexer is the one generating tokens.
Especially because the token.rs file seems to be doing an amount of lexing itself (FromStr implementations).
There was a problem hiding this comment.
Commit f115892 shows the result of moving the token file
Co-authored-by: Iban Eguia <[email protected]>
Co-authored-by: Iban Eguia <[email protected]>
Co-authored-by: Iban Eguia <[email protected]>
Co-authored-by: Iban Eguia <[email protected]>
Updated various external references, disabled a large number of tests to allow the code to compile after changes in (#432) , acts as a base so I can measure progress (by tests passing) as I start reimplementing stuff.