MCPcopy Create free account
hub / github.com/cogentcore/core / AddAST

Method AddAST

parse/parser/state.go:280–285  ·  view source on GitHub ↗

AddAST adds a child AST node to given parent AST node

(parAST *AST, rule string, reg lexer.Reg)

Source from the content-addressed store, hash-verified

278
279// AddAST adds a child AST node to given parent AST node
280func (ps *State) AddAST(parAST *AST, rule string, reg lexer.Reg) *AST {
281 chAST := NewAST(parAST)
282 chAST.SetName(rule)
283 chAST.SetTokReg(reg, ps.Src)
284 return chAST
285}
286
287///////////////////////////////////////////////////////////////////////////
288// Match State, Stack

Callers 2

ParseRulesMethod · 0.80
DoRulesMethod · 0.80

Calls 3

SetTokRegMethod · 0.95
NewASTFunction · 0.85
SetNameMethod · 0.65

Tested by

no test coverage detected