Debian Codegraph @

rpython/jit/tl/tiny1.py

raw symbols SCIP
1 from rpython.rlib.jit import hint
2
3
4 def ll_plus_minus(s, x, y):
5 acc = x
6 pc = 0
7 while pc < len(s):
8 op = s[pc]
9 hint(op, concrete=True)
10 if op == '+':
11 acc += y
12 elif op == '-':
13 acc -= y
14 pc += 1
15 return acc
16
17
18 def test_simple():
19 res = ll_plus_minus("+-++", 100, 10)
20 assert res == 120