Merged
Conversation
vuvoth
reviewed
Jan 18, 2025
Update crates/lsp/src/global_state.rs Co-authored-by: Vu Vo <vu.voth@gmail.com>
c6dcb66 to
783f2a7
Compare
vuvoth
approved these changes
Feb 9, 2025
Comment on lines
56
to
84
| pub(crate) fn var_init(p: &mut Parser) { | ||
| let var_identifier_open_marker = p.open(); | ||
|
|
||
| // name of variable | ||
| p.expect(Identifier); | ||
| // eg: [N - 1][M] | ||
| array(p); | ||
|
|
||
| p.close(var_identifier_open_marker, VarIdentifier); | ||
|
|
||
| // assign for variable | ||
| // eg: = 10 | ||
| if p.at_var_assign() { | ||
| p.advance(); | ||
| expression(p); | ||
| } | ||
| } | ||
|
|
||
| // eg: in[N - 1] <== c.in; | ||
| pub(crate) fn signal_init(p: &mut Parser, assign_able: bool) { | ||
| let signal_identifier_open_marker = p.open(); | ||
| // name of signal | ||
| p.expect(Identifier); | ||
| // eg: [N][M-1] | ||
| array(p); | ||
| p.close(signal_identifier_open_marker, SignalIdentifier); | ||
|
|
||
| // assign for intermediate and outputs signals | ||
| // eg: <== Multiplier2().out |
Owner
There was a problem hiding this comment.
Duplicate logic. We can make it simple.
|
|
||
| // support array component | ||
| // eg: comp[N - 1][10] | ||
| let _ = array(p); |
Owner
There was a problem hiding this comment.
Suggested change
| let _ = array(p); | |
| array(p); | |
crates/parser/src/grammar/list.rs
Outdated
| expression(p); | ||
|
|
||
| // there are no expressions remaining | ||
| if p.eat(Comma) == false { |
Owner
There was a problem hiding this comment.
Suggested change
| if p.eat(Comma) == false { | |
| if !p.eat(Comma) { | |
| } | ||
|
|
||
| /** | ||
| * grammar: "[iden1, iden2,..., idenn]" |
Owner
There was a problem hiding this comment.
Suggested change
| * grammar: "[iden1, iden2,..., idenn]" | |
| * grammar: "[iden1, iden2,..., idenn]" | |
| Only use in main component. |
| log() | ||
| log(<pattern1>, <pattern2>, ... <patternn>) | ||
| */ | ||
| fn log_statement(p: &mut Parser) { |
NTTVy03
added a commit
that referenced
this pull request
Feb 9, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
out[k] * (out[k] - 1) === 0