Parser Combinators Made Simple
sigusr2.net
sigusr2.net
>>> 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.