<s> from pypy . rlib . jit import hint <EOL> def ll_plus_minus ( s , x , y ) : <EOL> acc = x <EOL> pc = <NUM_LIT:0> <EOL> while pc < len ( s ) : <EOL> op = s [ pc ] <EOL> hint ( op , concrete = True ) <EOL> if op == '<STR_LIT:+>' : <EOL> acc += y <EOL> elif op == '<STR_LIT:->' : <EOL> acc -= y <EOL> pc += <NUM_LIT:1> <EOL> return acc <EOL> def test_simple ( ) : <EOL> res = ll_plus_minus ( "<STR_LIT>" , <NUM_LIT:100> , <NUM_LIT:10> ) <EOL> assert res == <NUM_LIT> </s>
