diff options
author | Jürg Billeter <j@bitron.ch> | 2009-02-12 13:37:49 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2009-02-12 13:37:49 +0000 |
commit | 62086cde0ada111491e8f5ab9cb0d9813a998f0b (patch) | |
tree | 62d343697a281c748f8e89b05ddc2daa582ea771 /vala/valagenieparser.vala | |
parent | e87454ce8749cce070793435e40b2046ee362e68 (diff) | |
download | vala-62086cde0ada111491e8f5ab9cb0d9813a998f0b.tar.gz |
Fix else if parsing, fixes bug 562632
2009-02-12 Jürg Billeter <j@bitron.ch>
* vala/valagenieparser.vala:
Fix else if parsing, fixes bug 562632
svn path=/trunk/; revision=2433
Diffstat (limited to 'vala/valagenieparser.vala')
-rw-r--r-- | vala/valagenieparser.vala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala index 9bbee34f2..e7602218e 100644 --- a/vala/valagenieparser.vala +++ b/vala/valagenieparser.vala @@ -1775,6 +1775,13 @@ public class Vala.Genie.Parser : CodeVisitor { var true_stmt = parse_embedded_statement (); Block false_stmt = null; if (accept (TokenType.ELSE)) { + // allow `else if' on the same line without `do' + if (!accept (TokenType.DO) && current () != TokenType.IF) { + expect (TokenType.EOL); + } else { + accept (TokenType.EOL); + } + false_stmt = parse_embedded_statement (); } return new IfStatement (condition, true_stmt, false_stmt, src); |