Skip to content

Support for nested array expressions (#616)#617

Merged
phobos2077 merged 2 commits intomasterfrom
feature/nested-array-expressions
Mar 15, 2026
Merged

Support for nested array expressions (#616)#617
phobos2077 merged 2 commits intomasterfrom
feature/nested-array-expressions

Conversation

@phobos2077
Copy link
Collaborator

@phobos2077 phobos2077 commented Feb 26, 2026

  • Doesn't require any new opcode
  • temp_array is repurposed as sub-expression terminator
  • Accompanied by sslc update
  • Backwards compatible with old scripts using single-layer expressions

Probably needs some more testing.
Unsure if it is better to actually add a new opcode or use flags-based hack like this.

@phobos2077 phobos2077 changed the title Support for nested expressions (#616) Support for nested array expressions (#616) Feb 26, 2026
- Doesn't require any new opcode
- temp_array is repurposed as sub-expression terminator
- Accompanied by sslc update
- Backwards compatible with old scripts using single-layer expressions
@phobos2077 phobos2077 force-pushed the feature/nested-array-expressions branch from b732f7f to 168687c Compare March 15, 2026 11:47
…s, add arrays testcase script, fix load_array not accepting float as array key
@phobos2077 phobos2077 marked this pull request as ready for review March 15, 2026 12:41
@phobos2077
Copy link
Collaborator Author

After some reflection I think this solution should be fine. It is somehow fitting to use temp_array to close the expression when it is used to open it. The code looks a bit complicated, but this is for the benefit of backward compatibility.

  • New scripts in old sfall would just produce the same broken one-level array like they did before.
  • Old scripts (no nested expressions) in new sfall would work fine because the new opcode pattern only kicks in for sub-expressions, not on the root level.

@phobos2077 phobos2077 merged commit 90e18fa into master Mar 15, 2026
1 check passed
@phobos2077 phobos2077 deleted the feature/nested-array-expressions branch March 15, 2026 12:47
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.

1 participant