Adding small fixes for the Code Transpiler.
This commit is contained in:
parent
881456b2ca
commit
dbeb3cd689
@ -3,4 +3,4 @@ cd "%DIR%"
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
rm -rf temp
|
rm -rf temp
|
||||||
nope-py-prepare-code --input dist-py --output temp --type js --convert_snake_case
|
nope-py-prepare-code --input dist-py --output temp --type js
|
@ -7,4 +7,4 @@ cd "$( dirname -- "$0"; )"
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
rm -rf temp
|
rm -rf temp
|
||||||
nope-py-prepare-code --input dist-py --output temp --type js --convert_snake_case
|
nope-py-prepare-code --input dist-py --output temp --type js
|
@ -31,6 +31,6 @@ def define_dotted_dict(type= "name"):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if (type == "name"):
|
if (type == "name"):
|
||||||
return _ast.Name(id= "dotted_dict")
|
return _ast.Name(id= "ensureDottedAccess")
|
||||||
|
|
||||||
return ast.parse(CODE).body[0]
|
return ast.parse(CODE).body[0]
|
@ -367,7 +367,8 @@ class CodeTransformeJs(Transformer):
|
|||||||
def start(self, items):
|
def start(self, items):
|
||||||
self._log("start", items)
|
self._log("start", items)
|
||||||
body = self.body(items)
|
body = self.body(items)
|
||||||
body.insert(0, define_dotted_dict("ast"))
|
# We dont want to add our custom class.
|
||||||
|
# body.insert(0, define_dotted_dict("ast"))
|
||||||
return _ast.Module(body=body)
|
return _ast.Module(body=body)
|
||||||
|
|
||||||
def return_statement(self, items):
|
def return_statement(self, items):
|
||||||
|
@ -24,7 +24,9 @@ replacers = {
|
|||||||
'undefined': "None",
|
'undefined': "None",
|
||||||
'self = self': "",
|
'self = self': "",
|
||||||
"__definition_of__": "",
|
"__definition_of__": "",
|
||||||
"@property()": "@property",
|
"@property()": "@property",
|
||||||
|
".entries()": ".items()",
|
||||||
|
"${": "{",
|
||||||
}
|
}
|
||||||
|
|
||||||
def post_process(code: str) -> str:
|
def post_process(code: str) -> str:
|
||||||
|
Loading…
Reference in New Issue
Block a user