@@ -38,7 +38,7 @@ class InvalidModuleError(Exception):
3838class InvalidStringIntError (Exception ):
3939 pass
4040
41- class Error (Exception ):
41+ class TemplateError (Exception ):
4242 pass
4343
4444allvars = {}
@@ -52,6 +52,7 @@ class Error(Exception):
5252input1 = "Undefined input"
5353input2 = "Undefined input"
5454input3 = "Undefined input"
55+ functions = ["time.time(" , "os.system(" , "os.userinfo(" ,"time.sleep(" ,"time.strftime(" ,"window.alert(" ,"console.print(" ,"alert(" ,"console.input(" ,"window.prompt(" ,"prompt(" ,"if " ]
5556
5657
5758def timeTIME ():
@@ -91,7 +92,7 @@ def osSYSTEM():
9192
9293 #print(res)
9394 try :
94- os .system (f" { res } " )
95+ os .system (str ( res ) )
9596 except :
9697 raise InvalidModuleError (f"'{ res } ' command doesn't exist!" )
9798 else :
@@ -372,14 +373,57 @@ def CONSOLEprint():
372373 #newvar = variable;
373374 if newvar [- 1 ] == ";" :
374375 if ";" in newvar [:- 1 ]:
375- raise InvalidSyntaxError ("You must only include one semi-colon!" )
376+ for i in newvar [:- 1 ]:
377+ if "'" == i or "\" " == i or "`" == i :
378+ pass
379+ else :
380+ raise InvalidSyntaxError ("You must only include one semi-colon!" )
376381 else :
377382 newvarTEST = newvar [- 1 ]
378383 newvar = newvar .replace (";" ,"" )#make ; disappear into blank space
379384 else :
380385 raise InvalidSyntaxError ("Variable statement is missing semi-colon!" )
386+
381387 if " " in newvar :
382- raise InvalidSyntaxError ("Variables cannot include spaces!" )
388+ if "=" in newvar :
389+ idk = []
390+ Continue = True
391+ for i in newvar :
392+ if Continue :
393+ if i == "=" :
394+ idk .append (i )
395+ Continue = False
396+ else :
397+ idk .append (i )
398+ else :
399+ if i == " " :
400+ idk .append (i )
401+ break
402+ else :
403+ break
404+ idk = "" .join (idk )
405+ newvar = newvar .replace (idk , "" )
406+
407+ if "'" in newvar or "\" " in newvar or "`" in newvar :
408+ if newvar in functions :
409+ e
410+ else :
411+ newvar = str (newvar ) # makes sure its a string
412+ if newvar [- 1 ] == "'" and newvar [0 ] == "'" or newvar [- 1 ] == "\" " and newvar [0 ] == "\" " or newvar [- 1 ] == "`" and newvar [0 ] == "`" :
413+ newvar = newvar .replace (newvar [- 1 ], "" )
414+ #newvar = newvar.replace(newvar[0], "")
415+ else :
416+ raise InvalidSyntaxError ("Starting quotations and end quotations must be the same!" )
417+ allvars [newvar ] = newvar
418+ elif newvar == "true" :
419+ allvars [newvar ] = True
420+ elif newvar == "false" :
421+ allvars [newvar ] = False
422+
423+ else :
424+ raise InvalidSyntaxError ("Variables must be named after there is a equal sign!" )
425+ else :
426+ raise InvalidSyntaxError ("Variables cannot include spaces!" )
383427 else :
384428 allvars [newvar ] = 0
385429
@@ -488,6 +532,8 @@ def CONSOLEprint():
488532 alert ()
489533
490534
535+ elif "if " in lines :
536+ e
491537
492538
493539 elif "time.sleep(" in lines :
@@ -522,9 +568,8 @@ def CONSOLEprint():
522568 elif "os.system(" in lines :
523569 osSYSTEM ()
524570
525- elif "os.environ[" in lines :
526- osENVIRON ()
527- #pass #the function above doesnt even do anything.
571+ elif "os.userinfo(" in lines :
572+ osUSERINFO ()
528573
529574
530575
0 commit comments