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 2008/05/13 14:40:55 UTC
[jira] Created: (JEXL-44) Comments don't allow double-quotes
Comments don't allow double-quotes
----------------------------------
Key: JEXL-44
URL: https://issues.apache.org/jira/browse/JEXL-44
Project: Commons JEXL
Issue Type: Bug
Affects Versions: 1.1
Reporter: Sebb
Comment lines should allow any characters; however for some reason double-quotes are not allowed.
Single quotes are OK.
--
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-44) Comments don't allow
double-quotes
Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750814#action_12750814 ]
Henri Biestro edited comment on JEXL-44 at 9/3/09 1:50 AM:
-----------------------------------------------------------
As for why the behavior is not (yet) the same, the ## was left as is because it looked like a Velocity legacy; the // was added to fix the original issue with no disruption.
If we are to change the behavior, may be having only one syntax for single-line comment (the //) would be clearer ?
Btw,
URL: http://svn.apache.org/viewvc?rev=810815&view=rev
Log:
Allow single line comment // to end on EOF; add test
Modified:
commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/parser/Parser.jjt
commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java
was (Author: henrib):
As for why the behavior is not (yet) the same, the ## was left as is because it looked like a Velocity legacy; the // was added to fix the original issue with no disruption.
If we are to change the behavior, may be having only one syntax for single-line comment (the //) would be clearer ?
> Comments don't allow double-quotes
> ----------------------------------
>
> Key: JEXL-44
> URL: https://issues.apache.org/jira/browse/JEXL-44
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Sebb
> Fix For: 2.0
>
>
> Comment lines should allow any characters; however for some reason double-quotes are not allowed.
> Single quotes are OK.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (JEXL-44) Comments don't allow double-quotes
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-44?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb reopened JEXL-44:
----------------------
## comments still don't allow ", for example:
public void test44() throws Exception {
JEXL.createExpression("## 'comment'\n"); // OK
JEXL.createExpression("## \"comment\"\n"); // fails Lexical error at line 1, column 4. Encountered: "\"" (34), after : "## "
}
I would expect ## and // to behave identically; however the parser specifically does not allow double-quote after ##.
It's not clear why, as the syntax document does not mention anything special about double-quotes.
I think this is probably a bug.
==
Note that the trailing "\n" is necessary, otherwise the test fails with:
Lexical error at line 1, column 13. Encountered: <EOF> after : "## \'comment\'"
Seems to me that <EOF> should be allowed to terminate a single-line comment.
> Comments don't allow double-quotes
> ----------------------------------
>
> Key: JEXL-44
> URL: https://issues.apache.org/jira/browse/JEXL-44
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Sebb
> Fix For: 2.0
>
>
> Comment lines should allow any characters; however for some reason double-quotes are not allowed.
> Single quotes are OK.
--
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-44) Comments don't allow
double-quotes
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750757#action_12750757 ]
Sebb edited comment on JEXL-44 at 9/2/09 6:00 PM:
--------------------------------------------------
Single-line ## comments still don't allow ", for example:
{code}
public void test44() throws Exception {
JEXL.createExpression("## 'comment'\n"); // OK
JEXL.createExpression("## \"comment\"\n"); // fails Lexical error at line 1, column 4. Encountered: "\"" (34), after : "## "
}
{code}
I would expect ## and // to behave identically; however the parser specifically does not allow double-quote after ##.
It's not clear why, as the syntax document does not mention anything special about double-quotes.
I think this is probably a bug.
==
Note that the trailing "\n" is necessary, otherwise the test fails with:
Lexical error at line 1, column 13. Encountered: <EOF> after : "## \'comment\'"
Seems to me that <EOF> should be allowed to terminate a single-line comment.
was (Author: sebb@apache.org):
Single-line ## comments still don't allow ", for example:
public void test44() throws Exception {
JEXL.createExpression("## 'comment'\n"); // OK
JEXL.createExpression("## \"comment\"\n"); // fails Lexical error at line 1, column 4. Encountered: "\"" (34), after : "## "
}
I would expect ## and // to behave identically; however the parser specifically does not allow double-quote after ##.
It's not clear why, as the syntax document does not mention anything special about double-quotes.
I think this is probably a bug.
==
Note that the trailing "\n" is necessary, otherwise the test fails with:
Lexical error at line 1, column 13. Encountered: <EOF> after : "## \'comment\'"
Seems to me that <EOF> should be allowed to terminate a single-line comment.
> Comments don't allow double-quotes
> ----------------------------------
>
> Key: JEXL-44
> URL: https://issues.apache.org/jira/browse/JEXL-44
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Sebb
> Fix For: 2.0
>
>
> Comment lines should allow any characters; however for some reason double-quotes are not allowed.
> Single quotes are OK.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JEXL-44) Comments don't allow double-quotes
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750969#action_12750969 ]
Sebb commented on JEXL-44:
--------------------------
I've just had a look at the Velocity doc - http://velocity.apache.org/engine/devel/user-guide.html#Comments - and "##" is a single-line comment.
However, AFAICT, it does not treat double-quote specially, so why does JEXL do so?
Indeed there seems to be no way to make a valid script once a double-quote is detected inside a ## comment.
-1 to dropping "##" as a comment marker, that migh break lots of scripts.
> Comments don't allow double-quotes
> ----------------------------------
>
> Key: JEXL-44
> URL: https://issues.apache.org/jira/browse/JEXL-44
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Sebb
> Fix For: 2.0
>
>
> Comment lines should allow any characters; however for some reason double-quotes are not allowed.
> Single quotes are OK.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JEXL-44) Comments don't allow double-quotes
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750772#action_12750772 ]
Sebb commented on JEXL-44:
--------------------------
Also just noticed that "##" does not check for the "\r\n" combination, whereas "//" does.
> Comments don't allow double-quotes
> ----------------------------------
>
> Key: JEXL-44
> URL: https://issues.apache.org/jira/browse/JEXL-44
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Sebb
> Fix For: 2.0
>
>
> Comment lines should allow any characters; however for some reason double-quotes are not allowed.
> Single quotes are OK.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (JEXL-44) Comments don't allow double-quotes
Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-44?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Biestro closed JEXL-44.
-----------------------------
Resolution: Fixed
URL: http://svn.apache.org/viewvc?rev=810994&view=rev
Log:
Allow single line comment ## to behave like //; add test
Modified:
commons/proper/jexl/branches/2.0/src/main/java/org/apache/commons/jexl/parser/Parser.jjt
commons/proper/jexl/branches/2.0/src/test/java/org/apache/commons/jexl/IssuesTest.java
> Comments don't allow double-quotes
> ----------------------------------
>
> Key: JEXL-44
> URL: https://issues.apache.org/jira/browse/JEXL-44
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Sebb
> Assignee: Henri Biestro
> Fix For: 2.0
>
>
> Comment lines should allow any characters; however for some reason double-quotes are not allowed.
> Single quotes are OK.
--
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-44) Comments don't allow
double-quotes
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750757#action_12750757 ]
Sebb edited comment on JEXL-44 at 9/2/09 5:59 PM:
--------------------------------------------------
Single-line ## comments still don't allow ", for example:
public void test44() throws Exception {
JEXL.createExpression("## 'comment'\n"); // OK
JEXL.createExpression("## \"comment\"\n"); // fails Lexical error at line 1, column 4. Encountered: "\"" (34), after : "## "
}
I would expect ## and // to behave identically; however the parser specifically does not allow double-quote after ##.
It's not clear why, as the syntax document does not mention anything special about double-quotes.
I think this is probably a bug.
==
Note that the trailing "\n" is necessary, otherwise the test fails with:
Lexical error at line 1, column 13. Encountered: <EOF> after : "## \'comment\'"
Seems to me that <EOF> should be allowed to terminate a single-line comment.
was (Author: sebb@apache.org):
## comments still don't allow ", for example:
public void test44() throws Exception {
JEXL.createExpression("## 'comment'\n"); // OK
JEXL.createExpression("## \"comment\"\n"); // fails Lexical error at line 1, column 4. Encountered: "\"" (34), after : "## "
}
I would expect ## and // to behave identically; however the parser specifically does not allow double-quote after ##.
It's not clear why, as the syntax document does not mention anything special about double-quotes.
I think this is probably a bug.
==
Note that the trailing "\n" is necessary, otherwise the test fails with:
Lexical error at line 1, column 13. Encountered: <EOF> after : "## \'comment\'"
Seems to me that <EOF> should be allowed to terminate a single-line comment.
> Comments don't allow double-quotes
> ----------------------------------
>
> Key: JEXL-44
> URL: https://issues.apache.org/jira/browse/JEXL-44
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Sebb
> Fix For: 2.0
>
>
> Comment lines should allow any characters; however for some reason double-quotes are not allowed.
> Single quotes are OK.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JEXL-44) Comments don't allow double-quotes
Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12732567#action_12732567 ]
Henri Biestro commented on JEXL-44:
-----------------------------------
Fixed in 2.0 by adding C style comments in syntax .
> Comments don't allow double-quotes
> ----------------------------------
>
> Key: JEXL-44
> URL: https://issues.apache.org/jira/browse/JEXL-44
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Sebb
>
> Comment lines should allow any characters; however for some reason double-quotes are not allowed.
> Single quotes are OK.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JEXL-44) Comments don't allow double-quotes
Posted by "Henri Biestro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750814#action_12750814 ]
Henri Biestro commented on JEXL-44:
-----------------------------------
As for why the behavior is not (yet) the same, the ## was left as is because it looked like a Velocity legacy; the // was added to fix the original issue with no disruption.
If we are to change the behavior, may be having only one syntax for single-line comment (the //) would be clearer ?
> Comments don't allow double-quotes
> ----------------------------------
>
> Key: JEXL-44
> URL: https://issues.apache.org/jira/browse/JEXL-44
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Sebb
> Fix For: 2.0
>
>
> Comment lines should allow any characters; however for some reason double-quotes are not allowed.
> Single quotes are OK.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (JEXL-44) Comments don't allow double-quotes
Posted by "Rahul Akolkar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JEXL-44?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rahul Akolkar resolved JEXL-44.
-------------------------------
Resolution: Fixed
Fix Version/s: 2.0
This should be fixed in the 2.0 branch in SVN. Please try it out (by building the branch) and if further work is needed, reopen this issue with a complete JUnit test that fails.
> Comments don't allow double-quotes
> ----------------------------------
>
> Key: JEXL-44
> URL: https://issues.apache.org/jira/browse/JEXL-44
> Project: Commons JEXL
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Sebb
> Fix For: 2.0
>
>
> Comment lines should allow any characters; however for some reason double-quotes are not allowed.
> Single quotes are OK.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.