Skip to content
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

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open

refactor declaration grammar #65

wants to merge 66 commits into from

Conversation

NTTVy03
Copy link
Collaborator

@NTTVy03 NTTVy03 commented Jan 6, 2025

  1. add missing signal assign token
  2. fix the grammar of the statement
  3. add statements test
  4. fix declaration, support matrix
  5. refactor declaration
  6. 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)
Copy link
Owner

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());
Copy link
Owner

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
Copy link
Owner

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?

Copy link
Collaborator Author

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.

Comment on lines 39 to 48
| | | 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 "]"
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants