Browse Source

* Src/Lexer/ILexer.cs:

* Src/Lexer/CSharp/Lexer.cs:
* Src/Lexer/AbstractLexer.cs: Added SetConditionalCompilationSymbols
  method.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3866 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Mike Krüger 17 years ago
parent
commit
f5e37276c2
  1. 15
      src/Libraries/NRefactory/Project/Src/Lexer/AbstractLexer.cs
  2. 8
      src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs
  3. 8
      src/Libraries/NRefactory/Project/Src/Lexer/ILexer.cs

15
src/Libraries/NRefactory/Project/Src/Lexer/AbstractLexer.cs

@ -46,6 +46,21 @@ namespace ICSharpCode.NRefactory.Parser @@ -46,6 +46,21 @@ namespace ICSharpCode.NRefactory.Parser
get { throw new NotSupportedException(); }
}
protected static IEnumerable<string> GetSymbols (string symbols)
{
foreach (string symbol in symbols.Split (';')) {
string s = symbol.Trim ();
if (s.Length == 0)
continue;
yield return s;
}
}
public virtual void SetConditionalCompilationSymbols (string symbols)
{
throw new NotSupportedException ();
}
protected int Line {
get {
return line;

8
src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs

@ -990,6 +990,14 @@ namespace ICSharpCode.NRefactory.Parser.CSharp @@ -990,6 +990,14 @@ namespace ICSharpCode.NRefactory.Parser.CSharp
get { return conditionalCompilation.Symbols; }
}
public override void SetConditionalCompilationSymbols (string symbols)
{
foreach (string symbol in GetSymbols (symbols)) {
conditionalCompilation.Define (symbol);
}
}
ConditionalCompilation conditionalCompilation = new ConditionalCompilation();
void ReadPreProcessingDirective()

8
src/Libraries/NRefactory/Project/Src/Lexer/ILexer.cs

@ -61,6 +61,14 @@ namespace ICSharpCode.NRefactory.Parser @@ -61,6 +61,14 @@ namespace ICSharpCode.NRefactory.Parser
/// </summary>
IDictionary<string, object> ConditionalCompilationSymbols { get; }
/// <summary>
/// Sets the conditional compilation symbols.
/// </summary>
/// <param name="symbols">
/// A <see cref="System.String"/> containing the symbols. The symbols are separated by ';'.
/// </param>
void SetConditionalCompilationSymbols (string symbols);
/// <summary>
/// Returns the comments that had been read and containing tag key words.
/// </summary>

Loading…
Cancel
Save