mirror of
https://gitlab.com/luk3yx/minetest-formspec_ast.git
synced 2025-08-25 00:26:23 +02:00
Fix dropdown[] AST
This commit is contained in:
parent
0427c348dd
commit
1d14900cfb
File diff suppressed because one or more lines are too long
@ -36,14 +36,16 @@ def _fix_param(param):
|
|||||||
if ',' not in param:
|
if ',' not in param:
|
||||||
param = param.lower().strip().strip('<>').replace(' ', '_')
|
param = param.lower().strip().strip('<>').replace(' ', '_')
|
||||||
param = _aliases.get(param, param)
|
param = _aliases.get(param, param)
|
||||||
|
assert param != '...'
|
||||||
return (param, _known.get(param, 'string'))
|
return (param, _known.get(param, 'string'))
|
||||||
param = param.split(',')
|
param = param.split(',')
|
||||||
|
|
||||||
res = []
|
res = []
|
||||||
for p in param:
|
for p in map(str.strip, param):
|
||||||
if p != '...' or not res:
|
if p != '...':
|
||||||
res.append(_fix_param(p))
|
res.append(_fix_param(p))
|
||||||
continue
|
continue
|
||||||
|
assert res
|
||||||
|
|
||||||
last = res.pop()
|
last = res.pop()
|
||||||
# Workaround
|
# Workaround
|
||||||
|
Loading…
Reference in New Issue
Block a user