in src/Structure/BlockTaggerImpl/VbParser.cs [60:106]
protected override void ParseSyntaxNode(ITextSnapshot snapshot, SyntaxNode parentSyntaxNode, CodeBlock parentCodeBlockNode, CancellationToken token, int level)
{
if (token.IsCancellationRequested)
{
throw new TaskCanceledException();
}
else
{
foreach (var childnode in parentSyntaxNode.ChildNodes())
{
SyntaxKind kind = SyntaxKind.None;
int startPosition = 0;
int endPosition = 0;
int statementEndPosition = 0;
if (TryAsNamespace(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsClass(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsStruct(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsInterface(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsEnum(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsModule(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsMethod(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsProperty(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsPropertyAccessor(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsIf(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsElse(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsElseIf(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsFor(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsForEach(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsSelect(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsSelectCase(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsDo(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsWhile(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsTry(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsCatch(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsFinally(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsUsing(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition) ||
TryAsSyncLock(childnode, ref kind, ref startPosition, ref endPosition, ref statementEndPosition))
{
var statementStart = childnode.SpanStart;
string statement = StatementFromSpan(snapshot, startPosition, statementEndPosition);
CodeBlock child = CreateCodeBlock(parentCodeBlockNode, statement, kind, new SnapshotSpan(snapshot, Span.FromBounds(startPosition, endPosition)), statementStart, level + 1);
ParseSyntaxNode(snapshot, childnode, child, token, level + 1);
}
}
}
}