Example #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)
}
Example #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)
}
Example #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
}
Example #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
}
Example #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
}