Browse Source

Fix forum-11540: C# parser fails on "using global::System;"

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@6135 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
8b052cb414
  1. 2459
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs
  2. 7
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG

2459
src/Libraries/NRefactory/Project/Src/Parser/CSharp/Parser.cs

File diff suppressed because it is too large Load Diff

7
src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG

@ -188,18 +188,21 @@ CS
UsingDirective UsingDirective
(. (.
string qualident = null; TypeReference aliasedType = null; string qualident = null; TypeReference aliasedType = null;
string alias = null;
.) .)
= =
"using" (. Location startPos = t.Location; .) "using" (. Location startPos = t.Location; .)
[ IF (IdentAndDoubleColon()) Identifier (. alias = t.val; .) "::" ]
Qualident<out qualident> Qualident<out qualident>
[ "=" NonArrayType<out aliasedType> ] [ "=" NonArrayType<out aliasedType> ]
";" (. ";" (.
if (qualident != null && qualident.Length > 0) { if (qualident != null && qualident.Length > 0) {
string name = (alias != null && alias != "global") ? alias + "." + qualident : qualident;
INode node; INode node;
if (aliasedType != null) { if (aliasedType != null) {
node = new UsingDeclaration(qualident, aliasedType); node = new UsingDeclaration(name, aliasedType);
} else { } else {
node = new UsingDeclaration(qualident); node = new UsingDeclaration(name);
} }
node.StartLocation = startPos; node.StartLocation = startPos;
node.EndLocation = t.EndLocation; node.EndLocation = t.EndLocation;

Loading…
Cancel
Save