Browse Source

Allow trailing comma after dictionnay element

pull/177/head
Oliverpool 9 years ago
parent
commit
8f1908d4de
  1. 5
      patacrep/latex/syntax.py

5
patacrep/latex/syntax.py

@ -130,8 +130,11 @@ class LatexParser(Parser):
def p_dictionary(symbols): def p_dictionary(symbols):
"""dictionary : identifier EQUAL braces dictionary_next """dictionary : identifier EQUAL braces dictionary_next
| identifier EQUAL error dictionary_next | identifier EQUAL error dictionary_next
| empty
""" """
if isinstance(symbols[3], ast.Expression): if len(symbols) == 2:
symbols[0] = {}
elif isinstance(symbols[3], ast.Expression):
symbols[0] = {} symbols[0] = {}
symbols[0][symbols[1]] = symbols[3] symbols[0][symbols[1]] = symbols[3]
symbols[0].update(symbols[4]) symbols[0].update(symbols[4])

Loading…
Cancel
Save