aboutsummaryrefslogtreecommitdiff
path: root/mparser.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-07-25 16:47:19 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-07-25 16:47:19 +0300
commitfcdc39e0492f00f260414a89bd5fa318d078b213 (patch)
treec154a349f22681db5a3d02bf8cd231d0730c33c1 /mparser.py
parent4d2b827b71081949387876394509395598c4d2dd (diff)
downloadmeson-fcdc39e0492f00f260414a89bd5fa318d078b213.zip
meson-fcdc39e0492f00f260414a89bd5fa318d078b213.tar.gz
meson-fcdc39e0492f00f260414a89bd5fa318d078b213.tar.bz2
Do not access non-existing member variable.
Diffstat (limited to 'mparser.py')
-rw-r--r--mparser.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mparser.py b/mparser.py
index 9bc0f2d..0b5ed30 100644
--- a/mparser.py
+++ b/mparser.py
@@ -227,11 +227,13 @@ def p_args_none(t):
t[0] = nodes.Arguments(t.lineno(0))
def p_error(t):
+ lineno = -1
if t is None:
txt = 'NONE'
else:
txt = t.value
- raise ParserException('Parser errored out at: %s.' % txt, t.lineno)
+ lineno = t.lineno
+ raise ParserException('Parser errored out at: %s.' % txt, lineno)
def test_lexer():
s = """hello = (something) # this = (that)