<s> import sys <EOL> sys . path . insert ( <NUM_LIT:0> , "<STR_LIT>" ) <EOL> if sys . version_info [ <NUM_LIT:0> ] >= <NUM_LIT:3> : <EOL> raw_input = input <EOL> import basiclex <EOL> import basparse <EOL> import basinterp <EOL> if len ( sys . argv ) == <NUM_LIT:2> : <EOL> data = open ( sys . argv [ <NUM_LIT:1> ] ) . read ( ) <EOL> prog = basparse . parse ( data ) <EOL> if not prog : raise SystemExit <EOL> b = basinterp . BasicInterpreter ( prog ) <EOL> try : <EOL> b . run ( ) <EOL> raise SystemExit <EOL> except RuntimeError : <EOL> pass <EOL> else : <EOL> b = basinterp . BasicInterpreter ( { } ) <EOL> while <NUM_LIT:1> : <EOL> try : <EOL> line = raw_input ( "<STR_LIT>" ) <EOL> except EOFError : <EOL> raise SystemExit <EOL> if not line : continue <EOL> line += "<STR_LIT:\n>" <EOL> prog = basparse . parse ( line ) <EOL> if not prog : continue <EOL> keys = list ( prog ) <EOL> if keys [ <NUM_LIT:0> ] > <NUM_LIT:0> : <EOL> b . add_statements ( prog ) <EOL> else : <EOL> stat = prog [ keys [ <NUM_LIT:0> ] ] <EOL> if stat [ <NUM_LIT:0> ] == '<STR_LIT>' : <EOL> try : <EOL> b . run ( ) <EOL> except RuntimeError : <EOL> pass <EOL> elif stat [ <NUM_LIT:0> ] == '<STR_LIT>' : <EOL> b . list ( ) <EOL> elif stat [ <NUM_LIT:0> ] == '<STR_LIT>' : <EOL> b . del_line ( stat [ <NUM_LIT:1> ] ) <EOL> elif stat [ <NUM_LIT:0> ] == '<STR_LIT>' : <EOL> b . new ( ) </s>
