itod / pegkit

'Parsing Expression Grammar' toolkit for Cocoa/Objective-C
MIT License
392 stars 37 forks source link

Assertion failure in - (PKTokenizerState *)nextTokenizerStateFor:(PKUniChar)c tokenizer:(PKTokenizer *)t #61

Open lhasiuk opened 4 years ago

lhasiuk commented 4 years ago

The first line in this method is: NSParameterAssert(c < STATE_COUNT);

Since 'c' is an int32_t value holding a Unicode character and STATE_COUNT is 256, this line is easily triggered when parsing strings that contain characters that have higher Unicode values. I think that this line is an error, and commenting it out solves the issue for me. Can you explain why this line is important and how I can avoid triggering it? If it represents a bug, is there any possibility for a new release that fixes the problem?