3 ms·
Parser Combinators Made Simple
- CodeMage 16y agoA nice and friendly way to explain a concept that has a scary-sounding name. One little correction, though: your example for "alt" function says >>> iforwhileorfor = alt(matchstr('if'), matchstr('while'), matchstr('for')) >>> if_while_for('if') ('if', '') >>> if_while_for('while') ('while', '') >>> if_while_for('for') ('for', '') >>> if_while_for('foof') None You need to either rename the variable to "if_while_for" or modify your function calls accordingly.
- apgwoz 16y agoOops! Thanks for noticing this. I'll make a fix.