本文整理汇总了C#中Microsoft.PythonTools.Parsing.Ast.Node.GetStart方法的典型用法代码示例。如果您正苦于以下问题:C# Node.GetStart方法的具体用法?C# Node.GetStart怎么用?C# Node.GetStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.PythonTools.Parsing.Ast.Node
的用法示例。
在下文中一共展示了Node.GetStart方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLoc
internal LocationInfo GetLoc(Node node) {
if (node == null || node.StartIndex >= node.EndIndex) {
return null;
}
var start = node.GetStart(_ast);
var end = node.GetEnd(_ast);
return new LocationInfo(_filePath, start.Line, start.Column, end.Line, end.Column);
}
示例2: UpdateLineInfo
private bool UpdateLineInfo(Node node, bool inheritCoverage = false) {
if (node == null) {
return false;
}
var start = node.GetStart(_ast);
var end = node.GetEnd(_ast);
bool covered;
bool multiline = false;
if (start.Line != end.Line) {
multiline = true;
// multi line statement, just figure out if we hit anywhere in it,
// and if so update our coverage state. We'll continue to descend
// and mark the individual items that make up the multiple lines.
bool isCovered = false;
for (int i = start.Line; i <= end.Line; i++) {
isCovered |= IsCovered(i);
}
covered = isCovered;
} else {
// single line statement
covered = MarkCoverage(inheritCoverage, start, end, IsCovered(start.Line));
}
if (_blockCovered == null) {
_blockCovered = covered;
if (covered) {
ReportCovered();
} else {
ReportNotCovered();
}
}
return multiline;
}