문제

I am playing around with the DemoApp that comes bundled with ParseKit and I am having a strange issue. I create this grammar:

 @start = tag; tag = '{' Word ';' Word '}';

and it parses a sentence like:

{foo;bar}

just fine. The issue arises when I change the grammar slightly to be:

@start = tag; tag = '{' Word '\' Word '}';

This causes the app the crash. ParseKit does not seem to like the \ token. Any ideas?

도움이 되었습니까?

해결책

Developer of ParseKit here.

Great example! You've found a bug in ParseKit related to escaped backslashes inside quoted strings. I've fixed the issue. Please update to HEAD of trunk from Google Code.

However, this is also an issue in your example grammar. You will need to escape the backslash in your quoted string. Otherwise it will be escaping the "close quote". So change to this:

@start = tag; tag = '{' Word '\\' Word '}';
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top