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
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
backend
arpeggio-gm
Commits
4c52e8ba
Commit
4c52e8ba
authored
Dec 11, 2013
by
Igor Dejanovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for comments in bibtex example
parent
b1eeecd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
bibtex.py
examples/bibtex.py
+3
-2
No files found.
examples/bibtex.py
View file @
4c52e8ba
...
...
@@ -22,7 +22,8 @@ def bibtype(): return _(r'@\w+')
def
bibkey
():
return
_
(
r'[^\s,]+'
),
def
field
():
return
fieldname
,
"="
,
'"'
,
fieldvalue
,
'"'
def
fieldname
():
return
_
(
r'\w+'
)
def
fieldvalue
():
return
_
(
r'[^"]*'
)
def
fieldvalue
():
return
_
(
r'[^"]*'
)
def
comment
():
return
_
(
r'
%
[^\n]*'
)
# Semantic actions
class
BibFileSem
(
SemanticAction
):
...
...
@@ -80,7 +81,7 @@ if __name__ == "__main__":
# First we will make a parser - an instance of the bib parser model.
# Parser model is given in the form of python constructs therefore we
# are using ParserPython class.
parser
=
ParserPython
(
bibfile
,
reduce_tree
=
True
)
parser
=
ParserPython
(
bibfile
,
comment_def
=
comment
,
reduce_tree
=
True
)
# Then we export it to a dot file in order to visualise it. This is
# particulary handy for debugging purposes.
...
...
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