[antlr-interest] gUnit special character escaping

Leon Su leon.antlr at mac.com
Wed Feb 6 11:37:38 PST 2008


Hi,

gUnit accepts escaped character in its testsuite expressions, but  
there's a bug currently.
You may try multiple-line expression as Andreas suggested.
A minor update of gUnit will be release in these days.
(the bug is also fixed.)

Regards,

Leon

On Feb 6, 2008, at 10:15 AM, Andreas Bartho wrote:

> Hi Ana,
>
> have you tried
>
> << "ABC DE"
> >>
>
> as described in the wiki?
>
> Andreas
>
> Ana Nelson wrote:
>> I'm trying to write gUnit tests for expressions like
>> "ABC DE"\n
>> The quotes are part of the expression, so I've been trying to  
>> escape the quotes and newline as follows to include them in  
>> my .testsuite file:
>> "\"ABC DE\"\n"
>> But, gUnit doesn't seem to like escaped quotes, or I'm not  
>> escaping them properly. I've tried various alternatives but  
>> haven't found anything that works. I have a clumsy workaround  
>> which is to put the quoted expression "ABC DE" into an external  
>> text file.
>> If anyone knows the correct way of escaping quotes (and newlines)  
>> in gUnit, or if someone can tell me that it's not possible, I  
>> would appreciate it. I've looked in the gunit.jar source and see  
>> references to escaped quotes in the parser grammar but can't  
>> manage to work that back into how to write them.
>> Many thanks! :-)
>> Ana
>



More information about the antlr-interest mailing list