Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
arpeggio-gm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
郭家华
arpeggio-gm
Commits
5a959c36
Commit
5a959c36
authored
Jul 27, 2014
by
Igor Dejanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing bibtex example.
parent
e30f7617
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
bibtex.py
examples/bibtex.py
+5
-6
No files found.
examples/bibtex.py
View file @
5a959c36
...
@@ -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"č"
)
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment