php-peg
php-peg copied to clipboard
Escape single quotes
Hello!
Single quotes in a literal would cause the PEG to crash with:
PHP Parse error: syntax error, unexpected '';' (T_ENCAPSED_AND_WHITESPACE), expecting ';'
This happens because the literal gets eval()ed to check if it's a single character.
This patch escapes the quotes, and the parser gets generated correctly.