コード例 #1
0
func NewVarIDNode(identToken attrib) (vari.VarID, error) {
	sourcePosInfo := identToken.(*token.Token).Pos
	identifierString := string(identToken.(*token.Token).Lit)
	vari := vari.NewVarID(identifierString)
	vari.SetSourceInfo(sourcePosInfo)
	return vari, nil
}
コード例 #2
0
func NewVarDeclNode(ident attrib, typeIdent attrib, sourcePosInfo attrib) (interfaces.VarDecl, error) {
	vari := vari.NewVarDecl(ident.(interfaces.VarID), typeIdent.(interfaces.ValueType))
	vari.SetSourceInfo(sourcePosInfo.(token.Pos))
	return vari, nil
}