-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor declaration grammar #65
base: master
Are you sure you want to change the base?
Conversation
NTTVy03
commented
Jan 6, 2025
- add missing signal assign token
- fix the grammar of the statement
- add statements test
- fix declaration, support matrix
- refactor declaration
- use list identity parser in the tuple
if let Some(token) = lookup_token_at_postion(&file, &program_ast, file.position(tmp)) { | ||
println!( | ||
"{:#?}", | ||
lookup_node_wrap_token(TokenKind::TemplateDef, &token) |
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.
You can apply Insta here to snapshot output and use it for test later.
let url = Url::from_file_path(Path::new("/hello/abc.tx")); | ||
let binding = url.unwrap(); | ||
let p = binding.path(); | ||
println!("{:?}", Path::new(p).parent()); |
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.
Add assert! here
| | | | SignalKw 174..180 | ||
| | | | | SignalKw 174..180 "signal" | ||
| | | | WhiteSpace 180..181 | ||
| Error 1..2 |
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.
Why do we have the error here?
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.
Because you separate the test code into other file, the format is changed ('\r' character is added before '\n'). You can read more about '\r' here
I have fixed that.
| | | Identifier 56..58 | ||
| | | | Identifier 56..58 "in" | ||
| | | LBracket 58..59 | ||
| | | | LBracket 58..59 "[" | ||
| | | Expression 59..60 | ||
| | | | Identifier 59..60 | ||
| | | | | Identifier 59..60 | ||
| | | | | | Identifier 59..60 "N" | ||
| | | RBracket 60..61 | ||
| | | | RBracket 60..61 "]" |
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.
Group this to one node.