feat(agama): add transpiler variable naming and access conformance tests#14425
feat(agama): add transpiler variable naming and access conformance tests#14425imran-ishaq wants to merge 1 commit into
Conversation
Signed-off-by: imran <imranishaq7071@gmail.com>
|
Warning Review limit reached
Next review available in: 4 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|



Prepare
Description
Adds
VariableAccessTestto the Agama transpiler module, pinning the transpiler to the language reference's variablenaming and data-access rules: valid names and access forms (dot, numeric index,
.length, quoted and$-prefixed propertyaccess) transpile, while an invalid name (leading underscore) and expression-based indexing (
x[person.age],x[y[0]]) arerejected. Registered in the module's TestNG suite. No production change — confirms current behavior conforms to the
spec.
Target issue
The Agama language reference defines the variable-name pattern a-zA-Z* and the rules for accessing
data (dot notation, zero-based indexing, .length, quoted/$-prefixed property access), and explicitly disallows
expression-based indexing (x[person.age], x[y[0]]). There is no test pinning the transpiler to these rules.
closes #14424
Implementation Details
agama/transpiler/src/test/java/io/jans/agama/test/VariableAccessTest.java(positive valid names/access viaTranspiler.transpile; negative invalid name +expression indexing viaTranspiler.runSyntaxCheck).agama/transpiler/src/test/resources/testng.xml.Test and Document the changes
Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with
docs:to indicate documentation changes or if the below checklist is not selected.