mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-25 19:44:13 +01:00
plugins/MoobotFactoids: Fix bug in OptionList.
This commit is contained in:
parent
9883cb56ac
commit
ad4ef00bc4
@ -52,19 +52,13 @@ class OptionList(object):
|
|||||||
if not token:
|
if not token:
|
||||||
return '(%s' % ''.join(ret) #)
|
return '(%s' % ''.join(ret) #)
|
||||||
elif token == ')':
|
elif token == ')':
|
||||||
if len(ret) > 1:
|
|
||||||
if '|' in ret:
|
if '|' in ret:
|
||||||
L = map(''.join,
|
L = map(''.join,
|
||||||
utils.iter.split('|'.__eq__, ret,
|
utils.iter.split('|'.__eq__, ret,
|
||||||
yieldEmpty=True))
|
yieldEmpty=True))
|
||||||
return utils.iter.choice(L)
|
return utils.iter.choice(L)
|
||||||
else:
|
else:
|
||||||
return ''.join(ret)
|
return '(%s)' % ''.join(ret)
|
||||||
return [x for x in ret if x != '|']
|
|
||||||
elif len(ret) == 1:
|
|
||||||
return '(%s)' % ret[0]
|
|
||||||
else:
|
|
||||||
return '()'
|
|
||||||
elif token == '(':
|
elif token == '(':
|
||||||
ret.append(self._insideParens(lexer))
|
ret.append(self._insideParens(lexer))
|
||||||
elif token == '|':
|
elif token == '|':
|
||||||
|
Loading…
Reference in New Issue
Block a user