@@ -38,7 +38,7 @@ class InvalidModuleError(Exception):
38
38
class InvalidStringIntError (Exception ):
39
39
pass
40
40
41
- class Error (Exception ):
41
+ class TemplateError (Exception ):
42
42
pass
43
43
44
44
allvars = {}
@@ -52,6 +52,7 @@ class Error(Exception):
52
52
input1 = "Undefined input"
53
53
input2 = "Undefined input"
54
54
input3 = "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 " ]
55
56
56
57
57
58
def timeTIME ():
@@ -91,7 +92,7 @@ def osSYSTEM():
91
92
92
93
#print(res)
93
94
try :
94
- os .system (f" { res } " )
95
+ os .system (str ( res ) )
95
96
except :
96
97
raise InvalidModuleError (f"'{ res } ' command doesn't exist!" )
97
98
else :
@@ -372,14 +373,57 @@ def CONSOLEprint():
372
373
#newvar = variable;
373
374
if newvar [- 1 ] == ";" :
374
375
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!" )
376
381
else :
377
382
newvarTEST = newvar [- 1 ]
378
383
newvar = newvar .replace (";" ,"" )#make ; disappear into blank space
379
384
else :
380
385
raise InvalidSyntaxError ("Variable statement is missing semi-colon!" )
386
+
381
387
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!" )
383
427
else :
384
428
allvars [newvar ] = 0
385
429
@@ -488,6 +532,8 @@ def CONSOLEprint():
488
532
alert ()
489
533
490
534
535
+ elif "if " in lines :
536
+ e
491
537
492
538
493
539
elif "time.sleep(" in lines :
@@ -522,9 +568,8 @@ def CONSOLEprint():
522
568
elif "os.system(" in lines :
523
569
osSYSTEM ()
524
570
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 ()
528
573
529
574
530
575
0 commit comments