本文整理汇总了C#中CSharpParseOptions.WithFeatures方法的典型用法代码示例。如果您正苦于以下问题:C# CSharpParseOptions.WithFeatures方法的具体用法?C# CSharpParseOptions.WithFeatures怎么用?C# CSharpParseOptions.WithFeatures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSharpParseOptions
的用法示例。
在下文中一共展示了CSharpParseOptions.WithFeatures方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LexicalTests
public LexicalTests()
{
_options = new CSharpParseOptions(languageVersion: LanguageVersion.CSharp3);
var binaryLiterals = new[] { new KeyValuePair<string, string>("binaryLiterals", "true") };
var digitSeparators = new[] { new KeyValuePair<string, string>("digitSeparators", "true") };
_binaryOptions = _options.WithFeatures(binaryLiterals);
_underscoreOptions = _options.WithFeatures(digitSeparators);
_binaryUnderscoreOptions = _options.WithFeatures(binaryLiterals.Concat(digitSeparators));
}
示例2: ReadParseOptionsFrom
public override ParseOptions ReadParseOptionsFrom(ObjectReader reader, CancellationToken cancellationToken)
{
SourceCodeKind kind;
DocumentationMode documentationMode;
IEnumerable<KeyValuePair<string, string>> features;
ReadParseOptionsFrom(reader, out kind, out documentationMode, out features, cancellationToken);
var languageVersion = (LanguageVersion)reader.ReadInt32();
var preprocessorSymbolNames = reader.ReadArray<string>();
var options = new CSharpParseOptions(languageVersion, documentationMode, kind, preprocessorSymbolNames);
return options.WithFeatures(features);
}
示例3: ReadParseOptionsFrom
public override ParseOptions ReadParseOptionsFrom(ObjectReader reader, CancellationToken cancellationToken)
{
ReadParseOptionsFrom(reader, out var kind, out var documentationMode, out var features, cancellationToken);
var languageVersion = (LanguageVersion)reader.ReadInt32();
var preprocessorSymbolNames = reader.ReadArray<string>();
var options = new CSharpParseOptions(languageVersion, documentationMode, kind, preprocessorSymbolNames);
return options.WithFeatures(features);
}