Skip to content

Commit

Permalink
Remove all debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
cloverpepsi authored Jun 30, 2024
1 parent 8dc6046 commit 1ffa976
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions Config/_bpp_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,7 @@ def run_bpp_program(code, p_args, author, runner, channel):

type_list = [int, float, str, list]

db = Database()

debug_start = timenow()

if channel.id == 990307784690135060: debug_values += "\nDEBUG INFO:\n"

db = Database()
match = re.finditer("(?i)\[global var \w*?\]", code)
found_vars = []
for var in match:
Expand All @@ -165,14 +160,7 @@ def run_bpp_program(code, p_args, author, runner, channel):

for v in v_list:
v_value = type_list[v[2]](v[1])
tag_globals[v[0]] = [v_value, str(v[3]), False]

debug_elapsed = timenow()-debug_start

if channel.id == 990307784690135060: debug_values += f"{debug_elapsed}\n"+"\n".join([f"{k}: {v}" for k,v in tag_globals.items()])



tag_globals[v[0]] = [v_value, str(v[3]), False]

def var_type(v):
try:
Expand Down Expand Up @@ -250,8 +238,6 @@ def evaluate_result(k):
else:
if (v_name,) not in db.get_entries("b++2variables", columns=["name"]):
raise NameError(f"No global variable by the name {safe_cut(v_name)} defined")

if channel.id == 990307784690135060: debug_values += f"\n{v_name}"

v_list = db.get_entries("b++2variables", columns=["name", "value", "type", "owner"])
v_value, v_type, v_owner = [v[1:4] for v in v_list if v[0] == v_name][0]
Expand Down Expand Up @@ -289,7 +275,6 @@ def evaluate_result(k):
if type(v) == list: v = express_array(v)
results.append(v)

debug_start = timenow()
for v_name, value in tag_globals.items():
if not value[2]: continue
v_value = value[0]
Expand All @@ -310,9 +295,6 @@ def evaluate_result(k):
"b++2variables",
entry={"value": str(v_value), "type": var_type(v_value)},
conditions={"name": v_name})

debug_elapsed = timenow()-debug_start
if channel.id == 990307784690135060: debug_values += f"{debug_elapsed}\n"

output = output.replace("{}", "\t").replace("{", "{{").replace("}", "}}").replace("\t", "{}")

Expand Down

0 comments on commit 1ffa976

Please sign in to comment.