feat: dotchain

This commit is contained in:
2024-08-01 11:33:09 +08:00
parent abb5195e55
commit bbf3fe2909
16 changed files with 1571 additions and 13 deletions

16
src/dotchain/main.py Normal file
View File

@ -0,0 +1,16 @@
from runtime.interpreter import program_parser
from runtime.runtime import Runtime
from runtime.tokenizer import Tokenizer
script = """
print(hello);
"""
if __name__ == "__main__":
t = Tokenizer()
t.init(script)
runtime = Runtime(context={"hello": [1,2,3,4], "good": "123"} ,exteral_fun={"print": print})
ast = program_parser(t)
result = ast.exec(runtime)