Commit 5a959c36 authored by Igor Dejanovic's avatar Igor Dejanovic

Fixing bibtex example.

parent e30f7617
...@@ -61,11 +61,10 @@ class BibEntrySem(SemanticAction): ...@@ -61,11 +61,10 @@ class BibEntrySem(SemanticAction):
if parser.debug: if parser.debug:
print(" Processing bibentry %s" % children[2]) print(" Processing bibentry %s" % children[2])
bib_entry_map = { bib_entry_map = {
'bibtype': children[0].value, 'bibtype': children[0],
'bibkey': children[2].value 'bibkey': children[1]
} }
for field in children[3:]: for field in children[2:]:
if isinstance(field, tuple):
bib_entry_map[field[0]] = field[1] bib_entry_map[field[0]] = field[1]
return bib_entry_map return bib_entry_map
...@@ -77,7 +76,7 @@ class FieldSem(SemanticAction): ...@@ -77,7 +76,7 @@ class FieldSem(SemanticAction):
def first_pass(self, parser, node, children): def first_pass(self, parser, node, children):
if parser.debug: if parser.debug:
print(" Processing field %s" % children[0]) print(" Processing field %s" % children[0])
field = (children[0].value, children[2]) field = (children[0], children[1])
return field return field
...@@ -87,7 +86,7 @@ class FieldValueSem(SemanticAction): ...@@ -87,7 +86,7 @@ class FieldValueSem(SemanticAction):
Remove braces. Remove newlines. Remove braces. Remove newlines.
""" """
def first_pass(self, parser, node, children): def first_pass(self, parser, node, children):
value = children[1].value value = children[0].value
value = value.replace(r"\'{c}", u"ć")\ value = value.replace(r"\'{c}", u"ć")\
.replace(r"\'{C}", u"Ć")\ .replace(r"\'{C}", u"Ć")\
.replace(r"\v{c}", u"č")\ .replace(r"\v{c}", u"č")\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment