Index: Grammar/Grammar =================================================================== RCS file: /cvsroot/python/python/dist/src/Grammar/Grammar,v retrieving revision 1.54 diff -c -r1.54 Grammar *** Grammar/Grammar 2 Aug 2005 00:46:38 -0000 1.54 --- Grammar/Grammar 2 Aug 2005 13:40:21 -0000 *************** *** 62,69 **** global_stmt: 'global' NAME (',' NAME)* exec_stmt: 'exec' expr ['in' test [',' test]] assert_stmt: 'assert' test [',' test] ! compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] while_stmt: 'while' test ':' suite ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] --- 62,70 ---- global_stmt: 'global' NAME (',' NAME)* exec_stmt: 'exec' expr ['in' test [',' test]] assert_stmt: 'assert' test [',' test] + with_stmt: 'with' expr [NAME NAME] ':' suite ! compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] while_stmt: 'while' test ':' suite ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] Index: Include/compile.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/compile.h,v retrieving revision 2.41 diff -c -r2.41 compile.h *** Include/compile.h 12 Feb 2004 15:28:26 -0000 2.41 --- Include/compile.h 2 Aug 2005 13:40:22 -0000 *************** *** 48,53 **** --- 48,54 ---- in effect when the code block was compiled. */ #define CO_GENERATOR_ALLOWED 0x1000 /* no longer used in an essential way */ #define CO_FUTURE_DIVISION 0x2000 + #define CO_WITH_IS_KEYWORD 0x4000 PyAPI_DATA(PyTypeObject) PyCode_Type; *************** *** 80,85 **** --- 81,87 ---- #define FUTURE_NESTED_SCOPES "nested_scopes" #define FUTURE_GENERATORS "generators" #define FUTURE_DIVISION "division" + #define FUTURE_WITH_STMT "with_statement" #ifdef __cplusplus } Index: Include/opcode.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/opcode.h,v retrieving revision 2.45 diff -c -r2.45 opcode.h *** Include/opcode.h 21 Jun 2004 16:31:15 -0000 2.45 --- Include/opcode.h 2 Aug 2005 13:40:22 -0000 *************** *** 73,78 **** --- 73,79 ---- #define INPLACE_OR 79 #define BREAK_LOOP 80 + #define LOAD_EXIT_ARGS 81 #define LOAD_LOCALS 82 #define RETURN_VALUE 83 #define IMPORT_STAR 84 Index: Include/parsetok.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/parsetok.h,v retrieving revision 2.22 diff -c -r2.22 parsetok.h *** Include/parsetok.h 17 Apr 2003 14:55:40 -0000 2.22 --- Include/parsetok.h 2 Aug 2005 13:40:22 -0000 *************** *** 17,24 **** int expected; } perrdetail; ! #if 0 ! #define PyPARSE_YIELD_IS_KEYWORD 0x0001 #endif #define PyPARSE_DONT_IMPLY_DEDENT 0x0002 --- 17,25 ---- int expected; } perrdetail; ! #if 1 /* future keyword */ ! /* this is the same as CO_WITH_IS_KEYWORD */ ! #define PyPARSE_WITH_IS_KEYWORD 0x4000 #endif #define PyPARSE_DONT_IMPLY_DEDENT 0x0002 Index: Include/pythonrun.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pythonrun.h,v retrieving revision 2.67 diff -c -r2.67 pythonrun.h *** Include/pythonrun.h 1 Aug 2005 21:39:27 -0000 2.67 --- Include/pythonrun.h 2 Aug 2005 13:40:22 -0000 *************** *** 7,13 **** extern "C" { #endif ! #define PyCF_MASK (CO_FUTURE_DIVISION) #define PyCF_MASK_OBSOLETE (CO_GENERATOR_ALLOWED | CO_NESTED) #define PyCF_SOURCE_IS_UTF8 0x0100 #define PyCF_DONT_IMPLY_DEDENT 0x0200 --- 7,13 ---- extern "C" { #endif ! #define PyCF_MASK (CO_FUTURE_DIVISION | CO_WITH_IS_KEYWORD) #define PyCF_MASK_OBSOLETE (CO_GENERATOR_ALLOWED | CO_NESTED) #define PyCF_SOURCE_IS_UTF8 0x0100 #define PyCF_DONT_IMPLY_DEDENT 0x0200 Index: Include/graminit.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/graminit.h,v retrieving revision 2.24 diff -c -r2.24 graminit.h *** Include/graminit.h 2 Aug 2005 00:46:42 -0000 2.24 --- Include/graminit.h 2 Aug 2005 13:40:22 -0000 *************** *** 33,79 **** #define global_stmt 288 #define exec_stmt 289 #define assert_stmt 290 ! #define compound_stmt 291 ! #define if_stmt 292 ! #define while_stmt 293 ! #define for_stmt 294 ! #define try_stmt 295 ! #define except_clause 296 ! #define suite 297 ! #define test 298 ! #define and_test 299 ! #define not_test 300 ! #define comparison 301 ! #define comp_op 302 ! #define expr 303 ! #define xor_expr 304 ! #define and_expr 305 ! #define shift_expr 306 ! #define arith_expr 307 ! #define term 308 ! #define factor 309 ! #define power 310 ! #define atom 311 ! #define listmaker 312 ! #define testlist_gexp 313 ! #define lambdef 314 ! #define trailer 315 ! #define subscriptlist 316 ! #define subscript 317 ! #define sliceop 318 ! #define exprlist 319 ! #define testlist 320 ! #define testlist_safe 321 ! #define dictmaker 322 ! #define classdef 323 ! #define arglist 324 ! #define argument 325 ! #define list_iter 326 ! #define list_for 327 ! #define list_if 328 ! #define gen_iter 329 ! #define gen_for 330 ! #define gen_if 331 ! #define testlist1 332 ! #define encoding_decl 333 ! #define yield_expr 334 --- 33,80 ---- #define global_stmt 288 #define exec_stmt 289 #define assert_stmt 290 ! #define with_stmt 291 ! #define compound_stmt 292 ! #define if_stmt 293 ! #define while_stmt 294 ! #define for_stmt 295 ! #define try_stmt 296 ! #define except_clause 297 ! #define suite 298 ! #define test 299 ! #define and_test 300 ! #define not_test 301 ! #define comparison 302 ! #define comp_op 303 ! #define expr 304 ! #define xor_expr 305 ! #define and_expr 306 ! #define shift_expr 307 ! #define arith_expr 308 ! #define term 309 ! #define factor 310 ! #define power 311 ! #define atom 312 ! #define listmaker 313 ! #define testlist_gexp 314 ! #define lambdef 315 ! #define trailer 316 ! #define subscriptlist 317 ! #define subscript 318 ! #define sliceop 319 ! #define exprlist 320 ! #define testlist 321 ! #define testlist_safe 322 ! #define dictmaker 323 ! #define classdef 324 ! #define arglist 325 ! #define argument 326 ! #define list_iter 327 ! #define list_for 328 ! #define list_if 329 ! #define gen_iter 330 ! #define gen_for 331 ! #define gen_if 332 ! #define testlist1 333 ! #define encoding_decl 334 ! #define yield_expr 335 Index: Lib/__future__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/__future__.py,v retrieving revision 1.13 diff -c -r1.13 __future__.py *** Lib/__future__.py 24 Aug 2001 17:13:54 -0000 1.13 --- Lib/__future__.py 2 Aug 2005 13:40:23 -0000 *************** *** 51,56 **** --- 51,57 ---- "nested_scopes", "generators", "division", + "with_statement" ] __all__ = ["all_feature_names"] + all_feature_names *************** *** 62,67 **** --- 63,69 ---- CO_NESTED = 0x0010 # nested_scopes CO_GENERATOR_ALLOWED = 0x1000 # generators CO_FUTURE_DIVISION = 0x2000 # division + CO_WITH_IS_KEYWORD = 0x4000 # the with statement class _Feature: def __init__(self, optionalRelease, mandatoryRelease, compiler_flag): *************** *** 102,104 **** --- 104,110 ---- division = _Feature((2, 2, 0, "alpha", 2), (3, 0, 0, "alpha", 0), CO_FUTURE_DIVISION) + + with_statement = _Feature((2, 5, 0, "alpha", 1), + (2, 6, 0, "alpha", 1), + CO_WITH_IS_KEYWORD) Index: Lib/opcode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/opcode.py,v retrieving revision 1.6 diff -c -r1.6 opcode.py *** Lib/opcode.py 21 Jun 2004 16:31:13 -0000 1.6 --- Lib/opcode.py 2 Aug 2005 13:40:23 -0000 *************** *** 113,119 **** def_op('INPLACE_XOR', 78) def_op('INPLACE_OR', 79) def_op('BREAK_LOOP', 80) ! def_op('LOAD_LOCALS', 82) def_op('RETURN_VALUE', 83) def_op('IMPORT_STAR', 84) --- 113,119 ---- def_op('INPLACE_XOR', 78) def_op('INPLACE_OR', 79) def_op('BREAK_LOOP', 80) ! def_op('LOAD_EXIT_ARGS', 81) def_op('LOAD_LOCALS', 82) def_op('RETURN_VALUE', 83) def_op('IMPORT_STAR', 84) Index: Lib/symbol.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/symbol.py,v retrieving revision 1.19 diff -c -r1.19 symbol.py *** Lib/symbol.py 2 Aug 2005 00:46:42 -0000 1.19 --- Lib/symbol.py 2 Aug 2005 13:40:23 -0000 *************** *** 45,94 **** global_stmt = 288 exec_stmt = 289 assert_stmt = 290 ! compound_stmt = 291 ! if_stmt = 292 ! while_stmt = 293 ! for_stmt = 294 ! try_stmt = 295 ! except_clause = 296 ! suite = 297 ! test = 298 ! and_test = 299 ! not_test = 300 ! comparison = 301 ! comp_op = 302 ! expr = 303 ! xor_expr = 304 ! and_expr = 305 ! shift_expr = 306 ! arith_expr = 307 ! term = 308 ! factor = 309 ! power = 310 ! atom = 311 ! listmaker = 312 ! testlist_gexp = 313 ! lambdef = 314 ! trailer = 315 ! subscriptlist = 316 ! subscript = 317 ! sliceop = 318 ! exprlist = 319 ! testlist = 320 ! testlist_safe = 321 ! dictmaker = 322 ! classdef = 323 ! arglist = 324 ! argument = 325 ! list_iter = 326 ! list_for = 327 ! list_if = 328 ! gen_iter = 329 ! gen_for = 330 ! gen_if = 331 ! testlist1 = 332 ! encoding_decl = 333 ! yield_expr = 334 #--end constants-- sym_name = {} --- 45,95 ---- global_stmt = 288 exec_stmt = 289 assert_stmt = 290 ! with_stmt = 291 ! compound_stmt = 292 ! if_stmt = 293 ! while_stmt = 294 ! for_stmt = 295 ! try_stmt = 296 ! except_clause = 297 ! suite = 298 ! test = 299 ! and_test = 300 ! not_test = 301 ! comparison = 302 ! comp_op = 303 ! expr = 304 ! xor_expr = 305 ! and_expr = 306 ! shift_expr = 307 ! arith_expr = 308 ! term = 309 ! factor = 310 ! power = 311 ! atom = 312 ! listmaker = 313 ! testlist_gexp = 314 ! lambdef = 315 ! trailer = 316 ! subscriptlist = 317 ! subscript = 318 ! sliceop = 319 ! exprlist = 320 ! testlist = 321 ! testlist_safe = 322 ! dictmaker = 323 ! classdef = 324 ! arglist = 325 ! argument = 326 ! list_iter = 327 ! list_for = 328 ! list_if = 329 ! gen_iter = 330 ! gen_for = 331 ! gen_if = 332 ! testlist1 = 333 ! encoding_decl = 334 ! yield_expr = 335 #--end constants-- sym_name = {} Index: Lib/compiler/ast.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/ast.py,v retrieving revision 1.28 diff -c -r1.28 ast.py *** Lib/compiler/ast.py 2 Jun 2005 05:55:18 -0000 1.28 --- Lib/compiler/ast.py 2 Aug 2005 13:40:26 -0000 *************** *** 1297,1302 **** --- 1297,1318 ---- def __repr__(self): return "While(%s, %s, %s)" % (repr(self.test), repr(self.body), repr(self.else_)) + class With(Node): + def __init__(self, expr, var, body, lineno=None): + self.expr = expr + self.var = var + self.body = body + self.lineno = lineno + + def getChildren(self): + return self.expr, self.var, self.body + + def getChildNodes(self): + return self.expr, self.body + + def __repr__(self): + return "With(%s, %s, %s)" % (repr(self.expr), repr(self.var), repr(self.body)) + class Yield(Node): def __init__(self, value, lineno=None): self.value = value Index: Lib/compiler/pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/pycodegen.py,v retrieving revision 1.73 diff -c -r1.73 pycodegen.py *** Lib/compiler/pycodegen.py 20 Aug 2004 03:47:13 -0000 1.73 --- Lib/compiler/pycodegen.py 2 Aug 2005 13:40:29 -0000 *************** *** 10,16 **** from compiler import pyassem, misc, future, symbols from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL from compiler.consts import CO_VARARGS, CO_VARKEYWORDS, CO_NEWLOCALS,\ ! CO_NESTED, CO_GENERATOR, CO_GENERATOR_ALLOWED, CO_FUTURE_DIVISION from compiler.pyassem import TupleArg # XXX The version-specific code can go, since this code only works with 2.x. --- 10,17 ---- from compiler import pyassem, misc, future, symbols from compiler.consts import SC_LOCAL, SC_GLOBAL, SC_FREE, SC_CELL from compiler.consts import CO_VARARGS, CO_VARKEYWORDS, CO_NEWLOCALS,\ ! CO_NESTED, CO_GENERATOR, CO_GENERATOR_ALLOWED, CO_FUTURE_DIVISION, \ ! CO_WITH_IS_KEYWORD from compiler.pyassem import TupleArg # XXX The version-specific code can go, since this code only works with 2.x. *************** *** 216,221 **** --- 217,225 ---- self._div_op = "BINARY_TRUE_DIVIDE" elif feature == "generators": self.graph.setFlag(CO_GENERATOR_ALLOWED) + elif feature == "with_statement": + self.graph.setFlag(CO_WITH_IS_KEYWORD) + def initClass(self): """This method is called once for each class""" *************** *** 808,813 **** --- 812,861 ---- self.emit('END_FINALLY') self.setups.pop() + def visitWith(self, node): + self.set_lineno(node) + self.visit(node.expr) + self.emit('DUP_TOP') + self.emit('LOAD_ATTR', '__enter__') + self.emit('CALL_FUNCTION', 0) + if node.var is not None: + self.storeName(node.var) + else: + self.emit('POP_TOP') + + tmpname = '_[%s]'%self.__list_count + self.__list_count = self.__list_count + 1 + self.storeName(tmpname) + + body = self.newBlock() + final = self.newBlock() + + self.emit('SETUP_FINALLY', final) + self.nextBlock(body) + self.setups.push((TRY_FINALLY, body)) + + self.visit(node.body) + + self.emit('POP_BLOCK') + self.setups.pop() + + self.emit('LOAD_CONST', None) + self.nextBlock(final) + self.setups.push((END_FINALLY, final)) + + self.loadName(tmpname) + self.delName(tmpname) + + self.emit('LOAD_ATTR', '__exit__') + self.emit('LOAD_EXIT_ARGS') + self.emit('CALL_FUNCTION', 3) + self.emit('POP_TOP') + + self.emit('END_FINALLY') + self.setups.pop() + + self.__list_count = self.__list_count - 1 + # misc def visitDiscard(self, node): Index: Lib/compiler/transformer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/transformer.py,v retrieving revision 1.52 diff -c -r1.52 transformer.py *** Lib/compiler/transformer.py 2 Aug 2005 00:46:43 -0000 1.52 --- Lib/compiler/transformer.py 2 Aug 2005 13:40:32 -0000 *************** *** 535,540 **** --- 535,550 ---- return self.com_try_except(nodelist) + def with_stmt(self, nodelist): + # 'with' expr [NAME NAME] ':' suite + expr = self.com_node(nodelist[1]) + varname = None + if len(nodelist) == 6: + assert nodelist[2][1] == 'as' + varname = nodelist[3][1] + suite = self.com_node(nodelist[-1]) + return With(expr, varname, suite) + def suite(self, nodelist): # simple_stmt | NEWLINE INDENT NEWLINE* (stmt NEWLINE*)+ DEDENT if len(nodelist) == 1: *************** *** 1413,1418 **** --- 1423,1431 ---- if hasattr(symbol, 'yield_expr'): _legal_node_types.append(symbol.yield_expr) + if hasattr(symbol, 'with_stmt'): + _legal_node_types.append(symbol.with_stmt) + _assign_types = [ symbol.test, symbol.and_test, Index: Lib/test/regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.170 diff -c -r1.170 regrtest.py *** Lib/test/regrtest.py 17 Jul 2005 02:37:00 -0000 1.170 --- Lib/test/regrtest.py 2 Aug 2005 13:40:34 -0000 *************** *** 111,116 **** --- 111,121 ---- import cStringIO import traceback + ## XXX Weaargh, I want a better way of doing this! + ## import doctest + ## from compiler import pycodegen + ## doctest.compile = pycodegen.compile + # I see no other way to suppress these warnings; # putting them in test_grammar.py has no effect: warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning, Index: Lib/test/test_with.py =================================================================== RCS file: Lib/test/test_with.py diff -N Lib/test/test_with.py *** /dev/null 1 Jan 1970 00:00:00 -0000 --- Lib/test/test_with.py 2 Aug 2005 13:40:35 -0000 *************** *** 0 **** --- 1,384 ---- + # see PEP 343! + from __future__ import with_statement + + basic_tests = ''' + The basic story: + + >>> class DemoContext(object): + ... def __enter__(self): + ... print "going in" + ... def __exit__(self, typ, val, tb): + ... print "going out" + ... + >>> with DemoContext(): + ... print "inside" + ... + going in + inside + going out + + Of course, the __exit__ method is executed even if the body of the + statement exits via an exception: + + >>> try: + ... with DemoContext(): + ... print "inside" + ... 1/0 + ... except Exception, e: + ... print e.__class__.__name__ + going in + inside + going out + ZeroDivisionError + + The context manager has access to the exception information (three + Nones if there was no exception): + + >>> class ExitArgContext(object): + ... def __enter__(self): + ... pass + ... def __exit__(self, typ, val, tb): + ... print getattr(typ, "__name__", typ) + ... + >>> try: + ... with ExitArgContext(): + ... 1/0 + ... except: + ... print "error" + ... + ZeroDivisionError + error + >>> try: + ... with ExitArgContext(): + ... pass + ... except: + ... print "error" + ... + None + >>> try: + ... with ExitArgContext(): + ... raise RuntimeError + ... except: + ... print "error" + ... + RuntimeError + error + + The return value of __enter__ can be bound to a variable: + + >>> class DemoContext2(object): + ... def __enter__(self): + ... print "going in" + ... return "ret" + ... def __exit__(self, typ, val, tb): + ... print "going out" + ... + >>> with DemoContext2(): + ... print "inside" + ... + going in + inside + going out + >>> with DemoContext2() as var: + ... print "inside with", var + ... + going in + inside with ret + going out + + What are the ways control can leave a code block? I count: Falling + off the end, return, break, continue, and via exception. We\'ve + tested falling off and exceptions. Falling off the end and exceptions + were covered above, let\'s check the others. + + Return: + + >>> def f(): + ... with DemoContext(): + ... return 1 + ... + >>> f() + going in + going out + 1 + + Break: + + >>> def g(): + ... while 1: + ... print "a", + ... with DemoContext(): + ... print "b" + ... break + ... + >>> g() + a going in + b + going out + + And continue: + + >>> def h(): + ... for i in range(2): + ... with DemoContext(): + ... print i + ... if i % 2 == 0: + ... continue + ... + >>> h() + going in + 0 + going out + going in + 1 + going out + + Of course, with statements can be nested: + + >>> class DemoContext3(object): + ... def __init__(self, m): + ... self.m = m + ... def __enter__(self): + ... print "going in with", self.m + ... return self.m + ... def __exit__(self, typ, val, tb): + ... print "going out with", self.m + ... + + >>> with DemoContext3(1) as a: + ... with DemoContext3(2) as b: + ... print 3 + ... + going in with 1 + going in with 2 + 3 + going out with 2 + going out with 1 + + ''' + + pep_tests = ''' + Many of the examples from the PEPs use this wrapper; as and when it + gets defined somewhere in the stdlib, it can get imported from there. + + >>> class ContextWrapper(object): + ... def __init__(self, gen): + ... self.gen = gen + ... def __enter__(self): + ... try: + ... return self.gen.next() + ... except StopIteration: + ... raise RuntimeError("generator didn't yield") + ... def __exit__(self, type, value, traceback): + ... if type is None: + ... try: + ... self.gen.next() + ... except StopIteration: + ... return + ... else: + ... raise RuntimeError("generator didn't stop") + ... else: + ... try: + ... self.gen.throw(type, value, traceback) + ... except (type, StopIteration): + ... return + ... else: + ... raise RuntimeError("generator caught exception") + ... + >>> def contextmanager(func): + ... def helper(*args, **kwds): + ... return ContextWrapper(func(*args, **kwds)) + ... return helper + ... + + - The locking example. + + A fake lock class: + + >>> class Lock(object): + ... def acquire(self): + ... print "lock" + ... def release(self): + ... print "unlock" + ... + + The first, and canonical example: + + >>> @contextmanager + ... def locking(lock): + ... lock.acquire() + ... try: + ... yield None + ... finally: + ... lock.release() + + Used as follows: + + >>> myLock = Lock() + >>> with locking(myLock): + ... print "Locked" + ... + lock + Locked + unlock + + - The transactional example. + + First a fake database: + + >>> class FakeDB(object): + ... def begin(self): + ... print "begin" + ... def rollback(self): + ... print "rollback" + ... def commit(self): + ... print "commit" + ... + + Then the context manager: + + >>> @contextmanager + ... def transactional(db): + ... db.begin() + ... try: + ... yield None + ... except: + ... db.rollback() + ... else: + ... db.commit() + ... + + And some examples: + + >>> db = FakeDB() + >>> with transactional(db): + ... print "hi" + ... + begin + hi + commit + >>> try: + ... with transactional(db): + ... 1/0 + ... except ZeroDivisionError: + ... print "exception" + ... + begin + rollback + exception + + - The locking-by-hand example. + + This is the only example from the PEP that isn\'t a 342-dependent + generator: + + >>> class locking: + ... def __init__(self, lock): + ... self.lock = lock + ... def __enter__(self): + ... self.lock.acquire() + ... def __exit__(self, type, value, tb): + ... self.lock.release() + ... + + >>> myLock = Lock() + >>> with locking(myLock): + ... print "it\'s locked!" + ... + lock + it\'s locked! + unlock + + - The redirecting_stdout example. + + >>> import sys + >>> @contextmanager + ... def redirecting_stdout(new_stdout): + ... save_stdout = sys.stdout + ... sys.stdout = new_stdout + ... try: + ... yield None + ... finally: + ... sys.stdout = save_stdout + ... + >>> import StringIO + >>> s = StringIO.StringIO() + >>> with redirecting_stdout(s): + ... print "hello", + ... print "world" + ... + >>> print s.getvalue()[:-1] + hello world + + + - The decimal example. + + >>> import decimal + >>> + >>> @contextmanager + ... def extra_precision(places=2): + ... c = decimal.getcontext() + ... saved_prec = c.prec + ... c.prec += places + ... try: + ... yield None + ... finally: + ... c.prec = saved_prec + ... + >>> def sin(x): + ... "Return the sine of x as measured in radians." + ... with extra_precision(): + ... i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1 + ... while s != lasts: + ... lasts = s + ... i += 2 + ... fact *= i * (i-1) + ... num *= x * x + ... sign *= -1 + ... s += num / fact * sign + ... # The "+s" rounds back to the original precision, + ... # so this must be outside the with-statement: + ... return +s + ... + >>> sin(decimal.Decimal("1.0")) + Decimal("0.8414709848078965066525023216") + >>> + + - The generic object closing example. + + >>> @contextmanager + ... def closing(obj): + ... try: + ... yield obj + ... finally: + ... obj.close() + ... + >>> def some_gen(): + ... yield 1 + ... try: + ... yield 2 + ... except GeneratorExit, g: + ... print g.__class__.__name__ + ... raise + ... + >>> # deterministically finalize a generator: + ... with closing(some_gen()) as data: + ... for datum in data: + ... print datum + ... if datum % 2 == 0: + ... break + ... + 1 + 2 + GeneratorExit + + + ''' + + __test__ = {"basic": basic_tests, + "pep": pep_tests, + } + + def test_main(verbose=None): + from test import test_support, test_with + test_support.run_doctest(test_with, verbose) Index: Lib/test/test_parser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_parser.py,v retrieving revision 1.23 diff -c -r1.23 test_parser.py *** Lib/test/test_parser.py 2 Aug 2005 00:46:43 -0000 1.23 --- Lib/test/test_parser.py 2 Aug 2005 13:40:36 -0000 *************** *** 179,184 **** --- 179,190 ---- def test_assert(self): self.check_suite("assert alo < ahi and blo < bhi\n") + def test_with_stmt(self): + fi = "from __future__ import with_statement\n" + + self.check_suite(fi+"with a: pass") + self.check_suite(fi+"with a as b: pass") + # # Second, we take *invalid* trees and make sure we get ParserError # rejections for them. Index: Modules/parsermodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/parsermodule.c,v retrieving revision 2.87 diff -c -r2.87 parsermodule.c *** Modules/parsermodule.c 2 Aug 2005 00:46:44 -0000 2.87 --- Modules/parsermodule.c 2 Aug 2005 13:40:42 -0000 *************** *** 845,850 **** --- 845,851 ---- VALIDATER(exec_stmt); VALIDATER(compound_stmt); VALIDATER(while); VALIDATER(for); VALIDATER(try); VALIDATER(except_clause); + VALIDATER(with); VALIDATER(test); VALIDATER(and_test); VALIDATER(not_test); VALIDATER(comparison); VALIDATER(comp_op); VALIDATER(expr); *************** *** 1496,1501 **** --- 1497,1503 ---- || (ntype == for_stmt) || (ntype == try_stmt) || (ntype == funcdef) + || (ntype == with_stmt) || (ntype == classdef)) res = validate_node(tree); else { *************** *** 2037,2042 **** --- 2039,2064 ---- static int + validate_with(node *tree) + { + int nch = NCH(tree); + int res = (validate_ntype(tree, with_stmt) + && (nch == 6 || nch == 4) + && validate_name(CHILD(tree, 0), "with") + && validate_expr(CHILD(tree, 1)) + && validate_colon(CHILD(tree, nch - 2)) + && validate_suite(CHILD(tree, nch - 1))); + + if (res && (nch == 5)) + res = (validate_name(CHILD(tree, 2), "as") + && validate_name(CHILD(tree, 3), NULL)); + + return (res); + } + + + + static int validate_test(node *tree) { int nch = NCH(tree); *************** *** 2935,2940 **** --- 2957,2965 ---- case try_stmt: res = validate_try(tree); break; + case with_stmt: + res = validate_with(tree); + break; case suite: res = validate_suite(tree); break; Index: Parser/parser.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/parser.c,v retrieving revision 2.22 diff -c -r2.22 parser.c *** Parser/parser.c 22 Mar 2002 23:38:11 -0000 2.22 --- Parser/parser.c 2 Aug 2005 13:40:43 -0000 *************** *** 79,86 **** if (ps == NULL) return NULL; ps->p_grammar = g; ! #if 0 /* future keyword */ ! ps->p_generators = 0; #endif ps->p_tree = PyNode_New(start); if (ps->p_tree == NULL) { --- 79,86 ---- if (ps == NULL) return NULL; ps->p_grammar = g; ! #if 1 /* future keyword */ ! ps->p_with_stmt = 0; #endif ps->p_tree = PyNode_New(start); if (ps->p_tree == NULL) { *************** *** 147,156 **** if (l->lb_type == NAME && l->lb_str != NULL && l->lb_str[0] == s[0] && strcmp(l->lb_str, s) == 0) { ! #if 0 /* future keyword */ ! if (!ps->p_generators && ! s[0] == 'y' && ! strcmp(s, "yield") == 0) break; /* not a keyword */ #endif D(printf("It's a keyword\n")); --- 147,156 ---- if (l->lb_type == NAME && l->lb_str != NULL && l->lb_str[0] == s[0] && strcmp(l->lb_str, s) == 0) { ! #if 1 /* future keyword */ ! if (!ps->p_with_stmt && ! s[0] == 'w' && ! strcmp(s, "with") == 0) break; /* not a keyword */ #endif D(printf("It's a keyword\n")); *************** *** 174,180 **** return -1; } ! #if 0 /* future keyword */ static void future_hack(parser_state *ps) { --- 174,180 ---- return -1; } ! #if 1 /* future keyword */ static void future_hack(parser_state *ps) { *************** *** 182,197 **** node *ch; int i; ! if (strcmp(STR(CHILD(n, 0)), "from") != 0) return; ch = CHILD(n, 1); if (strcmp(STR(CHILD(ch, 0)), "__future__") != 0) return; ! for (i = 3; i < NCH(n); i += 2) { ch = CHILD(n, i); if (NCH(ch) >= 1 && TYPE(CHILD(ch, 0)) == NAME && ! strcmp(STR(CHILD(ch, 0)), "generators") == 0) { ! ps->p_generators = 1; break; } } --- 182,202 ---- node *ch; int i; ! if (strcmp(STR(CHILD(CHILD(n, 0), 0)), "from") != 0) return; + n = CHILD(n, 0); ch = CHILD(n, 1); if (strcmp(STR(CHILD(ch, 0)), "__future__") != 0) return; ! ch = CHILD(n, 3); ! if (STR(ch) && strcmp(STR(ch), "(") == 0) ! ch = CHILD(n, 4); ! n = ch; ! for (i = 0; i < NCH(n); i += 2) { ch = CHILD(n, i); if (NCH(ch) >= 1 && TYPE(CHILD(ch, 0)) == NAME && ! strcmp(STR(CHILD(ch, 0)), "with_statement") == 0) { ! ps->p_with_stmt = 1; break; } } *************** *** 255,261 **** "Direct pop.\n", d->d_name, ps->p_stack.s_top->s_state)); ! #if 0 /* future keyword */ if (d->d_name[0] == 'i' && strcmp(d->d_name, "import_stmt") == 0) --- 260,266 ---- "Direct pop.\n", d->d_name, ps->p_stack.s_top->s_state)); ! #if 1 /* future keyword */ if (d->d_name[0] == 'i' && strcmp(d->d_name, "import_stmt") == 0) *************** *** 273,279 **** } if (s->s_accept) { ! #if 0 /* future keyword */ if (d->d_name[0] == 'i' && strcmp(d->d_name, "import_stmt") == 0) future_hack(ps); --- 278,284 ---- } if (s->s_accept) { ! #if 1 /* future keyword */ if (d->d_name[0] == 'i' && strcmp(d->d_name, "import_stmt") == 0) future_hack(ps); Index: Parser/parser.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/parser.h,v retrieving revision 2.16 diff -c -r2.16 parser.h *** Parser/parser.h 22 Mar 2002 23:52:49 -0000 2.16 --- Parser/parser.h 2 Aug 2005 13:40:44 -0000 *************** *** 25,32 **** stack p_stack; /* Stack of parser states */ grammar *p_grammar; /* Grammar to use */ node *p_tree; /* Top of parse tree */ ! #if 0 /* future keyword */ ! int p_generators; /* 1 if yield is a keyword */ #endif } parser_state; --- 25,32 ---- stack p_stack; /* Stack of parser states */ grammar *p_grammar; /* Grammar to use */ node *p_tree; /* Top of parse tree */ ! #if 1 /* future keyword */ ! int p_with_stmt; /* 1 if with is a keyword */ #endif } parser_state; Index: Parser/parsetok.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/parsetok.c,v retrieving revision 2.36 diff -c -r2.36 parsetok.c *** Parser/parsetok.c 8 Jul 2004 01:54:07 -0000 2.36 --- Parser/parsetok.c 2 Aug 2005 13:40:44 -0000 *************** *** 93,101 **** /* Parse input coming from the given tokenizer structure. Return error code. */ ! #if 0 /* future keyword */ ! static char yield_msg[] = ! "%s:%d: Warning: 'yield' will become a reserved keyword in the future\n"; #endif static node * --- 93,101 ---- /* Parse input coming from the given tokenizer structure. Return error code. */ ! #if 1 /* future keyword */ ! static char with_msg[] = ! "%s:%d: Warning: 'with' will become a reserved keyword in the future\n"; #endif static node * *************** *** 111,119 **** err_ret->error = E_NOMEM; return NULL; } ! #if 0 /* future keyword */ ! if (flags & PyPARSE_YIELD_IS_KEYWORD) ! ps->p_generators = 1; #endif for (;;) { --- 111,119 ---- err_ret->error = E_NOMEM; return NULL; } ! #if 1 /* future keyword */ ! if (flags & PyPARSE_WITH_IS_KEYWORD) ! ps->p_with_stmt = 1; #endif for (;;) { *************** *** 153,163 **** strncpy(str, a, len); str[len] = '\0'; ! #if 0 /* future keyword */ /* Warn about yield as NAME */ ! if (type == NAME && !ps->p_generators && ! len == 5 && str[0] == 'y' && strcmp(str, "yield") == 0) ! PySys_WriteStderr(yield_msg, err_ret->filename==NULL ? "" : err_ret->filename, tok->lineno); --- 153,163 ---- strncpy(str, a, len); str[len] = '\0'; ! #if 1 /* future keyword */ /* Warn about yield as NAME */ ! if (type == NAME && !ps->p_with_stmt && ! len == 4 && str[0] == 'w' && strcmp(str, "with") == 0) ! PySys_WriteStderr(with_msg, err_ret->filename==NULL ? "" : err_ret->filename, tok->lineno); Index: Python/ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.425 diff -c -r2.425 ceval.c *** Python/ceval.c 2 Aug 2005 00:46:45 -0000 2.425 --- Python/ceval.c 2 Aug 2005 13:40:51 -0000 *************** *** 1697,1702 **** --- 1697,1732 ---- } Py_DECREF(v); break; + + case LOAD_EXIT_ARGS: + v = SECOND(); + + if (v == Py_None) { + w = Py_None; + u = Py_None; + } + else if (PyInt_Check(v)) { + v = Py_None; + w = Py_None; + u = Py_None; + } + else if (PyClass_Check(v) || PyString_Check(v)) { + w = THIRD(); + u = FOURTH(); + } + else { + PyErr_SetString(PyExc_SystemError, + "'with' pops bad exception"); + why = WHY_EXCEPTION; + break; + } + Py_INCREF(v); + Py_INCREF(w); + Py_INCREF(u); + PUSH(v); + PUSH(w); + PUSH(u); + break; case BUILD_CLASS: u = TOP(); Index: Python/compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.351 diff -c -r2.351 compile.c *** Python/compile.c 2 Aug 2005 00:46:46 -0000 2.351 --- Python/compile.c 2 Aug 2005 13:41:03 -0000 *************** *** 4324,4329 **** --- 4324,4406 ---- com_try_except(c, n); } + static void + com_with_stmt(struct compiling *c, node *n) + { + int has_as = 0; + int finally_anchor = 0; + char tmpname[30]; + + if (TYPE(CHILD(n, 2)) == NAME) { + if (strcmp(STR(CHILD(n, 2)), "as") != 0) { + com_error(c, PyExc_SyntaxError, "invalid syntax"); + return; + } + has_as = 1; + } + + com_node(c, CHILD(n, 1)); + com_push(c, 1); + + com_addbyte(c, DUP_TOP); + com_push(c, 1); + + com_addop_name(c, LOAD_ATTR, "__enter__"); + com_push(c, 1); + + com_addoparg(c, CALL_FUNCTION, 0); + + if (has_as) { + com_addop_varname(c, VAR_STORE, STR(CHILD(n, 3))); + } + else { + com_addbyte(c, POP_TOP); + } + com_pop(c, 1); + + PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", ++c->c_tmpname); + + com_addop_varname(c, VAR_STORE, tmpname); + com_pop(c, 1); + + com_addfwref(c, SETUP_FINALLY, &finally_anchor); + block_push(c, SETUP_FINALLY); + + com_node(c, CHILD(n, 3 + 2*has_as)); + + com_addbyte(c, POP_BLOCK); + block_pop(c, SETUP_FINALLY); + block_push(c, END_FINALLY); + com_addoparg(c, LOAD_CONST, com_addconst(c, Py_None)); + /* While the generated code pushes only one item, + the try-finally handling can enter here with + up to three items. OK, here are the details: + 3 for an exception, 2 for RETURN, 1 for BREAK. */ + com_push(c, 3); + com_backpatch(c, finally_anchor); + + com_addop_varname(c, VAR_LOAD, tmpname); + com_addop_varname(c, VAR_DELETE, tmpname); + + com_addop_name(c, LOAD_ATTR, "__exit__"); + com_push(c, 1); + + com_addbyte(c, LOAD_EXIT_ARGS); + com_push(c, 3); + + com_addoparg(c, CALL_FUNCTION, 3); + com_pop(c, 4); + + com_addbyte(c, POP_TOP); + com_pop(c, 1); + + com_addbyte(c, END_FINALLY); + block_pop(c, END_FINALLY); + com_pop(c, 3); /* Matches the com_push above */ + + --c->c_tmpname; + } + static node * get_rawdocstring(node *n) { *************** *** 4790,4795 **** --- 4867,4875 ---- case try_stmt: com_try_stmt(c, n); break; + case with_stmt: + com_with_stmt(c, n); + break; case suite: com_suite(c, n); break; *************** *** 6271,6276 **** --- 6351,6372 ---- n = CHILD(n, 3); goto loop; } + case with_stmt: + symtable_node(st, CHILD(n, 1)); + { + char tmpname[30]; + + PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", + ++st->st_cur->ste_tmpname); + symtable_add_def(st, tmpname, DEF_LOCAL); + } + if (TYPE(CHILD(n, 2)) == NAME) { + symtable_assign(st, CHILD(n, 3), 0); + symtable_node(st, CHILD(n, 5)); + } + else + symtable_node(st, CHILD(n, 3)); + --st->st_cur->ste_tmpname; case except_clause: if (NCH(n) == 4) symtable_assign(st, CHILD(n, 3), 0); Index: Python/future.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/future.c,v retrieving revision 2.15 diff -c -r2.15 future.c *** Python/future.c 4 Feb 2005 18:38:43 -0000 2.15 --- Python/future.c 2 Aug 2005 13:41:03 -0000 *************** *** 38,43 **** --- 38,45 ---- continue; } else if (strcmp(feature, FUTURE_DIVISION) == 0) { ff->ff_features |= CO_FUTURE_DIVISION; + } else if (strcmp(feature, FUTURE_WITH_STMT) == 0) { + ff->ff_features |= CO_WITH_IS_KEYWORD; } else if (strcmp(feature, "braces") == 0) { PyErr_SetString(PyExc_SyntaxError, "not a chance"); Index: Python/pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.215 diff -c -r2.215 pythonrun.c *** Python/pythonrun.c 1 Aug 2005 21:39:29 -0000 2.215 --- Python/pythonrun.c 2 Aug 2005 13:41:06 -0000 *************** *** 715,723 **** } /* compute parser flags based on compiler flags */ #define PARSER_FLAGS(flags) \ ! (((flags) && (flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \ ! PyPARSE_DONT_IMPLY_DEDENT : 0) int PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags) --- 715,725 ---- } /* compute parser flags based on compiler flags */ + /* XXX eugh, the horror! */ #define PARSER_FLAGS(flags) \ ! ((flags) ? ((((flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \ ! PyPARSE_DONT_IMPLY_DEDENT : 0) \ ! | ((flags)->cf_flags & CO_WITH_IS_KEYWORD)) : 0) int PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags) Index: Python/graminit.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/graminit.c,v retrieving revision 2.40 diff -c -r2.40 graminit.c *** Python/graminit.c 2 Aug 2005 00:46:46 -0000 2.40 --- Python/graminit.c 2 Aug 2005 13:41:09 -0000 *************** *** 687,745 **** {1, arcs_34_3}, {1, arcs_34_4}, }; ! static arc arcs_35_0[6] = { ! {84, 1}, {85, 1}, - {86, 1}, - {87, 1}, - {17, 1}, - {88, 1}, }; static arc arcs_35_1[1] = { ! {0, 1}, ! }; ! static state states_35[2] = { ! {6, arcs_35_0}, ! {1, arcs_35_1}, }; ! static arc arcs_36_0[1] = { ! {89, 1}, }; ! static arc arcs_36_1[1] = { ! {26, 2}, }; ! static arc arcs_36_2[1] = { ! {21, 3}, }; ! static arc arcs_36_3[1] = { ! {22, 4}, }; ! static arc arcs_36_4[3] = { ! {90, 1}, ! {91, 5}, ! {0, 4}, }; ! static arc arcs_36_5[1] = { ! {21, 6}, }; ! static arc arcs_36_6[1] = { ! {22, 7}, }; ! static arc arcs_36_7[1] = { ! {0, 7}, }; ! static state states_36[8] = { ! {1, arcs_36_0}, {1, arcs_36_1}, - {1, arcs_36_2}, - {1, arcs_36_3}, - {3, arcs_36_4}, - {1, arcs_36_5}, - {1, arcs_36_6}, - {1, arcs_36_7}, }; static arc arcs_37_0[1] = { ! {92, 1}, }; static arc arcs_37_1[1] = { {26, 2}, --- 687,741 ---- {1, arcs_34_3}, {1, arcs_34_4}, }; ! static arc arcs_35_0[1] = { {85, 1}, }; static arc arcs_35_1[1] = { ! {81, 2}, }; ! static arc arcs_35_2[2] = { ! {19, 3}, ! {21, 4}, }; ! static arc arcs_35_3[1] = { ! {19, 5}, }; ! static arc arcs_35_4[1] = { ! {22, 6}, }; ! static arc arcs_35_5[1] = { ! {21, 4}, }; ! static arc arcs_35_6[1] = { ! {0, 6}, }; ! static state states_35[7] = { ! {1, arcs_35_0}, ! {1, arcs_35_1}, ! {2, arcs_35_2}, ! {1, arcs_35_3}, ! {1, arcs_35_4}, ! {1, arcs_35_5}, ! {1, arcs_35_6}, }; ! static arc arcs_36_0[7] = { ! {86, 1}, ! {87, 1}, ! {88, 1}, ! {89, 1}, ! {84, 1}, ! {17, 1}, ! {90, 1}, }; ! static arc arcs_36_1[1] = { ! {0, 1}, }; ! static state states_36[2] = { ! {7, arcs_36_0}, {1, arcs_36_1}, }; static arc arcs_37_0[1] = { ! {91, 1}, }; static arc arcs_37_1[1] = { {26, 2}, *************** *** 750,757 **** static arc arcs_37_3[1] = { {22, 4}, }; ! static arc arcs_37_4[2] = { ! {91, 5}, {0, 4}, }; static arc arcs_37_5[1] = { --- 746,754 ---- static arc arcs_37_3[1] = { {22, 4}, }; ! static arc arcs_37_4[3] = { ! {92, 1}, ! {93, 5}, {0, 4}, }; static arc arcs_37_5[1] = { *************** *** 768,850 **** {1, arcs_37_1}, {1, arcs_37_2}, {1, arcs_37_3}, ! {2, arcs_37_4}, {1, arcs_37_5}, {1, arcs_37_6}, {1, arcs_37_7}, }; static arc arcs_38_0[1] = { ! {93, 1}, }; static arc arcs_38_1[1] = { ! {59, 2}, }; static arc arcs_38_2[1] = { ! {82, 3}, }; static arc arcs_38_3[1] = { ! {9, 4}, }; ! static arc arcs_38_4[1] = { ! {21, 5}, }; static arc arcs_38_5[1] = { ! {22, 6}, }; ! static arc arcs_38_6[2] = { ! {91, 7}, ! {0, 6}, }; static arc arcs_38_7[1] = { ! {21, 8}, ! }; ! static arc arcs_38_8[1] = { ! {22, 9}, ! }; ! static arc arcs_38_9[1] = { ! {0, 9}, }; ! static state states_38[10] = { {1, arcs_38_0}, {1, arcs_38_1}, {1, arcs_38_2}, {1, arcs_38_3}, ! {1, arcs_38_4}, {1, arcs_38_5}, ! {2, arcs_38_6}, {1, arcs_38_7}, - {1, arcs_38_8}, - {1, arcs_38_9}, }; static arc arcs_39_0[1] = { ! {94, 1}, }; static arc arcs_39_1[1] = { ! {21, 2}, }; static arc arcs_39_2[1] = { ! {22, 3}, }; ! static arc arcs_39_3[2] = { ! {95, 4}, ! {96, 5}, }; static arc arcs_39_4[1] = { ! {21, 6}, }; static arc arcs_39_5[1] = { ! {21, 7}, }; ! static arc arcs_39_6[1] = { ! {22, 8}, }; static arc arcs_39_7[1] = { ! {22, 9}, }; ! static arc arcs_39_8[3] = { ! {95, 4}, ! {91, 5}, ! {0, 8}, }; static arc arcs_39_9[1] = { {0, 9}, --- 765,837 ---- {1, arcs_37_1}, {1, arcs_37_2}, {1, arcs_37_3}, ! {3, arcs_37_4}, {1, arcs_37_5}, {1, arcs_37_6}, {1, arcs_37_7}, }; static arc arcs_38_0[1] = { ! {94, 1}, }; static arc arcs_38_1[1] = { ! {26, 2}, }; static arc arcs_38_2[1] = { ! {21, 3}, }; static arc arcs_38_3[1] = { ! {22, 4}, }; ! static arc arcs_38_4[2] = { ! {93, 5}, ! {0, 4}, }; static arc arcs_38_5[1] = { ! {21, 6}, }; ! static arc arcs_38_6[1] = { ! {22, 7}, }; static arc arcs_38_7[1] = { ! {0, 7}, }; ! static state states_38[8] = { {1, arcs_38_0}, {1, arcs_38_1}, {1, arcs_38_2}, {1, arcs_38_3}, ! {2, arcs_38_4}, {1, arcs_38_5}, ! {1, arcs_38_6}, {1, arcs_38_7}, }; static arc arcs_39_0[1] = { ! {95, 1}, }; static arc arcs_39_1[1] = { ! {59, 2}, }; static arc arcs_39_2[1] = { ! {82, 3}, }; ! static arc arcs_39_3[1] = { ! {9, 4}, }; static arc arcs_39_4[1] = { ! {21, 5}, }; static arc arcs_39_5[1] = { ! {22, 6}, }; ! static arc arcs_39_6[2] = { ! {93, 7}, ! {0, 6}, }; static arc arcs_39_7[1] = { ! {21, 8}, }; ! static arc arcs_39_8[1] = { ! {22, 9}, }; static arc arcs_39_9[1] = { {0, 9}, *************** *** 853,1009 **** {1, arcs_39_0}, {1, arcs_39_1}, {1, arcs_39_2}, ! {2, arcs_39_3}, {1, arcs_39_4}, {1, arcs_39_5}, ! {1, arcs_39_6}, {1, arcs_39_7}, ! {3, arcs_39_8}, {1, arcs_39_9}, }; static arc arcs_40_0[1] = { ! {97, 1}, }; ! static arc arcs_40_1[2] = { ! {26, 2}, ! {0, 1}, }; ! static arc arcs_40_2[2] = { ! {27, 3}, ! {0, 2}, }; ! static arc arcs_40_3[1] = { ! {26, 4}, }; static arc arcs_40_4[1] = { ! {0, 4}, }; ! static state states_40[5] = { {1, arcs_40_0}, ! {2, arcs_40_1}, ! {2, arcs_40_2}, ! {1, arcs_40_3}, {1, arcs_40_4}, }; ! static arc arcs_41_0[2] = { ! {3, 1}, ! {2, 2}, }; ! static arc arcs_41_1[1] = { {0, 1}, }; ! static arc arcs_41_2[1] = { ! {98, 3}, }; static arc arcs_41_3[1] = { ! {6, 4}, }; ! static arc arcs_41_4[2] = { ! {6, 4}, ! {99, 1}, }; static state states_41[5] = { ! {2, arcs_41_0}, ! {1, arcs_41_1}, ! {1, arcs_41_2}, {1, arcs_41_3}, ! {2, arcs_41_4}, }; static arc arcs_42_0[2] = { ! {100, 1}, ! {102, 2}, }; ! static arc arcs_42_1[2] = { ! {101, 3}, {0, 1}, }; static arc arcs_42_2[1] = { ! {0, 2}, }; static arc arcs_42_3[1] = { ! {100, 1}, }; ! static state states_42[4] = { {2, arcs_42_0}, ! {2, arcs_42_1}, {1, arcs_42_2}, {1, arcs_42_3}, }; ! static arc arcs_43_0[1] = { ! {103, 1}, }; static arc arcs_43_1[2] = { ! {104, 0}, {0, 1}, }; ! static state states_43[2] = { ! {1, arcs_43_0}, {2, arcs_43_1}, }; ! static arc arcs_44_0[2] = { {105, 1}, - {106, 2}, }; ! static arc arcs_44_1[1] = { ! {103, 2}, }; ! static arc arcs_44_2[1] = { {0, 2}, }; ! static state states_44[3] = { ! {2, arcs_44_0}, ! {1, arcs_44_1}, ! {1, arcs_44_2}, }; ! static arc arcs_45_0[1] = { {81, 1}, }; ! static arc arcs_45_1[2] = { ! {107, 0}, {0, 1}, }; ! static state states_45[2] = { ! {1, arcs_45_0}, ! {2, arcs_45_1}, }; ! static arc arcs_46_0[10] = { ! {108, 1}, ! {109, 1}, {110, 1}, {111, 1}, {112, 1}, {113, 1}, {114, 1}, {82, 1}, ! {105, 2}, ! {115, 3}, }; ! static arc arcs_46_1[1] = { {0, 1}, }; ! static arc arcs_46_2[1] = { {82, 1}, }; ! static arc arcs_46_3[2] = { ! {105, 1}, {0, 3}, }; ! static state states_46[4] = { ! {10, arcs_46_0}, ! {1, arcs_46_1}, ! {1, arcs_46_2}, ! {2, arcs_46_3}, ! }; ! static arc arcs_47_0[1] = { ! {116, 1}, ! }; ! static arc arcs_47_1[2] = { ! {117, 0}, ! {0, 1}, ! }; ! static state states_47[2] = { ! {1, arcs_47_0}, ! {2, arcs_47_1}, }; static arc arcs_48_0[1] = { {118, 1}, --- 840,1030 ---- {1, arcs_39_0}, {1, arcs_39_1}, {1, arcs_39_2}, ! {1, arcs_39_3}, {1, arcs_39_4}, {1, arcs_39_5}, ! {2, arcs_39_6}, {1, arcs_39_7}, ! {1, arcs_39_8}, {1, arcs_39_9}, }; static arc arcs_40_0[1] = { ! {96, 1}, }; ! static arc arcs_40_1[1] = { ! {21, 2}, }; ! static arc arcs_40_2[1] = { ! {22, 3}, }; ! static arc arcs_40_3[2] = { ! {97, 4}, ! {98, 5}, }; static arc arcs_40_4[1] = { ! {21, 6}, }; ! static arc arcs_40_5[1] = { ! {21, 7}, ! }; ! static arc arcs_40_6[1] = { ! {22, 8}, ! }; ! static arc arcs_40_7[1] = { ! {22, 9}, ! }; ! static arc arcs_40_8[3] = { ! {97, 4}, ! {93, 5}, ! {0, 8}, ! }; ! static arc arcs_40_9[1] = { ! {0, 9}, ! }; ! static state states_40[10] = { {1, arcs_40_0}, ! {1, arcs_40_1}, ! {1, arcs_40_2}, ! {2, arcs_40_3}, {1, arcs_40_4}, + {1, arcs_40_5}, + {1, arcs_40_6}, + {1, arcs_40_7}, + {3, arcs_40_8}, + {1, arcs_40_9}, }; ! static arc arcs_41_0[1] = { ! {99, 1}, }; ! static arc arcs_41_1[2] = { ! {26, 2}, {0, 1}, }; ! static arc arcs_41_2[2] = { ! {27, 3}, ! {0, 2}, }; static arc arcs_41_3[1] = { ! {26, 4}, }; ! static arc arcs_41_4[1] = { ! {0, 4}, }; static state states_41[5] = { ! {1, arcs_41_0}, ! {2, arcs_41_1}, ! {2, arcs_41_2}, {1, arcs_41_3}, ! {1, arcs_41_4}, }; static arc arcs_42_0[2] = { ! {3, 1}, ! {2, 2}, }; ! static arc arcs_42_1[1] = { {0, 1}, }; static arc arcs_42_2[1] = { ! {100, 3}, }; static arc arcs_42_3[1] = { ! {6, 4}, ! }; ! static arc arcs_42_4[2] = { ! {6, 4}, ! {101, 1}, }; ! static state states_42[5] = { {2, arcs_42_0}, ! {1, arcs_42_1}, {1, arcs_42_2}, {1, arcs_42_3}, + {2, arcs_42_4}, }; ! static arc arcs_43_0[2] = { ! {102, 1}, ! {104, 2}, }; static arc arcs_43_1[2] = { ! {103, 3}, {0, 1}, }; ! static arc arcs_43_2[1] = { ! {0, 2}, ! }; ! static arc arcs_43_3[1] = { ! {102, 1}, ! }; ! static state states_43[4] = { ! {2, arcs_43_0}, {2, arcs_43_1}, + {1, arcs_43_2}, + {1, arcs_43_3}, }; ! static arc arcs_44_0[1] = { {105, 1}, }; ! static arc arcs_44_1[2] = { ! {106, 0}, ! {0, 1}, ! }; ! static state states_44[2] = { ! {1, arcs_44_0}, ! {2, arcs_44_1}, ! }; ! static arc arcs_45_0[2] = { ! {107, 1}, ! {108, 2}, ! }; ! static arc arcs_45_1[1] = { ! {105, 2}, }; ! static arc arcs_45_2[1] = { {0, 2}, }; ! static state states_45[3] = { ! {2, arcs_45_0}, ! {1, arcs_45_1}, ! {1, arcs_45_2}, }; ! static arc arcs_46_0[1] = { {81, 1}, }; ! static arc arcs_46_1[2] = { ! {109, 0}, {0, 1}, }; ! static state states_46[2] = { ! {1, arcs_46_0}, ! {2, arcs_46_1}, }; ! static arc arcs_47_0[10] = { {110, 1}, {111, 1}, {112, 1}, {113, 1}, {114, 1}, + {115, 1}, + {116, 1}, {82, 1}, ! {107, 2}, ! {117, 3}, }; ! static arc arcs_47_1[1] = { {0, 1}, }; ! static arc arcs_47_2[1] = { {82, 1}, }; ! static arc arcs_47_3[2] = { ! {107, 1}, {0, 3}, }; ! static state states_47[4] = { ! {10, arcs_47_0}, ! {1, arcs_47_1}, ! {1, arcs_47_2}, ! {2, arcs_47_3}, }; static arc arcs_48_0[1] = { {118, 1}, *************** *** 1030,1050 **** static arc arcs_50_0[1] = { {122, 1}, }; ! static arc arcs_50_1[3] = { {123, 0}, - {57, 0}, {0, 1}, }; static state states_50[2] = { {1, arcs_50_0}, ! {3, arcs_50_1}, }; static arc arcs_51_0[1] = { {124, 1}, }; static arc arcs_51_1[3] = { {125, 0}, ! {126, 0}, {0, 1}, }; static state states_51[2] = { --- 1051,1070 ---- static arc arcs_50_0[1] = { {122, 1}, }; ! static arc arcs_50_1[2] = { {123, 0}, {0, 1}, }; static state states_50[2] = { {1, arcs_50_0}, ! {2, arcs_50_1}, }; static arc arcs_51_0[1] = { {124, 1}, }; static arc arcs_51_1[3] = { {125, 0}, ! {57, 0}, {0, 1}, }; static state states_51[2] = { *************** *** 1052,1195 **** {3, arcs_51_1}, }; static arc arcs_52_0[1] = { ! {127, 1}, }; ! static arc arcs_52_1[5] = { ! {28, 0}, {128, 0}, - {129, 0}, - {130, 0}, {0, 1}, }; static state states_52[2] = { {1, arcs_52_0}, ! {5, arcs_52_1}, }; ! static arc arcs_53_0[4] = { ! {125, 1}, ! {126, 1}, ! {131, 1}, ! {132, 2}, }; ! static arc arcs_53_1[1] = { ! {127, 2}, }; ! static arc arcs_53_2[1] = { {0, 2}, }; ! static state states_53[3] = { ! {4, arcs_53_0}, ! {1, arcs_53_1}, ! {1, arcs_53_2}, }; ! static arc arcs_54_0[1] = { ! {133, 1}, }; ! static arc arcs_54_1[3] = { ! {134, 1}, {29, 2}, {0, 1}, }; ! static arc arcs_54_2[1] = { ! {127, 3}, }; ! static arc arcs_54_3[1] = { {0, 3}, }; ! static state states_54[4] = { ! {1, arcs_54_0}, ! {3, arcs_54_1}, ! {1, arcs_54_2}, ! {1, arcs_54_3}, }; ! static arc arcs_55_0[7] = { {13, 1}, ! {136, 2}, ! {139, 3}, ! {142, 4}, {19, 5}, ! {144, 5}, ! {145, 6}, }; ! static arc arcs_55_1[3] = { {43, 7}, ! {135, 7}, {15, 5}, }; ! static arc arcs_55_2[2] = { ! {137, 8}, ! {138, 5}, ! }; ! static arc arcs_55_3[2] = { ! {140, 9}, ! {141, 5}, }; ! static arc arcs_55_4[1] = { ! {143, 10}, }; ! static arc arcs_55_5[1] = { {0, 5}, }; ! static arc arcs_55_6[2] = { ! {145, 6}, {0, 6}, }; ! static arc arcs_55_7[1] = { {15, 5}, }; ! static arc arcs_55_8[1] = { ! {138, 5}, ! }; ! static arc arcs_55_9[1] = { ! {141, 5}, }; ! static arc arcs_55_10[1] = { ! {142, 5}, }; ! static state states_55[11] = { ! {7, arcs_55_0}, ! {3, arcs_55_1}, ! {2, arcs_55_2}, ! {2, arcs_55_3}, ! {1, arcs_55_4}, ! {1, arcs_55_5}, ! {2, arcs_55_6}, ! {1, arcs_55_7}, ! {1, arcs_55_8}, ! {1, arcs_55_9}, ! {1, arcs_55_10}, ! }; ! static arc arcs_56_0[1] = { ! {26, 1}, ! }; ! static arc arcs_56_1[3] = { ! {146, 2}, ! {27, 3}, ! {0, 1}, ! }; ! static arc arcs_56_2[1] = { ! {0, 2}, ! }; ! static arc arcs_56_3[2] = { ! {26, 4}, ! {0, 3}, ! }; ! static arc arcs_56_4[2] = { ! {27, 3}, ! {0, 4}, }; ! static state states_56[5] = { ! {1, arcs_56_0}, {3, arcs_56_1}, ! {1, arcs_56_2}, {2, arcs_56_3}, ! {2, arcs_56_4}, }; static arc arcs_57_0[1] = { {26, 1}, }; static arc arcs_57_1[3] = { ! {147, 2}, {27, 3}, {0, 1}, }; --- 1072,1201 ---- {3, arcs_51_1}, }; static arc arcs_52_0[1] = { ! {126, 1}, }; ! static arc arcs_52_1[3] = { ! {127, 0}, {128, 0}, {0, 1}, }; static state states_52[2] = { {1, arcs_52_0}, ! {3, arcs_52_1}, }; ! static arc arcs_53_0[1] = { ! {129, 1}, ! }; ! static arc arcs_53_1[5] = { ! {28, 0}, ! {130, 0}, ! {131, 0}, ! {132, 0}, ! {0, 1}, }; ! static state states_53[2] = { ! {1, arcs_53_0}, ! {5, arcs_53_1}, }; ! static arc arcs_54_0[4] = { ! {127, 1}, ! {128, 1}, ! {133, 1}, ! {134, 2}, ! }; ! static arc arcs_54_1[1] = { ! {129, 2}, ! }; ! static arc arcs_54_2[1] = { {0, 2}, }; ! static state states_54[3] = { ! {4, arcs_54_0}, ! {1, arcs_54_1}, ! {1, arcs_54_2}, }; ! static arc arcs_55_0[1] = { ! {135, 1}, }; ! static arc arcs_55_1[3] = { ! {136, 1}, {29, 2}, {0, 1}, }; ! static arc arcs_55_2[1] = { ! {129, 3}, }; ! static arc arcs_55_3[1] = { {0, 3}, }; ! static state states_55[4] = { ! {1, arcs_55_0}, ! {3, arcs_55_1}, ! {1, arcs_55_2}, ! {1, arcs_55_3}, }; ! static arc arcs_56_0[7] = { {13, 1}, ! {138, 2}, ! {141, 3}, ! {144, 4}, {19, 5}, ! {146, 5}, ! {147, 6}, }; ! static arc arcs_56_1[3] = { {43, 7}, ! {137, 7}, {15, 5}, }; ! static arc arcs_56_2[2] = { ! {139, 8}, ! {140, 5}, ! }; ! static arc arcs_56_3[2] = { ! {142, 9}, ! {143, 5}, }; ! static arc arcs_56_4[1] = { ! {145, 10}, }; ! static arc arcs_56_5[1] = { {0, 5}, }; ! static arc arcs_56_6[2] = { ! {147, 6}, {0, 6}, }; ! static arc arcs_56_7[1] = { {15, 5}, }; ! static arc arcs_56_8[1] = { ! {140, 5}, }; ! static arc arcs_56_9[1] = { ! {143, 5}, }; ! static arc arcs_56_10[1] = { ! {144, 5}, }; ! static state states_56[11] = { ! {7, arcs_56_0}, {3, arcs_56_1}, ! {2, arcs_56_2}, {2, arcs_56_3}, ! {1, arcs_56_4}, ! {1, arcs_56_5}, ! {2, arcs_56_6}, ! {1, arcs_56_7}, ! {1, arcs_56_8}, ! {1, arcs_56_9}, ! {1, arcs_56_10}, }; static arc arcs_57_0[1] = { {26, 1}, }; static arc arcs_57_1[3] = { ! {148, 2}, {27, 3}, {0, 1}, }; *************** *** 1212,1364 **** {2, arcs_57_4}, }; static arc arcs_58_0[1] = { ! {148, 1}, }; ! static arc arcs_58_1[2] = { ! {23, 2}, ! {21, 3}, }; static arc arcs_58_2[1] = { ! {21, 3}, }; ! static arc arcs_58_3[1] = { {26, 4}, }; ! static arc arcs_58_4[1] = { {0, 4}, }; static state states_58[5] = { {1, arcs_58_0}, ! {2, arcs_58_1}, {1, arcs_58_2}, ! {1, arcs_58_3}, ! {1, arcs_58_4}, }; ! static arc arcs_59_0[3] = { ! {13, 1}, ! {136, 2}, ! {78, 3}, }; static arc arcs_59_1[2] = { ! {14, 4}, ! {15, 5}, }; static arc arcs_59_2[1] = { ! {149, 6}, }; static arc arcs_59_3[1] = { ! {19, 5}, }; static arc arcs_59_4[1] = { ! {15, 5}, ! }; ! static arc arcs_59_5[1] = { ! {0, 5}, ! }; ! static arc arcs_59_6[1] = { ! {138, 5}, }; ! static state states_59[7] = { ! {3, arcs_59_0}, {2, arcs_59_1}, {1, arcs_59_2}, {1, arcs_59_3}, {1, arcs_59_4}, - {1, arcs_59_5}, - {1, arcs_59_6}, }; ! static arc arcs_60_0[1] = { ! {150, 1}, }; static arc arcs_60_1[2] = { {27, 2}, {0, 1}, }; ! static arc arcs_60_2[2] = { ! {150, 1}, {0, 2}, }; ! static state states_60[3] = { ! {1, arcs_60_0}, ! {2, arcs_60_1}, ! {2, arcs_60_2}, }; ! static arc arcs_61_0[3] = { {78, 1}, {26, 2}, {21, 3}, }; ! static arc arcs_61_1[1] = { {78, 4}, }; ! static arc arcs_61_2[2] = { {21, 3}, {0, 2}, }; ! static arc arcs_61_3[3] = { {26, 5}, ! {151, 6}, {0, 3}, }; ! static arc arcs_61_4[1] = { {78, 6}, }; ! static arc arcs_61_5[2] = { ! {151, 6}, {0, 5}, }; ! static arc arcs_61_6[1] = { {0, 6}, }; ! static state states_61[7] = { ! {3, arcs_61_0}, ! {1, arcs_61_1}, ! {2, arcs_61_2}, ! {3, arcs_61_3}, ! {1, arcs_61_4}, ! {2, arcs_61_5}, ! {1, arcs_61_6}, ! }; ! static arc arcs_62_0[1] = { ! {21, 1}, ! }; ! static arc arcs_62_1[2] = { ! {26, 2}, ! {0, 1}, ! }; ! static arc arcs_62_2[1] = { ! {0, 2}, ! }; ! static state states_62[3] = { ! {1, arcs_62_0}, ! {2, arcs_62_1}, ! {1, arcs_62_2}, }; static arc arcs_63_0[1] = { ! {81, 1}, }; static arc arcs_63_1[2] = { ! {27, 2}, {0, 1}, }; ! static arc arcs_63_2[2] = { ! {81, 1}, {0, 2}, }; static state states_63[3] = { {1, arcs_63_0}, {2, arcs_63_1}, ! {2, arcs_63_2}, }; static arc arcs_64_0[1] = { ! {26, 1}, }; static arc arcs_64_1[2] = { {27, 2}, {0, 1}, }; static arc arcs_64_2[2] = { ! {26, 1}, {0, 2}, }; static state states_64[3] = { --- 1218,1380 ---- {2, arcs_57_4}, }; static arc arcs_58_0[1] = { ! {26, 1}, }; ! static arc arcs_58_1[3] = { ! {149, 2}, ! {27, 3}, ! {0, 1}, }; static arc arcs_58_2[1] = { ! {0, 2}, }; ! static arc arcs_58_3[2] = { {26, 4}, + {0, 3}, }; ! static arc arcs_58_4[2] = { ! {27, 3}, {0, 4}, }; static state states_58[5] = { {1, arcs_58_0}, ! {3, arcs_58_1}, {1, arcs_58_2}, ! {2, arcs_58_3}, ! {2, arcs_58_4}, }; ! static arc arcs_59_0[1] = { ! {150, 1}, }; static arc arcs_59_1[2] = { ! {23, 2}, ! {21, 3}, }; static arc arcs_59_2[1] = { ! {21, 3}, }; static arc arcs_59_3[1] = { ! {26, 4}, }; static arc arcs_59_4[1] = { ! {0, 4}, }; ! static state states_59[5] = { ! {1, arcs_59_0}, {2, arcs_59_1}, {1, arcs_59_2}, {1, arcs_59_3}, {1, arcs_59_4}, }; ! static arc arcs_60_0[3] = { ! {13, 1}, ! {138, 2}, ! {78, 3}, }; static arc arcs_60_1[2] = { + {14, 4}, + {15, 5}, + }; + static arc arcs_60_2[1] = { + {151, 6}, + }; + static arc arcs_60_3[1] = { + {19, 5}, + }; + static arc arcs_60_4[1] = { + {15, 5}, + }; + static arc arcs_60_5[1] = { + {0, 5}, + }; + static arc arcs_60_6[1] = { + {140, 5}, + }; + static state states_60[7] = { + {3, arcs_60_0}, + {2, arcs_60_1}, + {1, arcs_60_2}, + {1, arcs_60_3}, + {1, arcs_60_4}, + {1, arcs_60_5}, + {1, arcs_60_6}, + }; + static arc arcs_61_0[1] = { + {152, 1}, + }; + static arc arcs_61_1[2] = { {27, 2}, {0, 1}, }; ! static arc arcs_61_2[2] = { ! {152, 1}, {0, 2}, }; ! static state states_61[3] = { ! {1, arcs_61_0}, ! {2, arcs_61_1}, ! {2, arcs_61_2}, }; ! static arc arcs_62_0[3] = { {78, 1}, {26, 2}, {21, 3}, }; ! static arc arcs_62_1[1] = { {78, 4}, }; ! static arc arcs_62_2[2] = { {21, 3}, {0, 2}, }; ! static arc arcs_62_3[3] = { {26, 5}, ! {153, 6}, {0, 3}, }; ! static arc arcs_62_4[1] = { {78, 6}, }; ! static arc arcs_62_5[2] = { ! {153, 6}, {0, 5}, }; ! static arc arcs_62_6[1] = { {0, 6}, }; ! static state states_62[7] = { ! {3, arcs_62_0}, ! {1, arcs_62_1}, ! {2, arcs_62_2}, ! {3, arcs_62_3}, ! {1, arcs_62_4}, ! {2, arcs_62_5}, ! {1, arcs_62_6}, }; static arc arcs_63_0[1] = { ! {21, 1}, }; static arc arcs_63_1[2] = { ! {26, 2}, {0, 1}, }; ! static arc arcs_63_2[1] = { {0, 2}, }; static state states_63[3] = { {1, arcs_63_0}, {2, arcs_63_1}, ! {1, arcs_63_2}, }; static arc arcs_64_0[1] = { ! {81, 1}, }; static arc arcs_64_1[2] = { {27, 2}, {0, 1}, }; static arc arcs_64_2[2] = { ! {81, 1}, {0, 2}, }; static state states_64[3] = { *************** *** 1373,1401 **** {27, 2}, {0, 1}, }; ! static arc arcs_65_2[1] = { ! {26, 3}, ! }; ! static arc arcs_65_3[2] = { ! {27, 4}, ! {0, 3}, ! }; ! static arc arcs_65_4[2] = { ! {26, 3}, ! {0, 4}, }; ! static state states_65[5] = { {1, arcs_65_0}, {2, arcs_65_1}, ! {1, arcs_65_2}, ! {2, arcs_65_3}, ! {2, arcs_65_4}, }; static arc arcs_66_0[1] = { {26, 1}, }; ! static arc arcs_66_1[1] = { ! {21, 2}, }; static arc arcs_66_2[1] = { {26, 3}, --- 1389,1409 ---- {27, 2}, {0, 1}, }; ! static arc arcs_65_2[2] = { ! {26, 1}, ! {0, 2}, }; ! static state states_65[3] = { {1, arcs_65_0}, {2, arcs_65_1}, ! {2, arcs_65_2}, }; static arc arcs_66_0[1] = { {26, 1}, }; ! static arc arcs_66_1[2] = { ! {27, 2}, ! {0, 1}, }; static arc arcs_66_2[1] = { {26, 3}, *************** *** 1405,1679 **** {0, 3}, }; static arc arcs_66_4[2] = { ! {26, 1}, {0, 4}, }; static state states_66[5] = { {1, arcs_66_0}, ! {1, arcs_66_1}, {1, arcs_66_2}, {2, arcs_66_3}, {2, arcs_66_4}, }; static arc arcs_67_0[1] = { ! {153, 1}, }; static arc arcs_67_1[1] = { {19, 2}, }; ! static arc arcs_67_2[2] = { {13, 3}, {21, 4}, }; ! static arc arcs_67_3[2] = { {9, 5}, {15, 6}, }; ! static arc arcs_67_4[1] = { {22, 7}, }; ! static arc arcs_67_5[1] = { {15, 6}, }; ! static arc arcs_67_6[1] = { {21, 4}, }; ! static arc arcs_67_7[1] = { {0, 7}, }; ! static state states_67[8] = { ! {1, arcs_67_0}, ! {1, arcs_67_1}, ! {2, arcs_67_2}, ! {2, arcs_67_3}, ! {1, arcs_67_4}, ! {1, arcs_67_5}, ! {1, arcs_67_6}, ! {1, arcs_67_7}, }; ! static arc arcs_68_0[3] = { ! {154, 1}, {28, 2}, {29, 3}, }; ! static arc arcs_68_1[2] = { {27, 4}, {0, 1}, }; ! static arc arcs_68_2[1] = { {26, 5}, }; ! static arc arcs_68_3[1] = { {26, 6}, }; ! static arc arcs_68_4[4] = { ! {154, 1}, {28, 2}, {29, 3}, {0, 4}, }; ! static arc arcs_68_5[2] = { {27, 7}, {0, 5}, }; ! static arc arcs_68_6[1] = { {0, 6}, }; ! static arc arcs_68_7[1] = { {29, 3}, }; ! static state states_68[8] = { ! {3, arcs_68_0}, ! {2, arcs_68_1}, ! {1, arcs_68_2}, ! {1, arcs_68_3}, ! {4, arcs_68_4}, ! {2, arcs_68_5}, ! {1, arcs_68_6}, ! {1, arcs_68_7}, }; ! static arc arcs_69_0[1] = { {26, 1}, }; ! static arc arcs_69_1[3] = { {25, 2}, ! {147, 3}, {0, 1}, }; ! static arc arcs_69_2[1] = { {26, 4}, }; ! static arc arcs_69_3[1] = { {0, 3}, }; ! static arc arcs_69_4[2] = { ! {147, 3}, {0, 4}, }; ! static state states_69[5] = { ! {1, arcs_69_0}, ! {3, arcs_69_1}, ! {1, arcs_69_2}, ! {1, arcs_69_3}, ! {2, arcs_69_4}, }; ! static arc arcs_70_0[2] = { ! {146, 1}, ! {156, 1}, }; ! static arc arcs_70_1[1] = { {0, 1}, }; ! static state states_70[2] = { ! {2, arcs_70_0}, ! {1, arcs_70_1}, }; ! static arc arcs_71_0[1] = { ! {93, 1}, }; ! static arc arcs_71_1[1] = { {59, 2}, }; ! static arc arcs_71_2[1] = { {82, 3}, }; ! static arc arcs_71_3[1] = { ! {152, 4}, }; ! static arc arcs_71_4[2] = { ! {155, 5}, {0, 4}, }; ! static arc arcs_71_5[1] = { {0, 5}, }; ! static state states_71[6] = { ! {1, arcs_71_0}, ! {1, arcs_71_1}, ! {1, arcs_71_2}, ! {1, arcs_71_3}, ! {2, arcs_71_4}, ! {1, arcs_71_5}, }; ! static arc arcs_72_0[1] = { ! {89, 1}, }; ! static arc arcs_72_1[1] = { {26, 2}, }; ! static arc arcs_72_2[2] = { ! {155, 3}, {0, 2}, }; ! static arc arcs_72_3[1] = { {0, 3}, }; ! static state states_72[4] = { ! {1, arcs_72_0}, ! {1, arcs_72_1}, ! {2, arcs_72_2}, ! {1, arcs_72_3}, }; ! static arc arcs_73_0[2] = { ! {147, 1}, ! {158, 1}, }; ! static arc arcs_73_1[1] = { {0, 1}, }; ! static state states_73[2] = { ! {2, arcs_73_0}, ! {1, arcs_73_1}, }; ! static arc arcs_74_0[1] = { ! {93, 1}, }; ! static arc arcs_74_1[1] = { {59, 2}, }; ! static arc arcs_74_2[1] = { {82, 3}, }; ! static arc arcs_74_3[1] = { {26, 4}, }; ! static arc arcs_74_4[2] = { ! {157, 5}, {0, 4}, }; ! static arc arcs_74_5[1] = { {0, 5}, }; ! static state states_74[6] = { ! {1, arcs_74_0}, ! {1, arcs_74_1}, ! {1, arcs_74_2}, ! {1, arcs_74_3}, ! {2, arcs_74_4}, ! {1, arcs_74_5}, }; ! static arc arcs_75_0[1] = { ! {89, 1}, }; ! static arc arcs_75_1[1] = { {26, 2}, }; ! static arc arcs_75_2[2] = { ! {157, 3}, {0, 2}, }; ! static arc arcs_75_3[1] = { {0, 3}, }; ! static state states_75[4] = { ! {1, arcs_75_0}, ! {1, arcs_75_1}, ! {2, arcs_75_2}, ! {1, arcs_75_3}, }; ! static arc arcs_76_0[1] = { {26, 1}, }; ! static arc arcs_76_1[2] = { {27, 0}, {0, 1}, }; ! static state states_76[2] = { ! {1, arcs_76_0}, ! {2, arcs_76_1}, }; ! static arc arcs_77_0[1] = { {19, 1}, }; ! static arc arcs_77_1[1] = { {0, 1}, }; ! static state states_77[2] = { ! {1, arcs_77_0}, ! {1, arcs_77_1}, }; ! static arc arcs_78_0[1] = { ! {160, 1}, }; ! static arc arcs_78_1[2] = { {9, 2}, {0, 1}, }; ! static arc arcs_78_2[1] = { {0, 2}, }; ! static state states_78[3] = { ! {1, arcs_78_0}, ! {2, arcs_78_1}, ! {1, arcs_78_2}, }; ! static dfa dfas[79] = { {256, "single_input", 0, 3, states_0, ! "\004\050\014\000\000\000\000\025\074\205\011\162\000\002\000\140\010\111\023\002\001"}, {257, "file_input", 0, 2, states_1, ! "\204\050\014\000\000\000\000\025\074\205\011\162\000\002\000\140\010\111\023\002\001"}, {258, "eval_input", 0, 3, states_2, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"}, {259, "decorator", 0, 7, states_3, "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, {260, "decorators", 0, 2, states_4, --- 1413,1711 ---- {0, 3}, }; static arc arcs_66_4[2] = { ! {26, 3}, {0, 4}, }; static state states_66[5] = { {1, arcs_66_0}, ! {2, arcs_66_1}, {1, arcs_66_2}, {2, arcs_66_3}, {2, arcs_66_4}, }; static arc arcs_67_0[1] = { ! {26, 1}, }; static arc arcs_67_1[1] = { + {21, 2}, + }; + static arc arcs_67_2[1] = { + {26, 3}, + }; + static arc arcs_67_3[2] = { + {27, 4}, + {0, 3}, + }; + static arc arcs_67_4[2] = { + {26, 1}, + {0, 4}, + }; + static state states_67[5] = { + {1, arcs_67_0}, + {1, arcs_67_1}, + {1, arcs_67_2}, + {2, arcs_67_3}, + {2, arcs_67_4}, + }; + static arc arcs_68_0[1] = { + {155, 1}, + }; + static arc arcs_68_1[1] = { {19, 2}, }; ! static arc arcs_68_2[2] = { {13, 3}, {21, 4}, }; ! static arc arcs_68_3[2] = { {9, 5}, {15, 6}, }; ! static arc arcs_68_4[1] = { {22, 7}, }; ! static arc arcs_68_5[1] = { {15, 6}, }; ! static arc arcs_68_6[1] = { {21, 4}, }; ! static arc arcs_68_7[1] = { {0, 7}, }; ! static state states_68[8] = { ! {1, arcs_68_0}, ! {1, arcs_68_1}, ! {2, arcs_68_2}, ! {2, arcs_68_3}, ! {1, arcs_68_4}, ! {1, arcs_68_5}, ! {1, arcs_68_6}, ! {1, arcs_68_7}, }; ! static arc arcs_69_0[3] = { ! {156, 1}, {28, 2}, {29, 3}, }; ! static arc arcs_69_1[2] = { {27, 4}, {0, 1}, }; ! static arc arcs_69_2[1] = { {26, 5}, }; ! static arc arcs_69_3[1] = { {26, 6}, }; ! static arc arcs_69_4[4] = { ! {156, 1}, {28, 2}, {29, 3}, {0, 4}, }; ! static arc arcs_69_5[2] = { {27, 7}, {0, 5}, }; ! static arc arcs_69_6[1] = { {0, 6}, }; ! static arc arcs_69_7[1] = { {29, 3}, }; ! static state states_69[8] = { ! {3, arcs_69_0}, ! {2, arcs_69_1}, ! {1, arcs_69_2}, ! {1, arcs_69_3}, ! {4, arcs_69_4}, ! {2, arcs_69_5}, ! {1, arcs_69_6}, ! {1, arcs_69_7}, }; ! static arc arcs_70_0[1] = { {26, 1}, }; ! static arc arcs_70_1[3] = { {25, 2}, ! {149, 3}, {0, 1}, }; ! static arc arcs_70_2[1] = { {26, 4}, }; ! static arc arcs_70_3[1] = { {0, 3}, }; ! static arc arcs_70_4[2] = { ! {149, 3}, {0, 4}, }; ! static state states_70[5] = { ! {1, arcs_70_0}, ! {3, arcs_70_1}, ! {1, arcs_70_2}, ! {1, arcs_70_3}, ! {2, arcs_70_4}, }; ! static arc arcs_71_0[2] = { ! {148, 1}, ! {158, 1}, }; ! static arc arcs_71_1[1] = { {0, 1}, }; ! static state states_71[2] = { ! {2, arcs_71_0}, ! {1, arcs_71_1}, }; ! static arc arcs_72_0[1] = { ! {95, 1}, }; ! static arc arcs_72_1[1] = { {59, 2}, }; ! static arc arcs_72_2[1] = { {82, 3}, }; ! static arc arcs_72_3[1] = { ! {154, 4}, }; ! static arc arcs_72_4[2] = { ! {157, 5}, {0, 4}, }; ! static arc arcs_72_5[1] = { {0, 5}, }; ! static state states_72[6] = { ! {1, arcs_72_0}, ! {1, arcs_72_1}, ! {1, arcs_72_2}, ! {1, arcs_72_3}, ! {2, arcs_72_4}, ! {1, arcs_72_5}, }; ! static arc arcs_73_0[1] = { ! {91, 1}, }; ! static arc arcs_73_1[1] = { {26, 2}, }; ! static arc arcs_73_2[2] = { ! {157, 3}, {0, 2}, }; ! static arc arcs_73_3[1] = { {0, 3}, }; ! static state states_73[4] = { ! {1, arcs_73_0}, ! {1, arcs_73_1}, ! {2, arcs_73_2}, ! {1, arcs_73_3}, }; ! static arc arcs_74_0[2] = { ! {149, 1}, ! {160, 1}, }; ! static arc arcs_74_1[1] = { {0, 1}, }; ! static state states_74[2] = { ! {2, arcs_74_0}, ! {1, arcs_74_1}, }; ! static arc arcs_75_0[1] = { ! {95, 1}, }; ! static arc arcs_75_1[1] = { {59, 2}, }; ! static arc arcs_75_2[1] = { {82, 3}, }; ! static arc arcs_75_3[1] = { {26, 4}, }; ! static arc arcs_75_4[2] = { ! {159, 5}, {0, 4}, }; ! static arc arcs_75_5[1] = { {0, 5}, }; ! static state states_75[6] = { ! {1, arcs_75_0}, ! {1, arcs_75_1}, ! {1, arcs_75_2}, ! {1, arcs_75_3}, ! {2, arcs_75_4}, ! {1, arcs_75_5}, }; ! static arc arcs_76_0[1] = { ! {91, 1}, }; ! static arc arcs_76_1[1] = { {26, 2}, }; ! static arc arcs_76_2[2] = { ! {159, 3}, {0, 2}, }; ! static arc arcs_76_3[1] = { {0, 3}, }; ! static state states_76[4] = { ! {1, arcs_76_0}, ! {1, arcs_76_1}, ! {2, arcs_76_2}, ! {1, arcs_76_3}, }; ! static arc arcs_77_0[1] = { {26, 1}, }; ! static arc arcs_77_1[2] = { {27, 0}, {0, 1}, }; ! static state states_77[2] = { ! {1, arcs_77_0}, ! {2, arcs_77_1}, }; ! static arc arcs_78_0[1] = { {19, 1}, }; ! static arc arcs_78_1[1] = { {0, 1}, }; ! static state states_78[2] = { ! {1, arcs_78_0}, ! {1, arcs_78_1}, }; ! static arc arcs_79_0[1] = { ! {162, 1}, }; ! static arc arcs_79_1[2] = { {9, 2}, {0, 1}, }; ! static arc arcs_79_2[1] = { {0, 2}, }; ! static state states_79[3] = { ! {1, arcs_79_0}, ! {2, arcs_79_1}, ! {1, arcs_79_2}, }; ! static dfa dfas[80] = { {256, "single_input", 0, 3, states_0, ! "\004\050\014\000\000\000\000\025\074\205\051\310\001\010\000\200\041\044\115\010\004"}, {257, "file_input", 0, 2, states_1, ! "\204\050\014\000\000\000\000\025\074\205\051\310\001\010\000\200\041\044\115\010\004"}, {258, "eval_input", 0, 3, states_2, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\115\000\000"}, {259, "decorator", 0, 7, states_3, "\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, {260, "decorators", 0, 2, states_4, *************** *** 1689,1701 **** {265, "fplist", 0, 3, states_9, "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, {266, "stmt", 0, 2, states_10, ! "\000\050\014\000\000\000\000\025\074\205\011\162\000\002\000\140\010\111\023\002\001"}, {267, "simple_stmt", 0, 4, states_11, ! "\000\040\010\000\000\000\000\025\074\205\011\000\000\002\000\140\010\111\023\000\001"}, {268, "small_stmt", 0, 2, states_12, ! "\000\040\010\000\000\000\000\025\074\205\011\000\000\002\000\140\010\111\023\000\001"}, {269, "expr_stmt", 0, 6, states_13, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"}, {270, "augassign", 0, 2, states_14, "\000\000\000\000\000\360\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, {271, "print_stmt", 0, 9, states_15, --- 1721,1733 ---- {265, "fplist", 0, 3, states_9, "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, {266, "stmt", 0, 2, states_10, ! "\000\050\014\000\000\000\000\025\074\205\051\310\001\010\000\200\041\044\115\010\004"}, {267, "simple_stmt", 0, 4, states_11, ! "\000\040\010\000\000\000\000\025\074\205\011\000\000\010\000\200\041\044\115\000\004"}, {268, "small_stmt", 0, 2, states_12, ! "\000\040\010\000\000\000\000\025\074\205\011\000\000\010\000\200\041\044\115\000\004"}, {269, "expr_stmt", 0, 6, states_13, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\115\000\000"}, {270, "augassign", 0, 2, states_14, "\000\000\000\000\000\360\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, {271, "print_stmt", 0, 9, states_15, *************** *** 1705,1711 **** {273, "pass_stmt", 0, 2, states_17, "\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000"}, {274, "flow_stmt", 0, 2, states_18, ! "\000\000\000\000\000\000\000\000\074\000\000\000\000\000\000\000\000\000\000\000\001"}, {275, "break_stmt", 0, 2, states_19, "\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000"}, {276, "continue_stmt", 0, 2, states_20, --- 1737,1743 ---- {273, "pass_stmt", 0, 2, states_17, "\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000\000"}, {274, "flow_stmt", 0, 2, states_18, ! "\000\000\000\000\000\000\000\000\074\000\000\000\000\000\000\000\000\000\000\000\004"}, {275, "break_stmt", 0, 2, states_19, "\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000"}, {276, "continue_stmt", 0, 2, states_20, *************** *** 1713,1719 **** {277, "return_stmt", 0, 3, states_21, "\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000"}, {278, "yield_stmt", 0, 2, states_22, ! "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001"}, {279, "raise_stmt", 0, 7, states_23, "\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000"}, {280, "import_stmt", 0, 2, states_24, --- 1745,1751 ---- {277, "return_stmt", 0, 3, states_21, "\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000\000\000\000"}, {278, "yield_stmt", 0, 2, states_22, ! "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004"}, {279, "raise_stmt", 0, 7, states_23, "\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000"}, {280, "import_stmt", 0, 2, states_24, *************** *** 1738,1848 **** "\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000"}, {290, "assert_stmt", 0, 5, states_34, "\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000"}, ! {291, "compound_stmt", 0, 2, states_35, ! "\000\010\004\000\000\000\000\000\000\000\000\162\000\000\000\000\000\000\000\002\000"}, ! {292, "if_stmt", 0, 8, states_36, ! "\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"}, ! {293, "while_stmt", 0, 8, states_37, ! "\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000"}, ! {294, "for_stmt", 0, 10, states_38, ! "\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000"}, ! {295, "try_stmt", 0, 10, states_39, "\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"}, ! {296, "except_clause", 0, 5, states_40, ! "\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000"}, ! {297, "suite", 0, 5, states_41, ! "\004\040\010\000\000\000\000\025\074\205\011\000\000\002\000\140\010\111\023\000\001"}, ! {298, "test", 0, 4, states_42, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"}, ! {299, "and_test", 0, 2, states_43, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\003\000\000"}, ! {300, "not_test", 0, 3, states_44, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\003\000\000"}, ! {301, "comparison", 0, 2, states_45, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"}, ! {302, "comp_op", 0, 4, states_46, ! "\000\000\000\000\000\000\000\000\000\000\004\000\000\362\017\000\000\000\000\000\000"}, ! {303, "expr", 0, 2, states_47, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"}, ! {304, "xor_expr", 0, 2, states_48, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"}, ! {305, "and_expr", 0, 2, states_49, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"}, ! {306, "shift_expr", 0, 2, states_50, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"}, ! {307, "arith_expr", 0, 2, states_51, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"}, ! {308, "term", 0, 2, states_52, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"}, ! {309, "factor", 0, 3, states_53, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"}, ! {310, "power", 0, 4, states_54, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\111\003\000\000"}, ! {311, "atom", 0, 11, states_55, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\111\003\000\000"}, ! {312, "listmaker", 0, 5, states_56, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"}, ! {313, "testlist_gexp", 0, 5, states_57, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"}, ! {314, "lambdef", 0, 5, states_58, ! "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\020\000\000"}, ! {315, "trailer", 0, 7, states_59, ! "\000\040\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\001\000\000\000"}, ! {316, "subscriptlist", 0, 3, states_60, ! "\000\040\050\000\000\000\000\000\000\100\000\000\000\002\000\140\010\111\023\000\000"}, ! {317, "subscript", 0, 7, states_61, ! "\000\040\050\000\000\000\000\000\000\100\000\000\000\002\000\140\010\111\023\000\000"}, ! {318, "sliceop", 0, 3, states_62, "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, ! {319, "exprlist", 0, 3, states_63, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\140\010\111\003\000\000"}, ! {320, "testlist", 0, 3, states_64, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"}, ! {321, "testlist_safe", 0, 5, states_65, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"}, ! {322, "dictmaker", 0, 5, states_66, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"}, ! {323, "classdef", 0, 8, states_67, ! "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000"}, ! {324, "arglist", 0, 8, states_68, ! "\000\040\010\060\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"}, ! {325, "argument", 0, 5, states_69, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"}, ! {326, "list_iter", 0, 2, states_70, ! "\000\000\000\000\000\000\000\000\000\000\000\042\000\000\000\000\000\000\000\000\000"}, ! {327, "list_for", 0, 6, states_71, ! "\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000"}, ! {328, "list_if", 0, 4, states_72, ! "\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"}, ! {329, "gen_iter", 0, 2, states_73, ! "\000\000\000\000\000\000\000\000\000\000\000\042\000\000\000\000\000\000\000\000\000"}, ! {330, "gen_for", 0, 6, states_74, ! "\000\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000"}, ! {331, "gen_if", 0, 4, states_75, ! "\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"}, ! {332, "testlist1", 0, 2, states_76, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\002\000\140\010\111\023\000\000"}, ! {333, "encoding_decl", 0, 2, states_77, "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, ! {334, "yield_expr", 0, 3, states_78, ! "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001"}, }; ! static label labels[161] = { {0, "EMPTY"}, {256, 0}, {4, 0}, {267, 0}, ! {291, 0}, {257, 0}, {266, 0}, {0, 0}, {258, 0}, ! {320, 0}, {259, 0}, {50, 0}, {287, 0}, {7, 0}, ! {324, 0}, {8, 0}, {260, 0}, {261, 0}, --- 1770,1882 ---- "\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000"}, {290, "assert_stmt", 0, 5, states_34, "\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000\000"}, ! {291, "with_stmt", 0, 7, states_35, ! "\000\000\000\000\000\000\000\000\000\000\040\000\000\000\000\000\000\000\000\000\000"}, ! {292, "compound_stmt", 0, 2, states_36, ! "\000\010\004\000\000\000\000\000\000\000\040\310\001\000\000\000\000\000\000\010\000"}, ! {293, "if_stmt", 0, 8, states_37, ! "\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000"}, ! {294, "while_stmt", 0, 8, states_38, "\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"}, ! {295, "for_stmt", 0, 10, states_39, ! "\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000"}, ! {296, "try_stmt", 0, 10, states_40, ! "\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000"}, ! {297, "except_clause", 0, 5, states_41, ! "\000\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000"}, ! {298, "suite", 0, 5, states_42, ! "\004\040\010\000\000\000\000\025\074\205\011\000\000\010\000\200\041\044\115\000\004"}, ! {299, "test", 0, 4, states_43, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\115\000\000"}, ! {300, "and_test", 0, 2, states_44, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\015\000\000"}, ! {301, "not_test", 0, 3, states_45, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\015\000\000"}, ! {302, "comparison", 0, 2, states_46, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"}, ! {303, "comp_op", 0, 4, states_47, ! "\000\000\000\000\000\000\000\000\000\000\004\000\000\310\077\000\000\000\000\000\000"}, ! {304, "expr", 0, 2, states_48, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"}, ! {305, "xor_expr", 0, 2, states_49, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"}, ! {306, "and_expr", 0, 2, states_50, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"}, ! {307, "shift_expr", 0, 2, states_51, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"}, ! {308, "arith_expr", 0, 2, states_52, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"}, ! {309, "term", 0, 2, states_53, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"}, ! {310, "factor", 0, 3, states_54, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"}, ! {311, "power", 0, 4, states_55, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\044\015\000\000"}, ! {312, "atom", 0, 11, states_56, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\044\015\000\000"}, ! {313, "listmaker", 0, 5, states_57, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\115\000\000"}, ! {314, "testlist_gexp", 0, 5, states_58, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\115\000\000"}, ! {315, "lambdef", 0, 5, states_59, ! "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\100\000\000"}, ! {316, "trailer", 0, 7, states_60, ! "\000\040\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\004\000\000\000"}, ! {317, "subscriptlist", 0, 3, states_61, ! "\000\040\050\000\000\000\000\000\000\100\000\000\000\010\000\200\041\044\115\000\000"}, ! {318, "subscript", 0, 7, states_62, ! "\000\040\050\000\000\000\000\000\000\100\000\000\000\010\000\200\041\044\115\000\000"}, ! {319, "sliceop", 0, 3, states_63, "\000\000\040\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, ! {320, "exprlist", 0, 3, states_64, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\000\000\200\041\044\015\000\000"}, ! {321, "testlist", 0, 3, states_65, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\115\000\000"}, ! {322, "testlist_safe", 0, 5, states_66, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\115\000\000"}, ! {323, "dictmaker", 0, 5, states_67, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\115\000\000"}, ! {324, "classdef", 0, 8, states_68, ! "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\010\000"}, ! {325, "arglist", 0, 8, states_69, ! "\000\040\010\060\000\000\000\000\000\000\000\000\000\010\000\200\041\044\115\000\000"}, ! {326, "argument", 0, 5, states_70, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\115\000\000"}, ! {327, "list_iter", 0, 2, states_71, ! "\000\000\000\000\000\000\000\000\000\000\000\210\000\000\000\000\000\000\000\000\000"}, ! {328, "list_for", 0, 6, states_72, ! "\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000"}, ! {329, "list_if", 0, 4, states_73, ! "\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000"}, ! {330, "gen_iter", 0, 2, states_74, ! "\000\000\000\000\000\000\000\000\000\000\000\210\000\000\000\000\000\000\000\000\000"}, ! {331, "gen_for", 0, 6, states_75, ! "\000\000\000\000\000\000\000\000\000\000\000\200\000\000\000\000\000\000\000\000\000"}, ! {332, "gen_if", 0, 4, states_76, ! "\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000\000"}, ! {333, "testlist1", 0, 2, states_77, ! "\000\040\010\000\000\000\000\000\000\000\000\000\000\010\000\200\041\044\115\000\000"}, ! {334, "encoding_decl", 0, 2, states_78, "\000\000\010\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"}, ! {335, "yield_expr", 0, 3, states_79, ! "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004"}, }; ! static label labels[163] = { {0, "EMPTY"}, {256, 0}, {4, 0}, {267, 0}, ! {292, 0}, {257, 0}, {266, 0}, {0, 0}, {258, 0}, ! {321, 0}, {259, 0}, {50, 0}, {287, 0}, {7, 0}, ! {325, 0}, {8, 0}, {260, 0}, {261, 0}, *************** *** 1850,1860 **** {1, 0}, {262, 0}, {11, 0}, ! {297, 0}, {263, 0}, {264, 0}, {22, 0}, ! {298, 0}, {12, 0}, {16, 0}, {36, 0}, --- 1884,1894 ---- {1, 0}, {262, 0}, {11, 0}, ! {298, 0}, {263, 0}, {264, 0}, {22, 0}, ! {299, 0}, {12, 0}, {16, 0}, {36, 0}, *************** *** 1871,1877 **** {289, 0}, {290, 0}, {270, 0}, ! {334, 0}, {37, 0}, {38, 0}, {39, 0}, --- 1905,1911 ---- {289, 0}, {290, 0}, {270, 0}, ! {335, 0}, {37, 0}, {38, 0}, {39, 0}, *************** *** 1887,1893 **** {1, "print"}, {35, 0}, {1, "del"}, ! {319, 0}, {1, "pass"}, {275, 0}, {276, 0}, --- 1921,1927 ---- {1, "print"}, {35, 0}, {1, "del"}, ! {320, 0}, {1, "pass"}, {275, 0}, {276, 0}, *************** *** 1909,1941 **** {23, 0}, {1, "global"}, {1, "exec"}, ! {303, 0}, {1, "in"}, {1, "assert"}, ! {292, 0}, {293, 0}, {294, 0}, {295, 0}, ! {323, 0}, {1, "if"}, {1, "elif"}, {1, "else"}, {1, "while"}, {1, "for"}, {1, "try"}, ! {296, 0}, {1, "finally"}, {1, "except"}, {5, 0}, {6, 0}, - {299, 0}, - {1, "or"}, - {314, 0}, {300, 0}, {1, "and"}, {1, "not"}, - {301, 0}, {302, 0}, {20, 0}, {21, 0}, {28, 0}, --- 1943,1977 ---- {23, 0}, {1, "global"}, {1, "exec"}, ! {304, 0}, {1, "in"}, {1, "assert"}, ! {291, 0}, ! {1, "with"}, {293, 0}, {294, 0}, {295, 0}, ! {296, 0}, ! {324, 0}, {1, "if"}, {1, "elif"}, {1, "else"}, {1, "while"}, {1, "for"}, {1, "try"}, ! {297, 0}, {1, "finally"}, {1, "except"}, {5, 0}, {6, 0}, {300, 0}, + {1, "or"}, + {315, 0}, + {301, 0}, {1, "and"}, {1, "not"}, {302, 0}, + {303, 0}, {20, 0}, {21, 0}, {28, 0}, *************** *** 1944,1998 **** {29, 0}, {29, 0}, {1, "is"}, - {304, 0}, - {18, 0}, {305, 0}, ! {33, 0}, {306, 0}, ! {19, 0}, {307, 0}, ! {34, 0}, {308, 0}, {14, 0}, {15, 0}, ! {309, 0}, {17, 0}, {24, 0}, {48, 0}, {32, 0}, - {310, 0}, {311, 0}, - {315, 0}, - {313, 0}, - {9, 0}, {312, 0}, {10, 0}, {26, 0}, ! {322, 0}, {27, 0}, {25, 0}, ! {332, 0}, {2, 0}, {3, 0}, ! {327, 0}, ! {330, 0}, {1, "lambda"}, - {316, 0}, {317, 0}, {318, 0}, ! {321, 0}, {1, "class"}, - {325, 0}, {326, 0}, ! {328, 0}, {329, 0}, ! {331, 0}, ! {333, 0}, {1, "yield"}, }; grammar _PyParser_Grammar = { ! 79, dfas, ! {161, labels}, 256 }; --- 1980,2034 ---- {29, 0}, {29, 0}, {1, "is"}, {305, 0}, ! {18, 0}, {306, 0}, ! {33, 0}, {307, 0}, ! {19, 0}, {308, 0}, + {34, 0}, + {309, 0}, {14, 0}, {15, 0}, ! {310, 0}, {17, 0}, {24, 0}, {48, 0}, {32, 0}, {311, 0}, {312, 0}, + {316, 0}, + {314, 0}, + {9, 0}, + {313, 0}, {10, 0}, {26, 0}, ! {323, 0}, {27, 0}, {25, 0}, ! {333, 0}, {2, 0}, {3, 0}, ! {328, 0}, ! {331, 0}, {1, "lambda"}, {317, 0}, {318, 0}, ! {319, 0}, ! {322, 0}, {1, "class"}, {326, 0}, ! {327, 0}, {329, 0}, ! {330, 0}, ! {332, 0}, ! {334, 0}, {1, "yield"}, }; grammar _PyParser_Grammar = { ! 80, dfas, ! {163, labels}, 256 }; Index: Tools/compiler/ast.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/ast.txt,v retrieving revision 1.6 diff -c -r1.6 ast.txt *** Tools/compiler/ast.txt 2 Aug 2004 06:10:11 -0000 1.6 --- Tools/compiler/ast.txt 2 Aug 2005 13:41:09 -0000 *************** *** 22,27 **** --- 22,28 ---- From: modname*, names* Import: names* Raise: expr1&, expr2&, expr3& + With: expr, var*, body TryFinally: body, final TryExcept: body, handlers!, else_& Return: value