Exemplo n.º 1
0
// scopeVariableStatement scopes a variable statement in the SRG.
func (sb *scopeBuilder) scopeVariableStatement(node compilergraph.GraphNode, context scopeContext) proto.ScopeInfo {
	return sb.scopeDeclaredValue(node, "Variable", requiresInitializer, compilergraph.Predicate(parser.NodeVariableStatementExpression), context)
}
Exemplo n.º 2
0
// scopeVariable scopes a variable module member in the SRG.
func (sb *scopeBuilder) scopeVariable(node compilergraph.GraphNode, context scopeContext) proto.ScopeInfo {
	return sb.scopeDeclaredValue(node, "Variable", requiresInitializer, compilergraph.Predicate(parser.NodePredicateTypeFieldDefaultValue), context)
}
Exemplo n.º 3
0
// Connect connects an IRG AST node to another IRG AST node.
func (ast *irgASTNode) Connect(predicate string, other parser.AstNode) parser.AstNode {
	ast.graphNode.Connect(compilergraph.Predicate(predicate), other.(*irgASTNode).graphNode)
	return ast
}
Exemplo n.º 4
0
// DecorateWith decorates an IRG AST node with the given int value.
func (ast *irgASTNode) DecorateWithInt(predicate string, value int) parser.AstNode {
	ast.graphNode.DecorateWith(compilergraph.Predicate(predicate), value)
	return ast
}
Exemplo n.º 5
0
// Decorate decorates an SRG AST node with the given value.
func (ast *srgASTNode) Decorate(predicate string, value string) parser.AstNode {
	ast.graphNode.Decorate(compilergraph.Predicate(predicate), value)
	return ast
}