Skip to content

Conversation

@TwitchBronBron
Copy link
Member

@TwitchBronBron TwitchBronBron commented Jun 13, 2025

Sometimes plugins need to find the expression at the top of the current chain. For example, doSomething(alpha.beta.charlie) is represented in code as

CallExpression("doSomething", 
  DottedGetExpression("charlie", 
      DottedGetExpression("beta", 
          VariableExpression("alpha")
      )
  )
)

So we want the outer charlie DottedGetExpression because that's the one that is directly held by any parent statement. But in order to detect this, we need to understand ast boundaries, because .parent isn't enough since there's no notion of expression boundaries.

This PR solves that, by providing a .getExpressionChainRoot() function to find the root, or .isExpressionChainRoot property on the node.

  • finish tests (look at coverage report to see which functions weren't called yet)
  • test this in ropm (the project that actually needs this feature right now).

@TwitchBronBron TwitchBronBron added the create-package create a temporary npm package on every commit label Jun 13, 2025
@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on c9ae549. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.69.10-get-root-expression.20250613225719.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 1a29e3a. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.69.10-get-root-expression.20250613225725.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on b5a5edb. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.69.12-get-root-expression.20250725180450.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on ccab965. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.69.13-get-root-expression.20250808160510.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 2b5138e. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.70.0-get-root-expression.20250812191928.tgz

@TwitchBronBron TwitchBronBron marked this pull request as ready for review August 13, 2025 11:42
@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on cea083c. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.0.0-packages/brighterscript-0.70.0-get-root-expression.20250813125649.tgz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create-package create a temporary npm package on every commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants