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

Function NewToken

shell/token.go:35–41  ·  view source on GitHub ↗

NewToken returns a new token, for generated tokens without Pos

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

Source from the content-addressed store, hash-verified

33
34// NewToken returns a new token, for generated tokens without Pos
35func NewToken(tok token.Token, str ...string) *Token {
36 tk := &Token{Tok: tok}
37 if len(str) > 0 {
38 tk.Str = str[0]
39 }
40 return tk
41}
42
43// Add adds a new token, for generated tokens without Pos
44func (tk *Tokens) Add(tok token.Token, str ...string) *Token {

Callers 2

AddMethod · 0.85
InsertMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected