You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Stepan Koltsov (JIRA)" <de...@velocity.apache.org> on 2007/02/24 01:45:05 UTC

[jira] Created: (VELOCITY-520) "\u0061" causes lexer exception

"\u0061" causes lexer exception
-------------------------------

                 Key: VELOCITY-520
                 URL: https://issues.apache.org/jira/browse/VELOCITY-520
             Project: Velocity
          Issue Type: Bug
    Affects Versions: 1.5 beta2
            Reporter: Stepan Koltsov
            Priority: Minor


The test:

===
    public void testU() throws Exception {
        VelocityEngine ve = new VelocityEngine();
        ve.init();
        Context context = new VelocityContext();

        StringWriter writer;

        writer = new StringWriter();
        ve.evaluate(context, writer, "test","#set($v = \"\\u0061\")$v");
        //assertEquals("a", writer.toString());
    }
===

I think "\u0061" shoud produce "a", see VELOCITY-519. But if not, this should produce string "\u0061", literally, but not exception, as now.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Resolved: (VELOCITY-520) "\u0061" causes lexer exception

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna resolved VELOCITY-520.
-----------------------------------

    Resolution: Fixed

Ok, the fix and an improved/combined version of your test case are committed.  All tests pass.

> "\u0061" causes lexer exception
> -------------------------------
>
>                 Key: VELOCITY-520
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-520
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>            Reporter: Stepan Koltsov
>            Priority: Minor
>             Fix For: 1.6
>
>
> The test:
> ===
>     public void testU() throws Exception {
>         VelocityEngine ve = new VelocityEngine();
>         ve.init();
>         Context context = new VelocityContext();
>         StringWriter writer;
>         writer = new StringWriter();
>         ve.evaluate(context, writer, "test","#set($v = \"\\u0061\")$v");
>         //assertEquals("a", writer.toString());
>     }
> ===
> I think "\u0061" shoud produce "a", see VELOCITY-519. But if not, this should produce string "\u0061", literally, but not exception, as now.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-520) "\u0061" causes lexer exception

Posted by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Will Glass-Husain updated VELOCITY-520:
---------------------------------------

    Fix Version/s: 1.6

> "\u0061" causes lexer exception
> -------------------------------
>
>                 Key: VELOCITY-520
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-520
>             Project: Velocity
>          Issue Type: Bug
>    Affects Versions: 1.5 beta2
>            Reporter: Stepan Koltsov
>            Priority: Minor
>             Fix For: 1.6
>
>
> The test:
> ===
>     public void testU() throws Exception {
>         VelocityEngine ve = new VelocityEngine();
>         ve.init();
>         Context context = new VelocityContext();
>         StringWriter writer;
>         writer = new StringWriter();
>         ve.evaluate(context, writer, "test","#set($v = \"\\u0061\")$v");
>         //assertEquals("a", writer.toString());
>     }
> ===
> I think "\u0061" shoud produce "a", see VELOCITY-519. But if not, this should produce string "\u0061", literally, but not exception, as now.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-520) "\u0061" causes lexer exception

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12475565 ] 

Nathan Bubna commented on VELOCITY-520:
---------------------------------------

Argh, that's not right.  And since this apparently hasn't been working, it looks like adding unicode is at least backwards compatible.  In that case, i guess i'm fine with this going either way.  Either literally producing "\u0061" or producing "a".  If people want unicode in VTL string definitions, i won't protest.  :)

I'm still opposed to having \n \r \" or other such escaping.  Especially since we can now put line breaks directly in the strings:

#set( $foo = "  this has a line
 break in it" )

And we should hopefully soon be able to do "" or '' escaping for quotes (assuming Geir finds the changes he once made to enable that or else one of us duplicates the effort).

> "\u0061" causes lexer exception
> -------------------------------
>
>                 Key: VELOCITY-520
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-520
>             Project: Velocity
>          Issue Type: Bug
>    Affects Versions: 1.5 beta2
>            Reporter: Stepan Koltsov
>            Priority: Minor
>
> The test:
> ===
>     public void testU() throws Exception {
>         VelocityEngine ve = new VelocityEngine();
>         ve.init();
>         Context context = new VelocityContext();
>         StringWriter writer;
>         writer = new StringWriter();
>         ve.evaluate(context, writer, "test","#set($v = \"\\u0061\")$v");
>         //assertEquals("a", writer.toString());
>     }
> ===
> I think "\u0061" shoud produce "a", see VELOCITY-519. But if not, this should produce string "\u0061", literally, but not exception, as now.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-520) "\u0061" causes lexer exception

Posted by "Henning Schmiedehausen (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Schmiedehausen updated VELOCITY-520:
--------------------------------------------

    Component/s: Engine

> "\u0061" causes lexer exception
> -------------------------------
>
>                 Key: VELOCITY-520
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-520
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5 beta2
>            Reporter: Stepan Koltsov
>            Priority: Minor
>             Fix For: 1.6
>
>
> The test:
> ===
>     public void testU() throws Exception {
>         VelocityEngine ve = new VelocityEngine();
>         ve.init();
>         Context context = new VelocityContext();
>         StringWriter writer;
>         writer = new StringWriter();
>         ve.evaluate(context, writer, "test","#set($v = \"\\u0061\")$v");
>         //assertEquals("a", writer.toString());
>     }
> ===
> I think "\u0061" shoud produce "a", see VELOCITY-519. But if not, this should produce string "\u0061", literally, but not exception, as now.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org