Using PyParsing to parse language with signficant newlines (like Python)
问题 I am implementing a language where the newlines are significant, sometime, as in Python, with exactly the same rules. For the purpose of my question we can take the Python fragment that has to do with assignments, parentheses, and the treatment of newlines and semicolons. For example, one could write: a = 1 + 2 + 3 # ok b = c but not a = 1 + 2 + 3 b = c # incorrect because one needs a newline to divide the two statements. However we can have a = 1 + 2 + 3; b = c # ok using the semicolon. Also