[antlr-interest] gUnit special character escaping

Ana Nelson nelson.ana at gmail.com
Thu Feb 7 00:05:11 PST 2008


Hi Leon & Andreas,

Thanks for the suggestions.

I did try the << >> notation but it didn't seem to work for me. I'll try it
again, I could have just used it incorrectly. I put my string on the 2nd
line so maybe it was complaining about the blank line.

Look forward to the gUnit update.

Thanks! :-)


On 06/02/2008, Leon Su <leon.antlr at mac.com> wrote:
>
> 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
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080207/b04b750f/attachment.html 


More information about the antlr-interest mailing list