Skip to content

Commit

Permalink
fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMaster1127 committed Jun 26, 2024
1 parent 94516ce commit c7a4fc7
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 54 deletions.
33 changes: 30 additions & 3 deletions HTH-Playground.hth
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,40 @@ outOftranspileVariables := StrReplace(outOftranspileVariables, "cyiasasasasstAYt

;OutputDebug, %outOftranspileVariables%

outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.true", "true")

; Check and replace "variables.false"
if (SubStr(outOftranspileVariables, -14) = "variables.false")
{
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.false", "false")
}
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.false ", "false ")

; Check and replace "variables.if"
if (SubStr(outOftranspileVariables, -11) = "variables.if")
{
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.if", "if")
}
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.if ", "if ")

; Check and replace "variables.else"
if (SubStr(outOftranspileVariables, -13) = "variables.else")
{
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.else", "else")
}
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.else ", "else ")


; Check and replace "variables.true"
if (SubStr(outOftranspileVariables, -13) = "variables.true")
{
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.true", "true")
}

outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.true ", "true ")


outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.and", "&&")
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.or", "||")
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.and ", "&& ")
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.or ", "|| ")


outOftranspileVariables := StrReplace(outOftranspileVariables, " = ", " == ")
Expand Down
33 changes: 30 additions & 3 deletions HTH.htpy
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,40 @@ outOftranspileVariables := StrReplace(outOftranspileVariables, "cyiasasasasstAYt

;OutputDebug, %outOftranspileVariables%

outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.true", "true")

; Check and replace "variables.false"
if (SubStr(outOftranspileVariables, -14) = "variables.false")
{
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.false", "false")
}
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.false ", "false ")

; Check and replace "variables.if"
if (SubStr(outOftranspileVariables, -11) = "variables.if")
{
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.if", "if")
}
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.if ", "if ")

; Check and replace "variables.else"
if (SubStr(outOftranspileVariables, -13) = "variables.else")
{
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.else", "else")
}
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.else ", "else ")


; Check and replace "variables.true"
if (SubStr(outOftranspileVariables, -13) = "variables.true")
{
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.true", "true")
}

outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.true ", "true ")


outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.and", "&&")
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.or", "||")
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.and ", "&& ")
outOftranspileVariables := StrReplace(outOftranspileVariables, "variables.or ", "|| ")


outOftranspileVariables := StrReplace(outOftranspileVariables, " = ", " == ")
Expand Down
25 changes: 18 additions & 7 deletions HTH.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,24 @@ def transpileVariables(sstr123455, functionNames):
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , Chr(92) + Chr(92), Chr(96))
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "cyiasasasasstAYtheummonlyemlpystringya-a-" + Chr(100), Chr(34) + Chr(34))
#OutputDebug, %outOftranspileVariables%
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.true" , "true")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.false" , "false")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.if" , "if")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.else" , "else")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.and" , "&&")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.or" , "||")
# Check and replace "variables.false"
if (SubStr(variables['outOftranspileVariables'] , -14)== "variables.false"):
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.false" , "false")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.false " , "false ")
# Check and replace "variables.if"
if (SubStr(variables['outOftranspileVariables'] , -11)== "variables.if"):
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.if" , "if")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.if " , "if ")
# Check and replace "variables.else"
if (SubStr(variables['outOftranspileVariables'] , -13)== "variables.else"):
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.else" , "else")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.else " , "else ")
# Check and replace "variables.true"
if (SubStr(variables['outOftranspileVariables'] , -13)== "variables.true"):
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.true" , "true")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.true " , "true ")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.and " , "&& ")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , "variables.or " , "|| ")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , " = " , " == ")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , " = " , " == ")
variables['outOftranspileVariables'] = StrReplace(variables['outOftranspileVariables'] , " ( " , " (")
Expand Down Expand Up @@ -3516,4 +3528,3 @@ def compiler():
FileDelete("" + variables['filePathOfCode'] + "")
FileAppend("" + variables['jsCodeOut'] + "", "" + variables['filePathOfCode'] + "")
print("Transpiled!")

Loading

0 comments on commit c7a4fc7

Please sign in to comment.