[anjuta] language-support-vala: fix critical warnings if there are parsing errors
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] language-support-vala: fix critical warnings if there are parsing errors
- Date: Sun, 8 Aug 2010 08:52:26 +0000 (UTC)
commit 15bde783bd236346af105375019aebc655526839
Author: Abderrahim Kitouni <a kitouni gmail com>
Date: Fri Aug 6 10:55:27 2010 +0100
language-support-vala: fix critical warnings if there are parsing errors
plugins/language-support-vala/plugin.vala | 17 +++++++++++++----
plugins/language-support-vala/report.vala | 3 +++
2 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/plugins/language-support-vala/plugin.vala b/plugins/language-support-vala/plugin.vala
index 0ba8b80..58e0355 100644
--- a/plugins/language-support-vala/plugin.vala
+++ b/plugins/language-support-vala/plugin.vala
@@ -75,17 +75,23 @@ public class ValaPlugin : Plugin {
ThreadFunc parse = () => {
lock (context) {
Vala.CodeContext.push(context);
+ var report = context.report as AnjutaReport;
parser = new Vala.Parser ();
genie_parser = new Vala.Genie.Parser ();
+ resolver = new Vala.SymbolResolver ();
+ analyzer = new Vala.SemanticAnalyzer ();
parser.parse (context);
genie_parser.parse (context);
+ if (report.errors_found ())
+ return null;
- resolver = new Vala.SymbolResolver ();
resolver.resolve (context);
+ if (report.errors_found ())
+ /* TODO: there may be missing packages */
+ return null;
- analyzer = new Vala.SemanticAnalyzer ();
analyzer.analyze (context);
Vala.CodeContext.pop();
@@ -298,8 +304,11 @@ public class ValaPlugin : Plugin {
parser.visit_source_file (file);
genie_parser.visit_source_file (file);
- resolver.resolve (context);
- analyzer.visit_source_file (file);
+ if (!report.errors_found ()) {
+ resolver.resolve (context);
+ if (!report.errors_found ())
+ analyzer.visit_source_file (file);
+ }
Vala.CodeContext.pop ();
diff --git a/plugins/language-support-vala/report.vala b/plugins/language-support-vala/report.vala
index f0d658e..b69de17 100644
--- a/plugins/language-support-vala/report.vala
+++ b/plugins/language-support-vala/report.vala
@@ -89,4 +89,7 @@ public class AnjutaReport : Vala.Report {
errors.add(Error () {source = source, message = message, error = true});
}
}
+ public bool errors_found () {
+ return (errors.size != 0);
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]