henrib opened a new pull request, #424:
URL: https://github.com/apache/commons-jexl/pull/424

   [JEXL-474](https://issues.apache.org/jira/browse/JEXL-474), stacked on #423 
(JEXL-475).
   
   Antish variables (dotted global names like `x.y.z`) can now be declared at 
parse time:
   
   ```java
   JexlFeatures features = JexlFeatures.createDefault()
       .antishTest(JexlFeatures.namePatterns(Arrays.asList("x.y", "build.*")));
   ```
   
   - the parser rewrites references rooted on a global so the longest declared 
dotted prefix is a single
     variable (`x.y.z` → variable `x.y`, property `.z`); local roots, `?.` and 
back-quoted segments stop the rewrite
   - a script parsed with declared names does not solve antish variables at 
runtime (whatever `JexlOptions.setAntish`)
   - with `sideEffectGlobal(false)` and declared names, only assigning a global 
(`x = 1`, declared `x.y = 1`) is
     rejected; assigning a property of a global value (`x.y.z = 1`) is allowed
   - `JexlFeatures.namePatterns(Collection)`; `pragmaPatterns` delegates to it
   - `Interpreter`: `pushBlock`/`popBlock` and `AntishName` helpers; fixes a 
null local root being solved as an
     antish variable on read (not on assign) and a lexical frame leak when a 
for-loop initializer throws
   
   Declared antish variables: ~10 µs/op vs ~41 µs/op with runtime resolution 
(JMH `InterpreterBenchmark`,
   `mvn clean test -Pbenchmark -Dbenchmark=InterpreterBenchmark`). Without a 
declared predicate, behavior is unchanged.
   
   Tests: `AntishFeaturesTest`, `InterpreterCharacterizationTest`, additions to 
`AntishCallTest`.
   
   - [x] `mvn` default goal passes
   - [x] AI disclosure: written with Claude Code (Claude Opus 5.5), reviewed by 
the committer.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to