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

Method Insert

shell/token.go:57–61  ·  view source on GitHub ↗

Insert inserts a new token at given position

(i int, tok token.Token, str ...string)

Source from the content-addressed store, hash-verified

55
56// Insert inserts a new token at given position
57func (tk *Tokens) Insert(i int, tok token.Token, str ...string) *Token {
58 nt := NewToken(tok, str...)
59 *tk = slices.Insert(*tk, i, nt)
60 return nt
61}
62
63// Last returns the final token in the list
64func (tk Tokens) Last() *Token {

Callers 8

TranspileLineTokensMethod · 0.45
TranspileGoMethod · 0.45
CmdArgsMethod · 0.45
TranspileFileMethod · 0.45
addChooserPathsMethod · 0.45
InsertAtIndexMethod · 0.45
UpdateFunction · 0.45
MoveFunction · 0.45

Calls 1

NewTokenFunction · 0.85

Tested by

no test coverage detected