diff options
author | Levi Bard <levibard@mono-cvs.ximian.com> | 2010-02-19 01:14:10 +0300 |
---|---|---|
committer | Levi Bard <levibard@mono-cvs.ximian.com> | 2010-02-19 01:14:10 +0300 |
commit | e5bdaf9e2ff7e317e2c9af53a9177bf528fe3eed (patch) | |
tree | 853b48273e3812dae49650b071db1fed56846aaf /extras/ValaBinding | |
parent | 35814462fff49e16ddc62eb5166cade6f00ab316 (diff) |
* Parser/ValaDocumentParser.cs: Avoid occasional parser exceptions.
svn path=/trunk/monodevelop/; revision=152028
Diffstat (limited to 'extras/ValaBinding')
-rw-r--r-- | extras/ValaBinding/ChangeLog | 5 | ||||
-rw-r--r-- | extras/ValaBinding/Parser/ValaDocumentParser.cs | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/extras/ValaBinding/ChangeLog b/extras/ValaBinding/ChangeLog index 26987e915f..f3fe7823f6 100644 --- a/extras/ValaBinding/ChangeLog +++ b/extras/ValaBinding/ChangeLog @@ -1,5 +1,10 @@ 2010-02-18 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com> + * Parser/ValaDocumentParser.cs: Avoid occasional parser + exceptions. + +2010-02-18 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com> + * Project/ValaProject.cs: Add project packages to parse list. 2010-02-18 Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com> diff --git a/extras/ValaBinding/Parser/ValaDocumentParser.cs b/extras/ValaBinding/Parser/ValaDocumentParser.cs index e7b4619146..a16d3825a3 100644 --- a/extras/ValaBinding/Parser/ValaDocumentParser.cs +++ b/extras/ValaBinding/Parser/ValaDocumentParser.cs @@ -65,7 +65,7 @@ namespace MonoDevelop.ValaBinding.Parser if(null == doc.CompilationUnit){ doc.CompilationUnit = new CompilationUnit (fileName); } CompilationUnit cu = (CompilationUnit)doc.CompilationUnit; int lastLine = 0; - List<Symbol> classes = pi.GetClassesForFile (fileName); + ICollection<Symbol> classes = pi.GetClassesForFile (fileName); if (null == classes || 0 == classes.Count) { return lastGood; @@ -77,7 +77,8 @@ namespace MonoDevelop.ValaBinding.Parser lastLine = node.SourceReferences[0].LastLine; foreach (Symbol child in node.Children) { - if (child.SourceReferences[0].File != node.SourceReferences[0].File){ continue; } + if (1 > child.SourceReferences.Count || + child.SourceReferences[0].File != node.SourceReferences[0].File){ continue; } lastLine = Math.Max (lastLine, child.SourceReferences[0].LastLine+1); switch (child.SymbolType.ToLower ()) { |