From: Jürg Billeter Date: Sat, 13 Dec 2008 11:02:21 +0000 (+0000) Subject: Remove workarounds for old Vala versions X-Git-Tag: VALA_0_5_3~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d166759b630f2157d6cbb4b69692d1dde54df1ca;p=thirdparty%2Fvala.git Remove workarounds for old Vala versions 2008-12-13 Jürg Billeter * vala/valagenieparser.vala: * vala/valaparser.vala: Remove workarounds for old Vala versions svn path=/trunk/; revision=2139 --- diff --git a/ChangeLog b/ChangeLog index 945206ca3..c2d992bd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-12-13 Jürg Billeter + + * vala/valagenieparser.vala: + * vala/valaparser.vala: + + Remove workarounds for old Vala versions + 2008-12-13 Jürg Billeter * vala/valablock.vala: diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala index 617d7b719..9dc35e76b 100644 --- a/vala/valagenieparser.vala +++ b/vala/valagenieparser.vala @@ -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 { diff --git a/vala/valaparser.vala b/vala/valaparser.vala index 135e5faa7..6b817e30f 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -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 {