minor edits
This commit is contained in:
parent
18b5d5b497
commit
975924f632
|
|
@ -18,5 +18,3 @@ like to replace the dependency on Python with, say, Awk or something.
|
|||
- boehm-gc
|
||||
- gmp
|
||||
|
||||
|
||||
sudo apt install gperf
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
|
||||
|
||||
def f(string, start=0, acc=[]):
|
||||
if start >= len(string):
|
||||
return acc
|
||||
if '[' == string[start]:
|
||||
return [1] + f(string, start+1, acc)
|
||||
if ']' == string[start]:
|
||||
return [0] + f(string, start+1, acc)
|
||||
if ' ' == string[start]:
|
||||
return f(string, start+1, acc)
|
||||
if start >= len(string): return acc
|
||||
if '[' == string[start]: return [1] + 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)
|
||||
return [symbol] + f(string, n, acc)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue