From c10837c119fac0e4e2c15b19169cd945597111ff Mon Sep 17 00:00:00 2001 From: cynic Date: Wed, 5 Oct 2022 14:18:43 -0400 Subject: [PATCH] rm the old structurizer --- main.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/main.py b/main.py index 2aa311c..d4c0af4 100644 --- a/main.py +++ b/main.py @@ -94,41 +94,6 @@ def lex(toks): lexed.append(("identifier", t)) return lexed -def shit_structurize(chunk): - def splitlist(l, delim): - res = [] - tmp = [] - for i in l: - if i == delim: - res.append(tmp) - tmp = [] - else: - tmp.append(i) - res.append(tmp) - res = list(filter(lambda a: a != [], res)) - if type(res) == type([]) and len(res) == 1: - return res[0] - return res - if chunk[0][0] == "open": - end = chunk.index(("close", chunk[0][1])) - - - cunny = [] - cunny.append(chunk[1]) - - jc = splitlist(chunk[2:end], ("sep", None)) - - for i in jc: - if chunk[0][0] == "open": - #chunk.append(structurize(jc)) - #break - print(chunk) - cunny.append(structurize(i)) - print(cunny, len(cunny), jc) - return cunny - else: - return chunk - def structurize(program): def _amidone(prog): good = True