Skip to content

Commit

Permalink
HUGE UPDATE!!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
FIRST_NAME LAST_NAME authored and FIRST_NAME LAST_NAME committed Jul 29, 2023
1 parent 78e5dfa commit 7a473d6
Show file tree
Hide file tree
Showing 43 changed files with 316 additions and 243 deletions.
Binary file modified robloxpyc/__communication__/cfg.pkl
Binary file not shown.
Empty file.
39 changes: 34 additions & 5 deletions robloxpyc/basecompilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@




def cppcompile(r, file, pluscount=False):
if file.endswith(".cpp"):
if file.endswith(".cpp") and os.environ.get("ENABLE_BETA_RPYC") == True:
# compile the file to a file with the same name and path but .lua
try:
newctranslator = parser.CodeConverter(file, getconfig("c", "dynamiclibpath", "None"))
Expand Down Expand Up @@ -58,8 +57,17 @@ def cppcompile(r, file, pluscount=False):
#count += 1

return 0
else:
print(error("C is not enabled, please enable it in the config."))
if pluscount:
#pluscount.error()
pluscount.update(1)
pluscount.current += 1
#global count
#count += 1
return 0
def ccompile(r, file, pluscount=False):
if file.endswith(".c"):
if file.endswith(".c") and os.environ.get("ENABLE_BETA_RPYC") == True:
# compile the file to a file with the same name and path but .lua
try:
newctranslator = parser.CodeConverter(file, getconfig("c", "dynamiclibpath", "None"))
Expand Down Expand Up @@ -102,6 +110,15 @@ def ccompile(r, file, pluscount=False):
#global count
#count += 1
return 0
else:
print(error("C is not enabled, please enable it in the config."))
if pluscount:
#pluscount.error()
pluscount.update(1)
pluscount.current += 1
#global count
#count += 1
return 0
def pycompile(r, file, pluscount=False):
# compile the file to a file with the same name and path but .lua
contents = ""
Expand Down Expand Up @@ -180,8 +197,7 @@ def lunarcompile(r, file, pluscount=False):
#print(colortext.green("Compiled "+os.path.join(r, file)))
with open(os.path.join(r, file.replace(".moon", ".lua")), "r") as f:
contents = f.read()
with open(os.path.join(r, file.replace(".moon", ".lua")), "w") as f:
f.write(newheader+contents+header.pyfooter)
contents = backwordreplace(contents, "return", "", 1)

else:
print(error("File error for "+os.path.join(r, file)+"!"))
Expand Down Expand Up @@ -219,3 +235,16 @@ def robloxtscompile(r, file, pluscount=False):
#global count
#count += 1
return 0
def allcompile(r, file, pluscount):
# Checks what file it is then redirects to the correct compiler
if file.endswith(".py"):
pycompile(r, file, pluscount)
elif file.endswith(".moon"):
lunarcompile(r, file, pluscount)
elif file.endswith(".c"):
ccompile(r, file, pluscount)
elif file.endswith(".cpp"):
cppcompile(r, file, pluscount)
elif file.endswith(".ts"):
robloxtscompile(r, file, pluscount)

2 changes: 1 addition & 1 deletion robloxpyc/binopdesc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
def addfunc(left, right):
# check if left and right have anything other than 0-9
# left and right are name objects, so we need to get the id
if (not isinstance(left.left, ast.Num) or not isinstance(right.right, ast.Num)):
if (not isinstance(left, ast.Num) or not isinstance(right, ast.Num)):
return "safeadd({left}, {right})"
else :
return "{left} + {right}"
Expand Down
Loading

0 comments on commit 7a473d6

Please sign in to comment.