]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Remove workarounds for old Vala versions
authorJürg Billeter <j@bitron.ch>
Sat, 13 Dec 2008 11:02:21 +0000 (11:02 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 13 Dec 2008 11:02:21 +0000 (11:02 +0000)
2008-12-13  Jürg Billeter  <j@bitron.ch>

* vala/valagenieparser.vala:
* vala/valaparser.vala:

Remove workarounds for old Vala versions

svn path=/trunk/; revision=2139

ChangeLog
vala/valagenieparser.vala
vala/valaparser.vala

index 945206ca3827fee6cb1df6f7b908894d2ec18380..c2d992bd34e4cb4e6b12e10df80867d210f85c41 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-12-13  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valagenieparser.vala:
+       * vala/valaparser.vala:
+
+       Remove workarounds for old Vala versions
+
 2008-12-13  Jürg Billeter  <j@bitron.ch>
 
        * vala/valablock.vala:
index 617d7b719abfa78145cf646dec912044a4394e5f..9dc35e76b0ae616816314d24620b6769b2735ad5 100644 (file)
@@ -573,11 +573,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                        break;
                }
 
-               if (expr == null) {
-                       // workaround for current limitation of exception handling
-                       throw new ParseError.SYNTAX ("syntax error in primary expression");
-               }
-
                // process primary expressions that start with an inner primary expression
                bool found = true;
                while (found) {
@@ -605,11 +600,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                                found = false;
                                break;
                        }
-
-                       if (expr == null) {
-                               // workaround for current limitation of exception handling
-                               throw new ParseError.SYNTAX ("syntax error in primary expression");
-                       }
                }
 
                return expr;
@@ -1430,10 +1420,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                                next ();
                                var rhs = parse_expression ();
                                expr = new Assignment (expr, rhs, operator, get_src (begin));
-                               if (expr == null) {
-                                       // workaround for current limitation of exception handling
-                                       throw new ParseError.SYNTAX ("syntax error in assignment");
-                               }
                        } else if (current () == TokenType.OP_GT) { // >>=
                                char* first_gt_pos = tokens[index].begin.pos;
                                next ();
@@ -1442,10 +1428,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                                        next ();
                                        var rhs = parse_expression ();
                                        expr = new Assignment (expr, rhs, AssignmentOperator.SHIFT_RIGHT, get_src (begin));
-                                       if (expr == null) {
-                                               // workaround for current limitation of exception handling
-                                               throw new ParseError.SYNTAX ("syntax error in assignment");
-                                       }
                                } else {
                                        prev ();
                                        break;
@@ -1590,10 +1572,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                                }
 
                                if (!is_decl) {
-                                       if (stmt == null) {
-                                               // workaround for current limitation of exception handling
-                                               throw new ParseError.SYNTAX ("syntax error in statement");
-                                       }
                                        block.add_statement (stmt);
                                }
                        } catch (ParseError e) {
@@ -1651,12 +1629,7 @@ public class Vala.Genie.Parser : CodeVisitor {
                comment = scanner.pop_comment ();
 
                var block = new Block (get_src_com (get_location ()));
-               var stmt = parse_embedded_statement_without_block ();
-               if (stmt == null) {
-                       // workaround for current limitation of exception handling
-                       throw new ParseError.SYNTAX ("syntax error in embedded statement");
-               }
-               block.add_statement (stmt);
+               block.add_statement (parse_embedded_statement_without_block ());
                return block;
 
        }
@@ -2319,9 +2292,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                        ns.add_field (field);
                } else if (sym is Constant) {
                        ns.add_constant ((Constant) sym);
-               } else if (sym == null) {
-                       // workaround for current limitation of exception handling
-                       throw new ParseError.SYNTAX ("syntax error in declaration");
                } else {
                        Report.error (sym.source_reference, "unexpected declaration in namespace");
                }
