Quantcast

Problem dealing with quoted strings containing escape characters

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem dealing with quoted strings containing escape characters

Mark Butler
Hi Mathias,

Thanks again for Parboiled.

I am writing a DSL and I need to process quoted strings that contain regexes, so use escape characters.

I am defining a String as being composed of either escaped quotes or any character that is not a quote.

Then I define a quoted string as a quote, a string and a quote.

However parsing the quoted string fails if it contains escapes and I can't see why?

Any ideas what I am doing wrong?

I have created a minimal test case to demonstrate the problem here

https://gist.github.com/butlermh/5529862

Thanks,

Mark
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem dealing with quoted strings containing escape characters

Mark Butler
It's the semicolon that causes the problem - if I remove it then all the tests pass.

However I can't see why a semicolon would cause this problem.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem dealing with quoted strings containing escape characters

Mark Butler
Sorry, it's ok, I understand my problem, it's because I defined ; as a comments character.

Best wishes. Mark
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem dealing with quoted strings containing escape characters

mathias
Administrator
Mark,

glad you sorted it out.
Grammar debugging can sometimes be a pain…
(Just yesterday I spent almost an hour on a stupid grammar bug, it happens… :)

Cheers,
Mathias

---
[hidden email]
http://www.parboiled.org

On 07.05.2013, at 05:21, Mark Butler [via parboiled users] <[hidden email]> wrote:

>
>
> Sorry, it's ok, I understand my problem, it's because I defined ; as a
> comments character.
>
> Best wishes. Mark
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/Problem-dealing-with-quoted-strings-containing-escape-characters-tp4024187p4024189.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, visit
Loading...