aboutsummaryrefslogtreecommitdiff
path: root/mparser.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-07-27 17:55:17 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-07-27 17:55:17 +0300
commite8fba977f4d23b268a649769d16cea9fc3b7cc01 (patch)
treeff334eff4e9fe06948c89ba9cedc0d371b2abf23 /mparser.py
parent6b5c4b0a6911b1b585948f641bf3b397043c31b4 (diff)
downloadmeson-e8fba977f4d23b268a649769d16cea9fc3b7cc01.zip
meson-e8fba977f4d23b268a649769d16cea9fc3b7cc01.tar.gz
meson-e8fba977f4d23b268a649769d16cea9fc3b7cc01.tar.bz2
Some sort of elif implementation.
Diffstat (limited to 'mparser.py')
-rw-r--r--mparser.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mparser.py b/mparser.py
index f603f2f..20531d4 100644
--- a/mparser.py
+++ b/mparser.py
@@ -26,6 +26,7 @@ reserved = {'true' : 'TRUE',
'false' : 'FALSE',
'if' : 'IF',
'endif' : 'ENDIF',
+ 'elif' : 'ELIF',
'else' : 'ELSE',
'and' : 'AND',
'or' : 'OR',
@@ -205,6 +206,10 @@ def p_statement_not(t):
'statement : NOT statement'
t[0] = nodes.NotStatement(t[2])
+def p_statement_elif(t):
+ 'elseblock : ELIF statement EOL codeblock elseblock'
+ t[0] = nodes.ElifStatement(t[2], t[4], t[5], t.lineno(1))
+
def p_empty_else(t):
'elseblock : '
return None