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

Method SetTokReg

parse/parser/ast.go:92–96  ·  view source on GitHub ↗

SetTokReg sets the token region for this rule to given region

(reg lexer.Reg, src *lexer.File)

Source from the content-addressed store, hash-verified

90
91// SetTokReg sets the token region for this rule to given region
92func (ast *AST) SetTokReg(reg lexer.Reg, src *lexer.File) {
93 ast.TokReg = reg
94 ast.SrcReg = src.TokenSrcReg(ast.TokReg)
95 ast.Src = src.RegSrc(ast.SrcReg)
96}
97
98// SetTokRegEnd updates the ending token region to given position --
99// token regions are typically over-extended and get narrowed as tokens actually match

Callers 1

AddASTMethod · 0.95

Calls 2

TokenSrcRegMethod · 0.80
RegSrcMethod · 0.80

Tested by

no test coverage detected