@@ -2465,9 +2435,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                         }
                } else if (sym is Destructor) {
                        cl.destructor = (Destructor) sym;
-               } else if (sym == null) {
-                       // workaround for current limitation of exception handling
-                       throw new ParseError.SYNTAX ("syntax error in declaration");
                } else {
                        Report.error (sym.source_reference, "unexpected declaration in class");
                }
@@ -2983,9 +2950,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                        st.add_field ((Field) sym);
                } else if (sym is Constant) {
                        st.add_constant ((Constant) sym);
-               } else if (sym == null) {
-                       // workaround for current limitation of exception handling
-                       throw new ParseError.SYNTAX ("syntax error in declaration");
                } else {
                        Report.error (sym.source_reference, "unexpected declaration in struct");
                }
@@ -3058,9 +3022,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                        iface.add_field ((Field) sym);
                } else if (sym is Property) {
                        iface.add_property ((Property) sym);
-               } else if (sym == null) {
-                       // workaround for current limitation of exception handling
-                       throw new ParseError.SYNTAX ("syntax error in declaration");
                } else {
                        Report.error (sym.source_reference, "unexpected declaration in interface");
                }
@@ -3200,7 +3161,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                                return flags;
                        }
                }
-               return flags;
        }
 
        ModifierFlags parse_member_declaration_modifiers () {
@@ -3243,7 +3203,6 @@ public class Vala.Genie.Parser : CodeVisitor {
                                return flags;
                        }
                }
