diff options
author | Mike Krüger <mkrueger@novell.com> | 2009-09-16 10:43:23 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@novell.com> | 2009-09-16 10:43:23 +0400 |
commit | f34081f664160f366198d97731a360899cfe9eec (patch) | |
tree | 0a4e831a9885abe47775aaa6298daff613e1880d /main/contrib | |
parent | 3df450ae10e64a233d9b4f4771a5dde356cecd76 (diff) |
* Src/Parser/CSharp/CSharpParser.cs:
* Src/Visitors/CodeDOMOutputVisitor.cs: Fixed "Bug 539329 -
System.InvalidOperationException: empty type".
svn path=/trunk/monodevelop/; revision=142012
Diffstat (limited to 'main/contrib')
3 files changed, 17 insertions, 13 deletions
diff --git a/main/contrib/NRefactory/Project/ChangeLog b/main/contrib/NRefactory/Project/ChangeLog index ded20f804a..b53206c156 100644 --- a/main/contrib/NRefactory/Project/ChangeLog +++ b/main/contrib/NRefactory/Project/ChangeLog @@ -1,3 +1,9 @@ +2009-09-16 Mike Krüger <mkrueger@novell.com> + + * Src/Parser/CSharp/CSharpParser.cs: + * Src/Visitors/CodeDOMOutputVisitor.cs: Fixed "Bug 539329 - + System.InvalidOperationException: empty type". + 2009-09-15 Mike Krüger <mkrueger@novell.com> * Src/PrettyPrinter/AbstractOutputFormatter.cs: Indent blank diff --git a/main/contrib/NRefactory/Project/Src/Parser/CSharp/CSharpParser.cs b/main/contrib/NRefactory/Project/Src/Parser/CSharp/CSharpParser.cs index 05992dbc89..4881f3a2b2 100644 --- a/main/contrib/NRefactory/Project/Src/Parser/CSharp/CSharpParser.cs +++ b/main/contrib/NRefactory/Project/Src/Parser/CSharp/CSharpParser.cs @@ -451,17 +451,19 @@ namespace ICSharpCode.NRefactory.Parser.CSharp /* True, if lookahead is a primitive type keyword, or */ /* if it is a type declaration followed by an ident */ - bool IsLocalVarDecl () { - if (IsYieldStatement()) { + bool IsLocalVarDecl () + { + if (IsYieldStatement ()) { return false; } - if ((Tokens.TypeKW[la.kind] && Peek(1).kind != Tokens.Dot) || la.kind == Tokens.Void) { + + if ((Tokens.TypeKW[la.kind] && Peek (1).kind != Tokens.Dot) || la.kind == Tokens.Void) { return true; } - StartPeek(); + StartPeek (); Token pt = la; - return IsTypeNameOrKWForTypeCast(ref pt) && IsIdentifierToken(pt); + return IsTypeNameOrKWForTypeCast (ref pt) && IsIdentifierToken (pt) && Peek (1).kind != Tokens.Question; } /* True if lookahead is a type argument list (<...>) followed by diff --git a/main/contrib/NRefactory/Project/Src/Visitors/CodeDOMOutputVisitor.cs b/main/contrib/NRefactory/Project/Src/Visitors/CodeDOMOutputVisitor.cs index 9bcd658303..f2b5996efd 100644 --- a/main/contrib/NRefactory/Project/Src/Visitors/CodeDOMOutputVisitor.cs +++ b/main/contrib/NRefactory/Project/Src/Visitors/CodeDOMOutputVisitor.cs @@ -1,4 +1,4 @@ -// <file> +// <file> // <copyright see="prj:///doc/copyright.txt"/> // <license see="prj:///doc/license.txt"/> // <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/> @@ -79,14 +79,10 @@ namespace ICSharpCode.NRefactory.Visitors parameters.Clear(); } - CodeTypeReference ConvType(TypeReference type) + CodeTypeReference ConvType (TypeReference type) { - if (type == null) { - throw new ArgumentNullException("type"); - } - if (string.IsNullOrEmpty(type.Type)) { - throw new InvalidOperationException("empty type"); - } + if (type == null || string.IsNullOrEmpty (type.Type)) + return new CodeTypeReference (""); CodeTypeReference t = new CodeTypeReference(type.Type); foreach (TypeReference gt in type.GenericTypes) { |