rm the old structurizer

master
cynic 3 years ago
parent 17177206f7
commit c10837c119
  1. 35
      main.py

@ -94,41 +94,6 @@ def lex(toks):
lexed.append(("identifier", t)) lexed.append(("identifier", t))
return lexed 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 structurize(program):
def _amidone(prog): def _amidone(prog):
good = True good = True

Loading…
Cancel
Save