-               return flags;
        }
 
        FormalParameter parse_parameter () throws ParseError {
index 135e5faa7129b45eaeb260c914716db7e9255466..6b817e30fad63e901da6e125d729e259b3e2473b 100644 (file)
@@ -476,11 +476,6 @@ public class Vala.Parser : CodeVisitor {
                        break;
                }
 
-               if (expr == null) {
-                       // workaround for current limitation of exception handling
-                       throw new ParseError.SYNTAX ("syntax error in primary expression");
-               }
-
                // process primary expressions that start with an inner primary expression
                bool found = true;
                while (found) {
@@ -507,11 +502,6 @@ public class Vala.Parser : CodeVisitor {
                                found = false;
                                break;
                        }
-
-                       if (expr == null) {
-                               // workaround for current limitation of exception handling
-                               throw new ParseError.SYNTAX ("syntax error in primary expression");
-                       }
                }
 
                return expr;
@@ -1144,10 +1134,6 @@ public class Vala.Parser : CodeVisitor {
                                next ();
                                var rhs = parse_expression ();
                                expr = new Assignment (expr, rhs, operator, get_src (begin));
-                               if (expr == null) {
-                                       // workaround for current limitation of exception handling
-                                       throw new ParseError.SYNTAX ("syntax error in assignment");
-                               }
                        } else if (current () == TokenType.OP_GT) { // >>=
                                char* first_gt_pos = tokens[index].begin.pos;
                                next ();
@@ -1156,10 +1142,6 @@ public class Vala.Parser : CodeVisitor {
                                        next ();
                                        var rhs = parse_expression ();
                                        expr = new Assignment (expr, rhs, AssignmentOperator.SHIFT_RIGHT, get_src (begin));
-                                       if (expr == null) {
-                                               // workaround for current limitation of exception handling
-                                               throw new ParseError.SYNTAX ("syntax error in assignment");
-                                       }
                                } else {
                                        prev ();
                                        break;
@@ -1254,10 +1236,6 @@ public class Vala.Parser : CodeVisitor {
                                }
 
                                if (!is_decl) {
-                                       if (stmt == null) {
-                                               // workaround for current limitation of exception handling
-                                               throw new ParseError.SYNTAX ("syntax error in statement");
-                                       }
                                        block.add_statement (stmt);
                                }
                        } catch (ParseError e) {
@@ -1315,12 +1293,7 @@ public class Vala.Parser : CodeVisitor {
                comment = scanner.pop_comment ();
 
                var block = new Block (get_src_com (get_location ()));
-               var stmt = parse_embedded_statement_without_block ();
-               if (stmt == null) {
-                       // workaround for current limitation of exception handling
-                       throw new ParseError.SYNTAX ("syntax error in embedded statement");
-               }
-               block.add_statement (stmt);
+               block.add_statement (parse_embedded_statement_without_block ());
                return block;
 
        }
@@ -1501,9 +1474,7 @@ public class Vala.Parser : CodeVisitor {
                                is_expr = true;
                                break;
                        default:
-                               // workaround for current limitation of exception handling
-                               bool local_is_expr = is_expression ();
-                               is_expr = local_is_expr;
+                               is_expr = is_expression ();
                                break;
                        }
 
@@ -1926,9 +1897,6 @@ public class Vala.Parser : CodeVisitor {
                        ns.add_field (field);
                } else if (sym is Constant) {
                        ns.add_constant ((Constant) sym);
-               } else if (sym == null) {
-                       // workaround for current limitation of exception handling
-                       throw new ParseError.SYNTAX ("syntax error in declaration");
                } else {
                        Report.error (sym.source_reference, "unexpected declaration in namespace");
                }
@@ -2035,9 +2003,6 @@ public class Vala.Parser : CodeVisitor {
                        }
                } else if (sym is Destructor) {
                        cl.destructor = (Destructor) sym;
-               } else if (sym == null) {
-                       // workaround for current limitation of exception handling
-                       throw new ParseError.SYNTAX ("syntax error in declaration");
                } else {
                        Report.error (sym.source_reference, "unexpected declaration in class");
                }
@@ -2414,9 +2379,6 @@ public class Vala.Parser : CodeVisitor {
                        st.add_field ((Field) sym);
                } else if (sym is Constant) {
                        st.add_constant ((Constant) sym);
-               } else if (sym == null) {
-                       // workaround for current limitation of exception handling
-                       throw new ParseError.SYNTAX ("syntax error in declaration");
                } else {
                        Report.error (sym.source_reference, "unexpected declaration in struct");
                }
@@ -2484,9 +2446,6 @@ public class Vala.Parser : CodeVisitor {
                        iface.add_field ((Field) sym);
                } else if (sym is Property) {
                        iface.add_property ((Property) sym);
-               } else if (sym == null) {
-                       // workaround for current limitation of exception handling
-                       throw new ParseError.SYNTAX ("syntax error in declaration");
                } else {
                        Report.error (sym.source_reference, "unexpected declaration in interface");
                }
@@ -2527,9 +2486,6 @@ public class Vala.Parser : CodeVisitor {
                                var member_sym = parse_declaration ();
                                if (member_sym is Method) {
                                        en.add_method ((Method) member_sym);
-                               } else if (member_sym == null) {
-                                       // workaround for current limitation of exception handling
-                                       throw new ParseError.SYNTAX ("syntax error in declaration");
                                } else {
                                        Report.error (member_sym.source_reference, "unexpected declaration in enum");
                                }
@@ -2587,9 +2543,6 @@ public class Vala.Parser : CodeVisitor {
                                var member_sym = parse_declaration ();
                                if (member_sym is Method) {
                                        ed.add_method ((Method) member_sym);
-                               } else if (member_sym == null) {
-                                       // workaround for current limitation of exception handling
-                                       throw new ParseError.SYNTAX ("syntax error in declaration");
                                } else {
                                        Report.error (member_sym.source_reference, "unexpected declaration in errordomain");
                                }
@@ -2651,7 +2604,6 @@ public class Vala.Parser : CodeVisitor {
                                return flags;
                        }
                }
-               return flags;
        }
 
        ModifierFlags parse_member_declaration_modifiers () {
@@ -2690,7 +2642,6 @@ public class Vala.Parser : CodeVisitor {
                                return flags;
                        }
                }
-               return flags;
        }
 
        FormalParameter parse_parameter () throws ParseError {