[ 
https://issues.apache.org/jira/browse/JEXL-437?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Henri Biestro updated JEXL-437:
-------------------------------
    Assignee: Henri Biestro

> Semicolons not actually optional between function calls on separate lines
> -------------------------------------------------------------------------
>
>                 Key: JEXL-437
>                 URL: https://issues.apache.org/jira/browse/JEXL-437
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.3, 3.4.0
>         Environment: JEXL 3.4.0  (also tested on 3.3)
> OpenJDK 23.0.2 (Red Hat, Inc. 23.0.2+7)
> Linux 5.15.167.4-microsoft-standard-WSL2 amd64
>            Reporter: William Price
>            Assignee: Henri Biestro
>            Priority: Major
>
> The syntax documentation states that "Statements are optionally terminated 
> with a semicolon" but I'm finding that semicolons are *required* when 
> invoking a script-defined function multiple times, with each invocation on a 
> separate line.
>  
> {code:java}
> let values = [...]
> function append(const value) {
>   values.add(value)
> }
> append(1)
> append(2)
> return values {code}
>  
> h3. Expected result:
> {code:java}
> [1, 2, ...] // list size 2 containing integers 1 and 2{code}
> h3. Actual Result:
> {code:java}
> org.apache.commons.jexl3.JexlException$Ambiguous: @7:1 ambiguous statement 
> error in 'append(2)'
>     at 
> app//org.apache.commons.jexl3.JexlEngine.createScript(JexlEngine.java:411)  
> {code}
> h3. Workaround:
> Terminating line 6 with a semicolon ({{{}append(1);{}}}) gets around the 
> error.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to