rustpython 0.1.0

A python interpreter written in rust.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from testutils import assertRaises

src = """
def valid_func():
    pass

yield 2
"""

try:
    compile(src, 'test.py', 'exec')
except SyntaxError as ex:
    assert ex.lineno == 5
else:
    raise AssertionError("Must throw syntax error")

with assertRaises(SyntaxError):
    compile('0xX', 'test.py', 'exec')