19 lines
328 B
Python
19 lines
328 B
Python
"""
|
|
Utility functions
|
|
"""
|
|
|
|
import ast
|
|
|
|
from py2wasm.python import Visitor
|
|
|
|
def process(source: str, input_name: str) -> str:
|
|
"""
|
|
Processes the python code into web assembly code
|
|
"""
|
|
res = ast.parse(source, input_name)
|
|
|
|
visitor = Visitor()
|
|
module = visitor.visit_Module(res)
|
|
|
|
return module.generate()
|