-
Notifications
You must be signed in to change notification settings - Fork 3
Handle Int nodes.
#1
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
base: main
Are you sure you want to change the base?
Handle Int nodes.
#1
Conversation
indutny
left a comment
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.
I like the direction of this Pull Request and the idea in general! Let's make this happen 😁 Thank you for your effort!
src/frontend.ts
Outdated
|
|
||
| let result = [ | ||
| new this.implementation.node.Int( | ||
| new frontend.node.Int(this.id.id(name), field, bytes, signed, littleEndian, 0) |
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.
Nitpick: Let's split it into multiple statements. Something like: const tmp = new frontend.node.Int(...).
src/frontend.ts
Outdated
| let next = result[0]; | ||
| for (let offset = 1; offset < node.bytes; offset++) { | ||
| result[offset] = new this.implementation.node.Int( | ||
| new frontend.node.Int(this.id.id(name + '_byte' + (offset + 1)), field, bytes, signed, littleEndian, offset) |
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.
Nitpick: similar recommendation here. Perhaps even move this.id.id() to a separate statement too. Also, would be great opportunity to use template syntax here: ${name}_byte${offset + 1}.
|
Oh and of course it needs a test! |
No description provided.