func (t *SymbolTable) InternToken(symText string) SymbolToken {
	if tok, exists := t.textMap[symText]; exists {
		return tok
	}

	t.maxSID += 1
	var source *ImportSource = nil
	if t.kind != symbolTableKindLocal {
		// defining a token within a shared/system table makes the token have a source referring to its
		// own table and SID
		source = newSource(t.name, t.maxSID)
	}

	tok := SymbolToken{
		Text:     &symText,
		localSID: t.maxSID,
		Source:   source,
	}
	t.tokens = append(t.tokens, tok)
	t.textMap[symText] = tok
	return tok
}
// InternToken adds a symbol to the given table if it does not exist.
InternToken adds a symbol to the given table if it does not exist.
// InternToken adds a symbol to the given table if it does not exist .
func (t *SymbolTable) InternToken(symText string) SymbolToken {
	if tok, exists := t.textMap[symText]; exists {
		return tok
	}
	t.maxSID += 1
	var source *ImportSource = nil
	if t.kind != symbolTableKindLocal {
		source = newSource(t.name, t.maxSID)
	}
	tok := SymbolToken{
		Text:     &symText,
		localSID: t.maxSID,
		Source:   source,
	}
	t.tokens = append(t.tokens, tok)
	t.textMap[symText] = tok
	return tok
}
func ( t * SymbolTable ) InternToken ( symText string ) SymbolToken { if tok , exists := t . textMap [ symText ] ; exists { return tok } t . maxSID += 1 var source * ImportSource = nil if t . kind != symbolTableKindLocal { source = newSource ( t . name , t . maxSID ) } tok := SymbolToken { Text : & symText , localSID : t . maxSID , Source : source , } t . tokens = append ( t . tokens , tok ) t . textMap [ symText ] = tok return tok }
InternToken adds a symbol to the given table if it does not exist.
InternToken adds a symbol to the given table if it does not exist .
// defining a token within a shared/system table makes the token have a source referring to its // own table and SID