From e8fba977f4d23b268a649769d16cea9fc3b7cc01 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 27 Jul 2013 17:55:17 +0300 Subject: Some sort of elif implementation. --- mparser.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mparser.py') diff --git a/mparser.py b/mparser.py index f603f2ffe..20531d429 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 -- cgit v1.2.3