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

Implement more supernodes for incrementing/decrementing #221

Merged
merged 2 commits into from
Oct 5, 2024

Conversation

smarr
Copy link
Member

@smarr smarr commented Oct 5, 2024

This PR adds various supernodes and generalizes existing nodes to work with arbitrary values, support decrementing, and match new naming scheme.

All nodes now supported:

  • IncExpWithValue: adds or subtracts a constant value to/from a subexpression
  • [Uninit]IncFieldWithValueNode: increment or decrement a field by a constant value
  • [Uninit]IncFieldWithExpNode: increment or decrement a field with a value from a subexpression
  • Inc[Non]LocalVarWithExpNode: increment or decrement a local with a value from a subexpression
  • Inc[Non]LocalVarWithValueNode: increment or decrement a local by a constant value

Since SomSom's parser also has text := text + self currentChar. where text is a field in the lexer, this is supported too.

First implemented as part of: #185

smarr added 2 commits October 5, 2024 14:00
- generalize existing nodes to work with arbitrary values, support decrementing, and match new naming scheme

All nodes now supported:
- IncExpWithValue: adds or subtracts a constant value to/from a subexpression
- [Uninit]IncFieldWithValueNode: increment or decrement a field by a constant value
- [Uninit]IncFieldWithExpNode: increment or decrement a field with a value from a subexpression
- Inc[Non]LocalVarWithExpNode: increment or decrement a local with a value from a subexpression
- Inc[Non]LocalVarWithValueNode: increment or decrement a local by a constant value

- SomSom's parser also has `text := text + self currentChar.` where `text` is a field in the lexer, this is supported too
Signed-off-by: Stefan Marr <git@stefan-marr.de>
@smarr smarr mentioned this pull request Oct 5, 2024
4 tasks
@smarr smarr merged commit 08a4416 into SOM-st:master Oct 5, 2024
2 checks passed
@smarr smarr deleted the supernode/increments branch October 5, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant