Skip to content

Expand Aliases#184

Open
rcosta358 wants to merge 1 commit intomainfrom
expand-aliases
Open

Expand Aliases#184
rcosta358 wants to merge 1 commit intomainfrom
expand-aliases

Conversation

@rcosta358
Copy link
Collaborator

@rcosta358 rcosta358 commented Mar 19, 2026

Closes #160. Adds a new AliasExpansion pass that adds the alias body as an origin of an alias invocation, substituting its parameters with the provided arguments. Works by extracting the aliases from the context and passing them to the simplification logic. We reuse the ValDerivationNode to represent alias expansions, which is enough for this purpose and avoids requiring changes to the VS Code extension.

Example

When we invoke the alias Byte(int b) { b >= -128 && b <= 127 }") with Byte(#v_8), we get:

{
  "value": "Byte(#v_8)",
  "origin": {
    "value": "#v_8 >= -128 && #v_8 <= 127"
  }
}

@rcosta358 rcosta358 self-assigned this Mar 19, 2026
@rcosta358 rcosta358 added enhancement New feature or request simplification Related to the simplification of expressions labels Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request simplification Related to the simplification of expressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alias Expansion

1 participant