Skip to content

Commit 7a473d6

Browse files
FIRST_NAME LAST_NAMEFIRST_NAME LAST_NAME
authored andcommitted
HUGE UPDATE!!!!
1 parent 78e5dfa commit 7a473d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+316
-243
lines changed

robloxpyc/__communication__/cfg.pkl

32 Bytes
Binary file not shown.

robloxpyc/__communication__/ts.json

Whitespace-only changes.

robloxpyc/basecompilers.py

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414

1515

1616

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

6059
return 0
60+
else:
61+
print(error("C is not enabled, please enable it in the config."))
62+
if pluscount:
63+
#pluscount.error()
64+
pluscount.update(1)
65+
pluscount.current += 1
66+
#global count
67+
#count += 1
68+
return 0
6169
def ccompile(r, file, pluscount=False):
62-
if file.endswith(".c"):
70+
if file.endswith(".c") and os.environ.get("ENABLE_BETA_RPYC") == True:
6371
# compile the file to a file with the same name and path but .lua
6472
try:
6573
newctranslator = parser.CodeConverter(file, getconfig("c", "dynamiclibpath", "None"))
@@ -102,6 +110,15 @@ def ccompile(r, file, pluscount=False):
102110
#global count
103111
#count += 1
104112
return 0
113+
else:
114+
print(error("C is not enabled, please enable it in the config."))
115+
if pluscount:
116+
#pluscount.error()
117+
pluscount.update(1)
118+
pluscount.current += 1
119+
#global count
120+
#count += 1
121+
return 0
105122
def pycompile(r, file, pluscount=False):
106123
# compile the file to a file with the same name and path but .lua
107124
contents = ""
@@ -180,8 +197,7 @@ def lunarcompile(r, file, pluscount=False):
180197
#print(colortext.green("Compiled "+os.path.join(r, file)))
181198
with open(os.path.join(r, file.replace(".moon", ".lua")), "r") as f:
182199
contents = f.read()
183-
with open(os.path.join(r, file.replace(".moon", ".lua")), "w") as f:
184-
f.write(newheader+contents+header.pyfooter)
200+
contents = backwordreplace(contents, "return", "", 1)
185201

186202
else:
187203
print(error("File error for "+os.path.join(r, file)+"!"))
@@ -219,3 +235,16 @@ def robloxtscompile(r, file, pluscount=False):
219235
#global count
220236
#count += 1
221237
return 0
238+
def allcompile(r, file, pluscount):
239+
# Checks what file it is then redirects to the correct compiler
240+
if file.endswith(".py"):
241+
pycompile(r, file, pluscount)
242+
elif file.endswith(".moon"):
243+
lunarcompile(r, file, pluscount)
244+
elif file.endswith(".c"):
245+
ccompile(r, file, pluscount)
246+
elif file.endswith(".cpp"):
247+
cppcompile(r, file, pluscount)
248+
elif file.endswith(".ts"):
249+
robloxtscompile(r, file, pluscount)
250+

robloxpyc/binopdesc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
def addfunc(left, right):
88
# check if left and right have anything other than 0-9
99
# left and right are name objects, so we need to get the id
10-
if (not isinstance(left.left, ast.Num) or not isinstance(right.right, ast.Num)):
10+
if (not isinstance(left, ast.Num) or not isinstance(right, ast.Num)):
1111
return "safeadd({left}, {right})"
1212
else :
1313
return "{left} + {right}"

0 commit comments

Comments
 (0)