php-peg
php-peg copied to clipboard
PEG (parsing expression grammar) compiler for PHP
There should be some hooks to give user the chance to throw an Exception if the process of parsing is premuterely completed, es. Syntax Error. At the moment the process...
I just submitted php-peg to packagagist (and added hafriedlander as a maintainer): https://packagist.org/packages/hafriedlander/php-peg From the Packagist website: > Enabling the Packagist service hook ensures that your package will always be...
Packrat sometimes doesn't work!!! For example this grammar: `comment_content: ( / [^\*\{] / | "*" !"}" | "{" !"*" ) comment_content | comment comment_content | "" comment: "{*" comment_content "*}"...
This doesn't match: `static: (static_content:( / [^\{] / | "{" !("{" | "*") )+ | comment)+ function static_content (&$res, $sub) { $res['content'][0] = "'"; $res['content'][1] .= $sub['text']; }` but this...
There are some problems with rules that include variables. Example: `user_structure: tag_begin pws tag_name:simple_name save_tag_name:"" (rws attribute:user_attribute (rws attribute:user_attribute)*)? (rws tag_stub | (pws tag_end content:template_content? tag_begin pws end_tag_mark pws "$tag_name"...
Group names inside rules sometimes don't work as expected because they do not share params with other parts of the rule. Example: `unknown_attribute: name:simple_name pws ":" pws value:(expression | identifier)...
The only way to add a comment to the rule I have found is like this: `pws: / [\t\r\n\x20]* / # "pws" means "Possible White Space"` (before # must be...
Compilation of several `/*!* ... */` blocks in one file doesn't work (but readme says that it may be done). BTW there is no any loop in Compiler::compile().