Quantcast

java.lang.IllegalArgumentException: Can only replace chars that were previously inserted

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

java.lang.IllegalArgumentException: Can only replace chars that were previously inserted

Thibaut Colar
Some times I get this error while parsing some (probably failing) document.
However I don't really understand the error, I don't believe I'm doing any replacements myself, it seem the recoveringParseRunner is doing this ? Is this a bug or am I missing something ?

java.lang.IllegalArgumentException: Can only replace chars that were previously inserted
        at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:353)
        at org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41)
        at org.parboiled.parserunners.RecoveringParseRunner$Handler.match(RecoveringParseRunner.java:315)
        at org.parboiled.parserunners.ErrorLocatingParseRunner.match(ErrorLocatingParseRunner.java:76)
        at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:338)
        at org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)
        at org.parboiled.parserunners.RecoveringParseRunner$Handler.match(RecoveringParseRunner.java:315)
        at org.parboiled.parserunners.ErrorLocatingParseRunner.match(ErrorLocatingParseRunner.java:76)
        at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:338)
        at org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46)
        at org.parboiled.parserunners.RecoveringParseRunner$Handler.match(RecoveringParseRunner.java:315)

...... (and so on and so on)

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

Re: java.lang.IllegalArgumentException: Can only replace chars that were previously inserted

Thibaut Colar
Seems ok now, must have been something goofy about my grammar
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java.lang.IllegalArgumentException: Can only replace chars that were previously inserted

mathias
Administrator
Thibault,

hmmm... strange.
Normally you shouldn't be seeing the error you were seeing, unless you mess around with actively trying to insert/delete characters from your actions.

If you have a test case provoking the error I could take a look at it.

Cheers,
Mathias

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

On 22.06.2012, at 19:44, Thibaut Colar [via parboiled users] wrote:

> Seems ok now, must have been something goofy about my grammar
>
> If you reply to this email, your message will be added to the discussion below:
> http://users.parboiled.org/java-lang-IllegalArgumentException-Can-only-replace-chars-that-were-previously-inserted-tp4024027p4024028.html
> To start a new topic under parboiled users, email [hidden email]
> To unsubscribe from parboiled users, click here.
> NAML

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

Re: java.lang.IllegalArgumentException: Can only replace chars that were previously inserted

Thibaut Colar
OK, it's not happening anymore, but if i come across it again i'll make a test case for it.
Loading...