summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenn Knowles <kenn.knowles@gmail.com>2013-06-21 04:46:32 -0700
committerKenn Knowles <kenn.knowles@gmail.com>2013-06-21 04:46:32 -0700
commit5c41c53877eb26df40c82d58ef33c0901891b81f (patch)
treefe116656fc592a9126473bb6f84f030fec79bb2e
parent428f7408b300cc6277a161de1827a89347f598bc (diff)
parent6a3063f3c183b623ef8bf4c7ba3d8b781d7ceca5 (diff)
downloadjsonpath-rw-5c41c53877eb26df40c82d58ef33c0901891b81f.tar.gz
Merge pull request #4 from iley/master
Fix a bug in error handling functions in lexer.py
-rw-r--r--jsonpath_rw/lexer.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/jsonpath_rw/lexer.py b/jsonpath_rw/lexer.py
index 40ae898..e88baae 100644
--- a/jsonpath_rw/lexer.py
+++ b/jsonpath_rw/lexer.py
@@ -78,7 +78,7 @@ class JsonPathLexer(object):
return t
def t_singlequote_error(self, t):
- raise Exception('Error on line %s, col %s while lexing singlequoted field: Unexpected character: %s ' % (t.lexer.lineno, t.lexpos - t.latest_newline, t.value[0]))
+ raise Exception('Error on line %s, col %s while lexing singlequoted field: Unexpected character: %s ' % (t.lexer.lineno, t.lexpos - t.lexer.latest_newline, t.value[0]))
# Double-quoted strings
@@ -96,7 +96,7 @@ class JsonPathLexer(object):
return t
def t_doublequote_error(self, t):
- raise Exception('Error on line %s, col %s while lexing doublequoted field: Unexpected character: %s ' % (t.lexer.lineno, t.lexpos - t.latest_newline, t.value[0]))
+ raise Exception('Error on line %s, col %s while lexing doublequoted field: Unexpected character: %s ' % (t.lexer.lineno, t.lexpos - t.lexer.latest_newline, t.value[0]))
# Back-quoted "magic" operators
@@ -114,7 +114,7 @@ class JsonPathLexer(object):
return t
def t_backquote_error(self, t):
- raise Exception('Error on line %s, col %s while lexing backquoted operator: Unexpected character: %s ' % (t.lexer.lineno, t.lexpos - t.latest_newline, t.value[0]))
+ raise Exception('Error on line %s, col %s while lexing backquoted operator: Unexpected character: %s ' % (t.lexer.lineno, t.lexpos - t.lexer.latest_newline, t.value[0]))
# Counting lines, handling errors
@@ -124,7 +124,7 @@ class JsonPathLexer(object):
t.lexer.latest_newline = t.lexpos
def t_error(self, t):
- raise Exception('Error on line %s, col %s: Unexpected character: %s ' % (t.lexer.lineno, t.lexpos - t.latest_newline, t.value[0]))
+ raise Exception('Error on line %s, col %s: Unexpected character: %s ' % (t.lexer.lineno, t.lexpos - t.lexer.latest_newline, t.value[0]))
if __name__ == '__main__':
logging.basicConfig()