Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zot4rst
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Erik Hetzner
zot4rst
Commits
0f5a2c7c
Commit
0f5a2c7c
authored
Aug 03, 2015
by
Erik Hetzner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Throw exception with citation when unable to parse
parent
f674b061
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
parser.py
xciterst/parser.py
+7
-3
No files found.
xciterst/parser.py
View file @
0f5a2c7c
import
re
import
sys
from
pyparsing
import
Group
,
OneOrMore
,
Optional
,
Regex
,
White
,
Word
,
ZeroOrMore
from
pyparsing
import
Group
,
OneOrMore
,
Optional
,
Regex
,
White
,
Word
,
ZeroOrMore
,
ParseException
from
xciterst.citations
import
CitationInfo
,
CitationCluster
class
CiteParser
(
object
):
...
...
@@ -132,5 +132,9 @@ class CiteParser(object):
topCite
=
bracketedCite
^
shortCite
+
shortCiteExtra
^
shortCite
+
bracketedCite
^
shortCite
raw
=
topCite
.
parseString
(
what
,
True
)
return
self
.
_results2cites
(
list
(
raw
))
try
:
raw
=
topCite
.
parseString
(
what
,
True
)
return
self
.
_results2cites
(
list
(
raw
))
except
ParseException
:
raise
Exception
(
'The citation
%
s was not parseable.'
%
(
what
))
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