You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2009/08/05 00:44:14 UTC

[jira] Created: (JEXL-71) Parsing errors?

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


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.


[jira] Commented: (JEXL-71) Parsing errors?

Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739551#action_12739551 ] 

Henri Biestro commented on JEXL-71:
-----------------------------------

Attached patches to JEXL-73 & JEXL-74.
Note (again) that the JEXL-71 patch includes this fixes plus JEXL-75 at the cost of a syntax change.
Awaiting instructions. :-)

> 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.


[jira] Commented: (JEXL-71) Parsing errors?

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739270#action_12739270 ] 

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

Regarding Arrays, the Syntax document says:

>>>>
Array literal 	 

You can construct an Object[] array by using

[ item, item, item ]
<<<<

So if the fix creates a List, then the docn needs to be changed as well.

Of course it would be nice to be able to create either - there are likely to be use cases for both fixed and variable numbers of entries.
Maybe () could be used to create a List, and [] and array?

Re subtasks: good idea.

> 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
>
>
> 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.


[jira] Commented: (JEXL-71) Parsing errors?

Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739253#action_12739253 ] 

Henri Biestro commented on JEXL-71:
-----------------------------------

These definitely look like bugs to me.

The first one I suspect is a benign bug in the Interpreter.
The third one on Maps seems to point the parser.jjt as the culprit (and I really dislike this map syntax btw, a jscript-llike one would seem more "natural").
The second one about Arrays is an RFE (sic) since there is nothing in the grammar & parser that indicates it can create Arrays so it's going to take a bit more effort (should these be List or real arrays ie [...]) 

Should I create subtasks or different bugs for each ?

> 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
>
>
> 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.


[jira] Updated: (JEXL-71) Parsing errors?

Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro updated JEXL-71:
------------------------------

    Attachment:     (was: JEXL-71.patch)

> 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.


[jira] Commented: (JEXL-71) Parsing errors?

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739711#action_12739711 ] 

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

I'm happy with the proposed new syntax for maps:

 { key1 : value1, key2 : value2 }

It's slightly easier to type : rather than => too.

===

I've had a look at the patch, and it mostly seems quite straightforward.

However, there are some changes to Parser.jjt which I don't follow:

1) Why are changes needed to EmptyFunction() and VoidFunction()?
2) Likewise PrimaryExpression()

Are these essential for adding Array handling?

> 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.


[jira] Updated: (JEXL-71) Parsing errors?

Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro updated JEXL-71:
------------------------------

    Attachment: JEXL-71.patch

A fix for the 3 subtasks that involves a syntax change for Maps literal and adds the Array literal + tests.
Will post separate patches for the "variables" subtask & Map/Integer soon.

> 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.


[jira] Commented: (JEXL-71) Parsing errors?

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (JEXL-71) Parsing errors?

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739997#action_12739997 ] 

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

I'm fairly sure I applied patch-75 rather than patch-71, because I remember seeing that syntax.xml was updated, and that is only in patch-75.

However, I started again and this time it all worked out OK. I don't know what went wrong before.

> 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.


[jira] Commented: (JEXL-71) Parsing errors?

Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739936#action_12739936 ] 

Henri Biestro commented on JEXL-71:
-----------------------------------

I've just retested the patch both on Mac & Windows+cygwin using both Java1.5 & Java6 and have none of the issues you describe.

svn co  http://svn.apache.org/repos/asf/commons/proper/jexl/branches/2.0
Downloaded JEXL-75.patch in .../jexl ;
Applied the patch with 'cd .../jexl/branches/2.0; patch -p0 < ../../JEXL-75.patch'.
The patch applies cleanly with no rejects, not even fuzz.
'mvn site' : No errors.
Tried also through Netbeans+maven plugin without an hitch.

Might be something wrong on your end...
Are you sure your repository was clean ?
Are you sure you applied the JEXL-75.patch ?
Are you using maven to build it using the pom.xml or some other tool ?(Eclipse?)


> 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.


[jira] Resolved: (JEXL-71) Parsing errors?

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved JEXL-71.
----------------------

    Resolution: Fixed

I think this is all resolved now, apart from the suggestion of supporting growable arrays (Lists).

I'll raise a separate enhancement request for that.

> 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.


[jira] Updated: (JEXL-71) Parsing errors?

Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Biestro updated JEXL-71:
------------------------------

    Attachment: JEXL-71.patch

Added dotted syntax for assignment test & fix ( x.1 = y )

> 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.


[jira] Commented: (JEXL-71) Parsing errors?

Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739731#action_12739731 ] 

Henri Biestro commented on JEXL-71:
-----------------------------------


1/ EmptyFunction & SizeFunction (I guess) used to work with Reference which ArrayLiteral & MapLiteral aren't; the change is necessary to use either of these literals as arguments.

2/ PrimaryExpression is the final form of UnaryExpression of which ArrayLiteral & MapLiteral are part of; the LOOKAHEADs, besides helping the parser, will help in maintenance.

Last version of the patch in JEXL-75 based in the trunk; thanks for the previous commits.

> 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.


[jira] Issue Comment Edited: (JEXL-71) Parsing errors?

Posted by "Rahul Akolkar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739689#action_12739689 ] 

Rahul Akolkar edited comment on JEXL-71 at 8/5/09 12:27 PM:
------------------------------------------------------------

Agreed that [ ]  is crowded syntax-wise and I didn't like the existing map literal syntax either. I think the JSON/ECMA-like syntax may be better. Note the map syntax hasn't been released so can be changed freely at this point. I'm in favor of the change conceptually (haven't looked at the actual patch, and unlikely I'll get a chance over the next few days either).


      was (Author: rahul@apache.org):
    Agreed that [ ]  is crowded syntax-wise and I didn't like the existing map literal syntax either. I think the JSON/ECMA-like syntax. Note the map syntax hasn't been released so can be changed freely at this point. I'm in favor of the change conceptually (haven't looked at the actual patch, and unlikely I'll get a chance over the next few days either).

  
> 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.


[jira] Commented: (JEXL-71) Parsing errors?

Posted by "Rahul Akolkar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JEXL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739689#action_12739689 ] 

Rahul Akolkar commented on JEXL-71:
-----------------------------------

Agreed that [ ]  is crowded syntax-wise and I didn't like the existing map literal syntax either. I think the JSON/ECMA-like syntax. Note the map syntax hasn't been released so can be changed freely at this point. I'm in favor of the change conceptually (haven't looked at the actual patch, and unlikely I'll get a chance over the next few days either).


> 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.