Browse Source

Escape contextual keywords within query expressions.

newNRvisualizers
Daniel Grunwald 15 years ago
parent
commit
ec42611f0e
  1. 16
      ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs

16
ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs

@ -306,10 +306,10 @@ namespace ICSharpCode.NRefactory.CSharp
"using", "virtual", "void", "volatile", "while" "using", "virtual", "void", "volatile", "while"
}; };
// static readonly HashSet<string> queryKeywords = new HashSet<string> { static readonly HashSet<string> queryKeywords = new HashSet<string> {
// "from", "where", "join", "on", "equals", "into", "let", "orderby", "from", "where", "join", "on", "equals", "into", "let", "orderby",
// "ascending", "descending", "select", "group", "by" "ascending", "descending", "select", "group", "by"
// }; };
/// <summary> /// <summary>
/// Determines whether the specified identifier is a keyword in the given context. /// Determines whether the specified identifier is a keyword in the given context.
@ -318,10 +318,10 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
if (unconditionalKeywords.Contains(identifier)) if (unconditionalKeywords.Contains(identifier))
return true; return true;
// if (context.Ancestors.Any(a => a is QueryExpression)) { if (context.Ancestors.Any(a => a is QueryExpression)) {
// if (queryKeywords.Contains(identifier)) if (queryKeywords.Contains(identifier))
// return true; return true;
// } }
return false; return false;
} }
#endregion #endregion

Loading…
Cancel
Save