Move parent setting to constructor
This commit is contained in:
parent
fa3d137fbe
commit
5e7a4840b5
@ -6,16 +6,6 @@ namespace Parser
|
|||||||
{
|
{
|
||||||
public class SyntaxFactory
|
public class SyntaxFactory
|
||||||
{
|
{
|
||||||
private static T SetParent<T>(T parent) where T : SyntaxNode
|
|
||||||
{
|
|
||||||
foreach (var node in parent.Children)
|
|
||||||
{
|
|
||||||
node.Parent = parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
return parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<SyntaxNode> RemoveNulls(List<SyntaxNode> children)
|
private static List<SyntaxNode> RemoveNulls(List<SyntaxNode> children)
|
||||||
{
|
{
|
||||||
return children.Where(x => x != null).ToList();
|
return children.Where(x => x != null).ToList();
|
||||||
@ -40,8 +30,7 @@ namespace Parser
|
|||||||
end,
|
end,
|
||||||
semicolonOrComma
|
semicolonOrComma
|
||||||
};
|
};
|
||||||
var result =
|
return new FunctionDeclarationNode(
|
||||||
new FunctionDeclarationNode(
|
|
||||||
RemoveNulls(children),
|
RemoveNulls(children),
|
||||||
functionKeyword,
|
functionKeyword,
|
||||||
outputDescription,
|
outputDescription,
|
||||||
@ -50,7 +39,6 @@ namespace Parser
|
|||||||
body,
|
body,
|
||||||
end,
|
end,
|
||||||
semicolonOrComma);
|
semicolonOrComma);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FunctionOutputDescriptionNode FunctionOutputDescription(
|
public FunctionOutputDescriptionNode FunctionOutputDescription(
|
||||||
@ -59,7 +47,7 @@ namespace Parser
|
|||||||
{
|
{
|
||||||
var children = new List<SyntaxNode>(nodes);
|
var children = new List<SyntaxNode>(nodes);
|
||||||
children.Add(equalitySign);
|
children.Add(equalitySign);
|
||||||
var result = new FunctionOutputDescriptionNode(
|
return new FunctionOutputDescriptionNode(
|
||||||
children,
|
children,
|
||||||
children
|
children
|
||||||
.Where(node => node is TokenNode tokenNode && tokenNode.Token.Kind == TokenKind.Identifier)
|
.Where(node => node is TokenNode tokenNode && tokenNode.Token.Kind == TokenKind.Identifier)
|
||||||
@ -67,25 +55,22 @@ namespace Parser
|
|||||||
.ToList(),
|
.ToList(),
|
||||||
equalitySign
|
equalitySign
|
||||||
);
|
);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ParameterListNode ParameterList(List<SyntaxNode> nodes)
|
public ParameterListNode ParameterList(List<SyntaxNode> nodes)
|
||||||
{
|
{
|
||||||
var result = new ParameterListNode(
|
return new ParameterListNode(
|
||||||
nodes,
|
nodes,
|
||||||
nodes
|
nodes
|
||||||
.Where(
|
.Where(
|
||||||
node => node is TokenNode tokenNode && tokenNode.Token.Kind != TokenKind.Comma
|
node => node is TokenNode tokenNode && tokenNode.Token.Kind != TokenKind.Comma
|
||||||
)
|
)
|
||||||
.ToList());
|
.ToList());
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public StatementListNode StatementList(List<SyntaxNode> nodes)
|
public StatementListNode StatementList(List<SyntaxNode> nodes)
|
||||||
{
|
{
|
||||||
var result = new StatementListNode(nodes);
|
return new StatementListNode(nodes);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FunctionInputDescriptionNode FunctionInputDescription(
|
public FunctionInputDescriptionNode FunctionInputDescription(
|
||||||
@ -99,8 +84,7 @@ namespace Parser
|
|||||||
parameterList,
|
parameterList,
|
||||||
closingBracket
|
closingBracket
|
||||||
};
|
};
|
||||||
var result = new FunctionInputDescriptionNode(children, openingBracket, parameterList, closingBracket);
|
return new FunctionInputDescriptionNode(children, openingBracket, parameterList, closingBracket);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TokenNode Token(Token token)
|
public TokenNode Token(Token token)
|
||||||
@ -122,7 +106,7 @@ namespace Parser
|
|||||||
children.Add(endKeyword);
|
children.Add(endKeyword);
|
||||||
children.Add(semicolonOrComma);
|
children.Add(semicolonOrComma);
|
||||||
|
|
||||||
var result = new SwitchStatementNode(
|
return new SwitchStatementNode(
|
||||||
RemoveNulls(children),
|
RemoveNulls(children),
|
||||||
switchKeyword,
|
switchKeyword,
|
||||||
switchExpression,
|
switchExpression,
|
||||||
@ -130,7 +114,6 @@ namespace Parser
|
|||||||
endKeyword,
|
endKeyword,
|
||||||
semicolonOrComma,
|
semicolonOrComma,
|
||||||
optionalCommasAfterExpression);
|
optionalCommasAfterExpression);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SwitchCaseNode SwitchCase(
|
public SwitchCaseNode SwitchCase(
|
||||||
@ -146,13 +129,12 @@ namespace Parser
|
|||||||
};
|
};
|
||||||
children.AddRange(optionalCommasAfterIdentifier);
|
children.AddRange(optionalCommasAfterIdentifier);
|
||||||
children.Add(statementList);
|
children.Add(statementList);
|
||||||
var result = new SwitchCaseNode(
|
return new SwitchCaseNode(
|
||||||
RemoveNulls(children),
|
RemoveNulls(children),
|
||||||
caseKeyword,
|
caseKeyword,
|
||||||
caseIdentifier,
|
caseIdentifier,
|
||||||
statementList,
|
statementList,
|
||||||
optionalCommasAfterIdentifier);
|
optionalCommasAfterIdentifier);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AssignmentExpressionNode AssignmentExpression(
|
public AssignmentExpressionNode AssignmentExpression(
|
||||||
@ -166,8 +148,7 @@ namespace Parser
|
|||||||
assignmentSign,
|
assignmentSign,
|
||||||
rhs
|
rhs
|
||||||
};
|
};
|
||||||
var result = new AssignmentExpressionNode(children, lhs, assignmentSign, rhs);
|
return new AssignmentExpressionNode(children, lhs, assignmentSign, rhs);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public UnaryPrefixOperationExpressionNode UnaryPrefixOperationExpression(
|
public UnaryPrefixOperationExpressionNode UnaryPrefixOperationExpression(
|
||||||
@ -179,8 +160,7 @@ namespace Parser
|
|||||||
operation,
|
operation,
|
||||||
operand
|
operand
|
||||||
};
|
};
|
||||||
var result = new UnaryPrefixOperationExpressionNode(children, operation, operand);
|
return new UnaryPrefixOperationExpressionNode(children, operation, operand);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public UnaryPostfixOperationExpressionNode UnaryPostfixOperationExpression(
|
public UnaryPostfixOperationExpressionNode UnaryPostfixOperationExpression(
|
||||||
@ -192,8 +172,7 @@ namespace Parser
|
|||||||
operand,
|
operand,
|
||||||
operation
|
operation
|
||||||
};
|
};
|
||||||
var result = new UnaryPostfixOperationExpressionNode(children, operand, operation);
|
return new UnaryPostfixOperationExpressionNode(children, operand, operation);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BinaryOperationExpressionNode BinaryOperationExpression(
|
public BinaryOperationExpressionNode BinaryOperationExpression(
|
||||||
@ -207,8 +186,7 @@ namespace Parser
|
|||||||
operation,
|
operation,
|
||||||
rhs
|
rhs
|
||||||
};
|
};
|
||||||
var result = new BinaryOperationExpressionNode(children, lhs, operation, rhs);
|
return new BinaryOperationExpressionNode(children, lhs, operation, rhs);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IdentifierNameNode IdentifierName(
|
public IdentifierNameNode IdentifierName(
|
||||||
@ -244,15 +222,13 @@ namespace Parser
|
|||||||
public ExpressionStatementNode ExpressionStatement(ExpressionNode expression)
|
public ExpressionStatementNode ExpressionStatement(ExpressionNode expression)
|
||||||
{
|
{
|
||||||
var children = new List<SyntaxNode> {expression};
|
var children = new List<SyntaxNode> {expression};
|
||||||
var result = new ExpressionStatementNode(children, expression, null);
|
return new ExpressionStatementNode(children, expression, null);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExpressionStatementNode ExpressionStatement(ExpressionNode expression, TokenNode semicolonOrComma)
|
public ExpressionStatementNode ExpressionStatement(ExpressionNode expression, TokenNode semicolonOrComma)
|
||||||
{
|
{
|
||||||
var children = new List<SyntaxNode> {expression, semicolonOrComma};
|
var children = new List<SyntaxNode> {expression, semicolonOrComma};
|
||||||
var result = new ExpressionStatementNode(children, expression, semicolonOrComma);
|
return new ExpressionStatementNode(children, expression, semicolonOrComma);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CellArrayElementAccessExpressionNode CellArrayElementAccessExpression(
|
public CellArrayElementAccessExpressionNode CellArrayElementAccessExpression(
|
||||||
@ -262,13 +238,12 @@ namespace Parser
|
|||||||
TokenNode closingBrace)
|
TokenNode closingBrace)
|
||||||
{
|
{
|
||||||
var children = new List<SyntaxNode> {cellArray, openingBrace, indices, closingBrace};
|
var children = new List<SyntaxNode> {cellArray, openingBrace, indices, closingBrace};
|
||||||
var result = new CellArrayElementAccessExpressionNode(
|
return new CellArrayElementAccessExpressionNode(
|
||||||
children,
|
children,
|
||||||
cellArray,
|
cellArray,
|
||||||
openingBrace,
|
openingBrace,
|
||||||
indices,
|
indices,
|
||||||
closingBrace);
|
closingBrace);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FunctionCallExpressionNode FunctionCallExpression(
|
public FunctionCallExpressionNode FunctionCallExpression(
|
||||||
@ -284,43 +259,39 @@ namespace Parser
|
|||||||
parameters,
|
parameters,
|
||||||
closingBracket
|
closingBracket
|
||||||
};
|
};
|
||||||
var result = new FunctionCallExpressionNode(
|
return new FunctionCallExpressionNode(
|
||||||
children,
|
children,
|
||||||
functionName,
|
functionName,
|
||||||
openingBracket,
|
openingBracket,
|
||||||
parameters,
|
parameters,
|
||||||
closingBracket);
|
closingBracket);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FunctionCallParameterListNode FunctionCallParameterList(List<SyntaxNode> nodes)
|
public FunctionCallParameterListNode FunctionCallParameterList(List<SyntaxNode> nodes)
|
||||||
{
|
{
|
||||||
var result = new FunctionCallParameterListNode(
|
return new FunctionCallParameterListNode(
|
||||||
nodes,
|
nodes,
|
||||||
nodes
|
nodes
|
||||||
.OfType<ExpressionNode>()
|
.OfType<ExpressionNode>()
|
||||||
.ToList());
|
.ToList());
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayElementListNode ArrayElementList(List<SyntaxNode> nodes)
|
public ArrayElementListNode ArrayElementList(List<SyntaxNode> nodes)
|
||||||
{
|
{
|
||||||
var result = new ArrayElementListNode(
|
return new ArrayElementListNode(
|
||||||
nodes,
|
nodes,
|
||||||
nodes
|
nodes
|
||||||
.OfType<ExpressionNode>()
|
.OfType<ExpressionNode>()
|
||||||
.ToList());
|
.ToList());
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CompoundNameNode CompoundName(List<SyntaxNode> nodes)
|
public CompoundNameNode CompoundName(List<SyntaxNode> nodes)
|
||||||
{
|
{
|
||||||
var result = new CompoundNameNode(
|
return new CompoundNameNode(
|
||||||
nodes,
|
nodes,
|
||||||
nodes
|
nodes
|
||||||
.OfType<IdentifierNameNode>()
|
.OfType<IdentifierNameNode>()
|
||||||
.ToList());
|
.ToList());
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayLiteralExpressionNode ArrayLiteralExpression(
|
public ArrayLiteralExpressionNode ArrayLiteralExpression(
|
||||||
@ -334,12 +305,11 @@ namespace Parser
|
|||||||
elements,
|
elements,
|
||||||
closingSquareBracket
|
closingSquareBracket
|
||||||
};
|
};
|
||||||
var result = new ArrayLiteralExpressionNode(
|
return new ArrayLiteralExpressionNode(
|
||||||
children,
|
children,
|
||||||
openingSquareBracket,
|
openingSquareBracket,
|
||||||
elements,
|
elements,
|
||||||
closingSquareBracket);
|
closingSquareBracket);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CellArrayLiteralExpressionNode CellArrayLiteralExpression(
|
public CellArrayLiteralExpressionNode CellArrayLiteralExpression(
|
||||||
@ -353,12 +323,11 @@ namespace Parser
|
|||||||
elements,
|
elements,
|
||||||
closingBrace
|
closingBrace
|
||||||
};
|
};
|
||||||
var result = new CellArrayLiteralExpressionNode(
|
return new CellArrayLiteralExpressionNode(
|
||||||
children,
|
children,
|
||||||
openingBrace,
|
openingBrace,
|
||||||
elements,
|
elements,
|
||||||
closingBrace);
|
closingBrace);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public EmptyExpressionNode EmptyExpression()
|
public EmptyExpressionNode EmptyExpression()
|
||||||
@ -377,12 +346,11 @@ namespace Parser
|
|||||||
dot,
|
dot,
|
||||||
rightOperand
|
rightOperand
|
||||||
};
|
};
|
||||||
var result = new MemberAccessNode(
|
return new MemberAccessNode(
|
||||||
children,
|
children,
|
||||||
leftOperand,
|
leftOperand,
|
||||||
dot,
|
dot,
|
||||||
rightOperand);
|
rightOperand);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public WhileStatementNode WhileStatement(
|
public WhileStatementNode WhileStatement(
|
||||||
@ -402,7 +370,7 @@ namespace Parser
|
|||||||
children.Add(body);
|
children.Add(body);
|
||||||
children.Add(end);
|
children.Add(end);
|
||||||
children.Add(semicolonOrComma);
|
children.Add(semicolonOrComma);
|
||||||
var result = new WhileStatementNode(
|
return new WhileStatementNode(
|
||||||
RemoveNulls(children),
|
RemoveNulls(children),
|
||||||
whileKeyword,
|
whileKeyword,
|
||||||
condition,
|
condition,
|
||||||
@ -410,7 +378,6 @@ namespace Parser
|
|||||||
body,
|
body,
|
||||||
end,
|
end,
|
||||||
semicolonOrComma);
|
semicolonOrComma);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public StatementNode AppendSemicolonOrComma(StatementNode statement, TokenNode semicolonOrComma)
|
public StatementNode AppendSemicolonOrComma(StatementNode statement, TokenNode semicolonOrComma)
|
||||||
@ -441,7 +408,7 @@ namespace Parser
|
|||||||
children.Add(elseBody);
|
children.Add(elseBody);
|
||||||
children.Add(endKeyword);
|
children.Add(endKeyword);
|
||||||
|
|
||||||
var result = new IfStatementNode(
|
return new IfStatementNode(
|
||||||
RemoveNulls(children),
|
RemoveNulls(children),
|
||||||
ifKeyword,
|
ifKeyword,
|
||||||
condition,
|
condition,
|
||||||
@ -450,7 +417,6 @@ namespace Parser
|
|||||||
elseKeyword,
|
elseKeyword,
|
||||||
elseBody,
|
elseBody,
|
||||||
endKeyword);
|
endKeyword);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ParenthesizedExpressionNode ParenthesizedExpression(
|
public ParenthesizedExpressionNode ParenthesizedExpression(
|
||||||
@ -464,12 +430,11 @@ namespace Parser
|
|||||||
expression,
|
expression,
|
||||||
closeParen
|
closeParen
|
||||||
};
|
};
|
||||||
var result = new ParenthesizedExpressionNode(
|
return new ParenthesizedExpressionNode(
|
||||||
children,
|
children,
|
||||||
openParen,
|
openParen,
|
||||||
expression,
|
expression,
|
||||||
closeParen);
|
closeParen);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ForStatementNode ForStatement(
|
public ForStatementNode ForStatement(
|
||||||
@ -487,14 +452,13 @@ namespace Parser
|
|||||||
children.AddRange(optionalCommasAfterAssignment);
|
children.AddRange(optionalCommasAfterAssignment);
|
||||||
children.Add(body);
|
children.Add(body);
|
||||||
children.Add(endKeyword);
|
children.Add(endKeyword);
|
||||||
var result = new ForStatementNode(
|
return new ForStatementNode(
|
||||||
RemoveNulls(children),
|
RemoveNulls(children),
|
||||||
forKeyword,
|
forKeyword,
|
||||||
forAssignment,
|
forAssignment,
|
||||||
body,
|
body,
|
||||||
endKeyword,
|
endKeyword,
|
||||||
optionalCommasAfterAssignment);
|
optionalCommasAfterAssignment);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IndirectMemberAccessNode IndirectMemberAccess(
|
public IndirectMemberAccessNode IndirectMemberAccess(
|
||||||
@ -508,14 +472,13 @@ namespace Parser
|
|||||||
indirectMemberName,
|
indirectMemberName,
|
||||||
closingBracket
|
closingBracket
|
||||||
};
|
};
|
||||||
var result = new IndirectMemberAccessNode(
|
return new IndirectMemberAccessNode(
|
||||||
children,
|
children,
|
||||||
openingBracket,
|
openingBracket,
|
||||||
indirectMemberName,
|
indirectMemberName,
|
||||||
closingBracket);
|
closingBracket);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public NamedFunctionHandleNode NamedFunctionHandle(
|
public NamedFunctionHandleNode NamedFunctionHandle(
|
||||||
TokenNode atSign,
|
TokenNode atSign,
|
||||||
CompoundNameNode functionName)
|
CompoundNameNode functionName)
|
||||||
@ -525,11 +488,10 @@ namespace Parser
|
|||||||
atSign,
|
atSign,
|
||||||
functionName
|
functionName
|
||||||
};
|
};
|
||||||
var result = new NamedFunctionHandleNode(
|
return new NamedFunctionHandleNode(
|
||||||
children,
|
children,
|
||||||
atSign,
|
atSign,
|
||||||
functionName);
|
functionName);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LambdaNode Lambda(
|
public LambdaNode Lambda(
|
||||||
@ -543,12 +505,11 @@ namespace Parser
|
|||||||
input,
|
input,
|
||||||
body
|
body
|
||||||
};
|
};
|
||||||
var result = new LambdaNode(
|
return new LambdaNode(
|
||||||
children,
|
children,
|
||||||
atSign,
|
atSign,
|
||||||
input,
|
input,
|
||||||
body);
|
body);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TryCatchStatementNode TryCatchStatement(
|
public TryCatchStatementNode TryCatchStatement(
|
||||||
@ -566,14 +527,13 @@ namespace Parser
|
|||||||
catchBody,
|
catchBody,
|
||||||
endKeyword
|
endKeyword
|
||||||
};
|
};
|
||||||
var result = new TryCatchStatementNode(
|
return new TryCatchStatementNode(
|
||||||
children,
|
children,
|
||||||
tryKeyword,
|
tryKeyword,
|
||||||
tryBody,
|
tryBody,
|
||||||
catchKeyword,
|
catchKeyword,
|
||||||
catchBody,
|
catchBody,
|
||||||
endKeyword);
|
endKeyword);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TryCatchStatementNode TryCatchStatement(
|
public TryCatchStatementNode TryCatchStatement(
|
||||||
@ -587,14 +547,13 @@ namespace Parser
|
|||||||
tryBody,
|
tryBody,
|
||||||
endKeyword
|
endKeyword
|
||||||
};
|
};
|
||||||
var result = new TryCatchStatementNode(
|
return new TryCatchStatementNode(
|
||||||
children,
|
children,
|
||||||
tryKeyword,
|
tryKeyword,
|
||||||
tryBody,
|
tryBody,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
endKeyword);
|
endKeyword);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CommandExpressionNode CommandExpression(
|
public CommandExpressionNode CommandExpression(
|
||||||
@ -606,11 +565,10 @@ namespace Parser
|
|||||||
identifierName
|
identifierName
|
||||||
};
|
};
|
||||||
children.AddRange(arguments);
|
children.AddRange(arguments);
|
||||||
var result = new CommandExpressionNode(
|
return new CommandExpressionNode(
|
||||||
children,
|
children,
|
||||||
identifierName,
|
identifierName,
|
||||||
arguments);
|
arguments);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseClassInvokationNode BaseClassInvokation(
|
public BaseClassInvokationNode BaseClassInvokation(
|
||||||
@ -624,12 +582,11 @@ namespace Parser
|
|||||||
atToken,
|
atToken,
|
||||||
baseClassNameAndArguments
|
baseClassNameAndArguments
|
||||||
};
|
};
|
||||||
var result = new BaseClassInvokationNode(
|
return new BaseClassInvokationNode(
|
||||||
children,
|
children,
|
||||||
methodName,
|
methodName,
|
||||||
atToken,
|
atToken,
|
||||||
baseClassNameAndArguments);
|
baseClassNameAndArguments);
|
||||||
return SetParent(result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -15,6 +15,13 @@ namespace Parser
|
|||||||
public SyntaxNode(List<SyntaxNode> children)
|
public SyntaxNode(List<SyntaxNode> children)
|
||||||
{
|
{
|
||||||
Children = children;
|
Children = children;
|
||||||
|
if (children != null)
|
||||||
|
{
|
||||||
|
foreach (var child in children)
|
||||||
|
{
|
||||||
|
child.Parent = this;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual string FullText =>
|
public virtual string FullText =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user