minor edits

This commit is contained in:
sforman 2023-07-25 20:03:11 -07:00
parent 18b5d5b497
commit 975924f632
2 changed files with 4 additions and 10 deletions

View File

@ -18,5 +18,3 @@ like to replace the dependency on Python with, say, Awk or something.
- boehm-gc - boehm-gc
- gmp - gmp
sudo apt install gperf

View File

@ -1,14 +1,10 @@
def f(string, start=0, acc=[]): def f(string, start=0, acc=[]):
if start >= len(string): if start >= len(string): return acc
return acc if '[' == string[start]: return [1] + f(string, start+1, acc)
if '[' == string[start]: if ']' == string[start]: return [0] + f(string, start+1, acc)
return [1] + f(string, start+1, acc) if ' ' == string[start]: return f(string, start+1, acc)
if ']' == string[start]:
return [0] + f(string, start+1, acc)
if ' ' == string[start]:
return f(string, start+1, acc)
symbol, n = bar(string, start, start) symbol, n = bar(string, start, start)
return [symbol] + f(string, n, acc) return [symbol] + f(string, n, acc)