More PyPy grammar rules

* assert one and two-arg form
* trystmt

Simplify adding multiple grammar rules
This commit is contained in:
rocky
2016-07-26 10:21:12 -04:00
parent 9f0b0809b1
commit 6c5bd6289f
10 changed files with 98 additions and 40 deletions

View File

@@ -0,0 +1,17 @@
# From PyPy argparse, dedent.
# PyPY adds opcode JUMP_IF_NOT_DEBUG.
# This is the two argument form.
assert __name__ != '__main"', 'Indent decreased below 0.'
# From PyPy simple_interact.py
# PyPy uses POP_JUMP_IF_FALSE as well as POP_JUMP_IF_TRUE
# CPython only uses POP_JUMP_IF_TRUE
while 1:
try:
more = 10
except EOFError:
break
more = len(__file__)
assert not more, "FOO"
assert not more