commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JEXL-71) Parsing errors?
Date Wed, 05 Aug 2009 22:31:14 GMT

    [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739791#action_12739791
] 

Sebb commented on JEXL-71:
--------------------------

I can understand why one might need to add Expression() to empty and void, but I don't understand
why Reference() is dropped?

I've just tried applying the patch from JEXL-75, and there are lots of failures.

However, if I revert the parts of the patch that affect PrimaryExpression, EmptyFunction and
SizeFunction I get far fewer errors, only:

  testMapArrayLiteral(org.apache.commons.jexl.MapLiteralTest)
  testLiteralWithStrings(org.apache.commons.jexl.ArrayLiteralTest)
  testLiteralWithOneEntry(org.apache.commons.jexl.ArrayLiteralTest)
  testLiteralWithNumbers(org.apache.commons.jexl.ArrayLiteralTest)
  testSizeOfSimpleArrayLiteral(org.apache.commons.jexl.ArrayLiteralTest)
  testNotEmptySimpleArrayLiteral(org.apache.commons.jexl.ArrayLiteralTest)

Maybe it would be worth applying the changes in stages:
1) Change Map syntax - should be straightforward
2) Add Array constructor
3) fix up loose ends

Just a thought.


> Parsing errors?
> ---------------
>
>                 Key: JEXL-71
>                 URL: https://issues.apache.org/jira/browse/JEXL-71
>             Project: Commons JEXL
>          Issue Type: Bug
>            Reporter: Sebb
>             Fix For: 2.0
>
>         Attachments: JEXL-71.patch
>
>
> While testing with a basic command-line utility, I got the following odd behaviours:
> Note: input is denoted by >.
> ============
> > c.e
> 04-Aug-2009 23:25:46 org.apache.commons.jexl.Interpreter visit
> WARNING: org.apache.commons.jexl.scripting.Main.main@51![0,3]: 'c.e;' undefined variable
e.e
> Return value: null
> > c
> Return value: {2=3, 4=5}
> > e
> Return value: 2
> The error message looks wrong - why is e.e mentioned? Surely it should be c.e?
> ===========
> > a=[1,2]
> Encountered " "," ", "" at line 1, column 5.
> Was expecting one of:
> ... etc.
> Same for
> > A=['b','c']
> However, I would expect this to work, as this is the syntax for an array as shown on
the website.
> How does one create an array?
> =====
> > D=['a'=>'b']
> Return value: {a=b}
> > D['a']
> Return value: b
> This as expected. However, numbers behave rather oddly:
> > E=[1=>2]
> Return value: {1=2}
> > E[1]
> Return value: null
> > E['1']
> Return value: null
> There does not appear to be a way to access the value.
> Whereas, when using a string:
> F=['1'=>2]
> Return value: {1=2}
> F['1']
> Return value: 2
> F[1]
> Return value: 2
> In this case, both the string and the bare number are usable as the key.
> ====
> I can create test cases for these, but I'd like to confirm that these are bugs first

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message