| 1 |
from pypy.interpreter.mixedmodule import MixedModule |
| 2 |
from pypy.interpreter.astcompiler import ast, consts |
| 3 |
|
| 4 |
|
| 5 |
class Module(MixedModule): |
| 6 |
|
| 7 |
interpleveldefs = { |
| 8 |
"PyCF_ONLY_AST" : "space.wrap(%s)" % consts.PyCF_ONLY_AST, |
| 9 |
"PyCF_TYPE_COMMENTS" : "space.wrap(%s)" % consts.PyCF_TYPE_COMMENTS, |
| 10 |
"PyCF_ALLOW_TOP_LEVEL_AWAIT" : "space.wrap(%s)" % consts.PyCF_ALLOW_TOP_LEVEL_AWAIT, |
| 11 |
"PyCF_ACCEPT_NULL_BYTES": |
| 12 |
"space.wrap(%s)" % consts.PyCF_ACCEPT_NULL_BYTES, |
| 13 |
"PyCF_IGNORE_COOKIE": |
| 14 |
"space.wrap(%s)" % consts.PyCF_IGNORE_COOKIE, |
| 15 |
"__version__" : "space.wrap('82160')", |
| 16 |
} |
| 17 |
appleveldefs = {} |
| 18 |
|
| 19 |
|
| 20 |
def _setup(): |
| 21 |
defs = Module.interpleveldefs |
| 22 |
defs['AST'] = "pypy.interpreter.astcompiler.ast.get(space).w_AST" |
| 23 |
for tup in ast.State.AST_TYPES: |
| 24 |
name = tup[0] |
| 25 |
defs[name] = "pypy.interpreter.astcompiler.ast.get(space).w_" + name |
| 26 |
_setup() |