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

Method Destroy

parse/parser/state.go:85–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

83}
84
85func (ps *State) Destroy() {
86 if ps.AST != nil && ps.AST.This != nil {
87 ps.AST.DeleteChildren()
88 }
89 ps.AST = nil
90 ps.ClearAST()
91 ps.Syms.Reset()
92 ps.Scopes.Reset()
93 ps.Stack.Reset()
94 if ps.Src != nil {
95 ps.Pos, _ = ps.Src.ValidTokenPos(lexer.PosZero)
96 }
97 ps.Errs.Reset()
98 ps.Trace.Init()
99}
100
101// AllocRules allocate the match, nonmatch rule state in correspondence with the src state
102func (ps *State) AllocRules() {

Callers

nothing calls this directly

Calls 5

ClearASTMethod · 0.95
DeleteChildrenMethod · 0.80
ValidTokenPosMethod · 0.80
InitMethod · 0.65
ResetMethod · 0.45

Tested by

no test coverage detected