[vala/0.40] vala: Rely on more implementations of Block in SwitchSection
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.40] vala: Rely on more implementations of Block in SwitchSection
- Date: Thu, 5 Mar 2020 18:45:23 +0000 (UTC)
commit 52fbf1fea009ba285f0849982b45a5f59554f572
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Feb 20 14:19:10 2020 +0100
vala: Rely on more implementations of Block in SwitchSection
It was possible that statements in switch-sections were not processed
by the semantic-analyzer. Therefore they were not checked for errors
and marked as such.
vala/valaswitchsection.vala | 29 ++++-------------------------
1 file changed, 4 insertions(+), 25 deletions(-)
---
diff --git a/vala/valaswitchsection.vala b/vala/valaswitchsection.vala
index b1960a5d8..bd0a53861 100644
--- a/vala/valaswitchsection.vala
+++ b/vala/valaswitchsection.vala
@@ -80,9 +80,7 @@ public class Vala.SwitchSection : Block {
label.accept (visitor);
}
- foreach (Statement st in get_statements ()) {
- st.accept (visitor);
- }
+ base.accept_children (visitor);
}
public override bool check (CodeContext context) {
@@ -90,34 +88,15 @@ public class Vala.SwitchSection : Block {
return !error;
}
- checked = true;
-
foreach (SwitchLabel label in get_labels ()) {
label.check (context);
}
- owner = context.analyzer.current_symbol.scope;
-
- var old_symbol = context.analyzer.current_symbol;
- var old_insert_block = context.analyzer.insert_block;
- context.analyzer.current_symbol = this;
- context.analyzer.insert_block = this;
-
- foreach (Statement st in get_statements ()) {
- st.check (context);
- }
-
- foreach (LocalVariable local in get_local_variables ()) {
- local.active = false;
+ if (!base.check (context)) {
+ error = true;
}
- // use get_statements () instead of statement_list to not miss errors within StatementList
objects
- foreach (Statement stmt in get_statements ()) {
- add_error_types (stmt.get_error_types ());
- }
-
- context.analyzer.current_symbol = old_symbol;
- context.analyzer.insert_block = old_insert_block;
+ checked = true;
return !error;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]