Narwhal v.0.2 is released. I updated to the version.
Other found bugs are the following:
- The ' " ' rule cannot be compiled as C language
- Compiling a parser generated from the grammar that contains rules with double-quote (") fails because generated string literals are not enclosed by " well. For example, the rule ' " ' is generated as L" " ". Furthermore, ' \" ' and " \" " are generated as L" \\" ". I could not escape the double quote.
- Escaped character cannot match input.
- For example, the '\n' rule, which consists of a single character, cannot match an input single character '\n' in the S macro, because the print_escape function generated the rule as the two characters "\n".
If it is necessary to escape the rule for C language, input characters should be necessary to be escaped or the rule should be restored before matching.
When I tried to escape such characters in input_buffer_read_char, it seems the characters became matched (but, it is not enough tested ).
because my multi-line testing grammar did not work well, I debugged it. But, perhaps because Narwhal's example calculator is single-line, the bugs might be hard to find before. I found the Narwhal's source code is clear and simple C, which is easy to fix. Although I did not provide my fixed code because it contains my customization (it is maybe unnecessary for others), information I think helpful for others was reported to the Narwhal project .
Other local customization
- trace dump is added. It is available if the prefix_debug is not zero.
- Generated time stamp is removed because it is detected as difference.
- other tribal modifications