Browse Source

- fixed positions in TypeReferences

- set IsExtensionMethod to true, if Extension-Attribute is on the Sub/Function

Note: this can only be guessed, because we cannot reliably resolve the type of the attribute on parser level.
pull/2/head
Siegfried Pammer 16 years ago
parent
commit
98ca2b1265
  1. 2771
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs
  2. 21
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG

2771
src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs

File diff suppressed because it is too large Load Diff

21
src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG

@ -1,6 +1,7 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Linq;
using System.Text; using System.Text;
using ICSharpCode.NRefactory.Ast; using ICSharpCode.NRefactory.Ast;
using ICSharpCode.NRefactory.Parser.VB; using ICSharpCode.NRefactory.Parser.VB;
@ -870,7 +871,8 @@ StructureMemberDecl<ModifierList m, List<AttributeSection> attributes>
TypeReference = new TypeReference("System.Void", true), TypeReference = new TypeReference("System.Void", true),
Templates = templates, Templates = templates,
HandlesClause = handlesClause, HandlesClause = handlesClause,
InterfaceImplementations = implementsClause InterfaceImplementations = implementsClause,
IsExtensionMethod = attributes.Any(section => section.Attributes.Any(a => a.Name.Contains("Extension")))
}; };
AddChild(methodDeclaration); AddChild(methodDeclaration);
.) .)
@ -978,7 +980,8 @@ StructureMemberDecl<ModifierList m, List<AttributeSection> attributes>
EndLocation = endLocation, EndLocation = endLocation,
Templates = templates, Templates = templates,
HandlesClause = handlesClause, HandlesClause = handlesClause,
InterfaceImplementations = implementsClause InterfaceImplementations = implementsClause,
IsExtensionMethod = attributes.Any(section => section.Attributes.Any(a => a.Name.Contains("Extension")))
}; };
AddChild(methodDeclaration); AddChild(methodDeclaration);
@ -2685,15 +2688,17 @@ Argument<out Expression argumentexpr>
/* 7.1. */ /* 7.1. */
TypeName<out TypeReference typeref> TypeName<out TypeReference typeref>
(. ArrayList rank = null; .) (. ArrayList rank = null; Location startLocation = la.Location; .)
= =
NonArrayTypeName<out typeref, false> NonArrayTypeName<out typeref, false>
ArrayTypeModifiers<out rank> ArrayTypeModifiers<out rank>
(. if (rank != null && typeref != null) { (.
typeref.RankSpecifier = (int[])rank.ToArray(typeof(int)); if (typeref != null) {
if (rank != null) {
typeref.RankSpecifier = (int[])rank.ToArray(typeof(int));
}
typeref.StartLocation = startLocation;
typeref.EndLocation = t.EndLocation;
} }
.) .)
. .

Loading…
Cancel
Save