-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstdlib.py
More file actions
39 lines (34 loc) · 1.04 KB
/
Copy pathstdlib.py
File metadata and controls
39 lines (34 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import process
import unpack_functions
# Standard Libary
def stdlibStatements(line, dict, funcdict):
cb = process.process(line, dict, 2, funcdict)
return cb
def variables(line, dict, funcdict):
"""Store variables"""
line = line.replace(" ", "")
line = line.replace('\\s+', " ")
name, value = line.split("=")
if value.replace(" ", "") in funcdict:
value = value.replace(";", "")
value = value.replace(" ", "")
value = unpack_functions.unpackF(value, funcdict, dict)
value = stdlibStatements(value, funcdict, dict)
try:
eval(value)
except Exception:
pass
finally:
dict[name] = value
def input_statement(line, dict):
"""Accept Input"""
line = line.replace("inputln ", "")
if "'" in line:
line = line.replace("'", "")
elif '"' in line:
line =line.replace('"', "")
for key, value in dict.items():
line = line.replace(str(key), str(value))
value = input(line)
value = str(value)
return value