PLY - return multiple tokens
问题 AFAIK the technique for lexing Python source code is: When current line's indentation level is less than previous line's, produce DEDENT. Produce multiple DEDENTs if it is closing multiple INDENTs. When end of input is reached, produce DEDENT(s) if there's unclosed INDENT(s). Now, using PLY: How do I return multiple tokens from a t_definition? How do I make a t_definition that's called when EOF is reached? Simple \Z doesn't work -- PLY complains that it matches empty string. 回答1: As far as I