MCPcopy Create free account
hub / github.com/crossoverJie/gscript / ExitPrimitiveType

Method ExitPrimitiveType

resolver/type_resolver.go:191–212  ·  view source on GitHub ↗

ExitPrimitiveType 记录当前 ctx 的基本类型

(ctx *parser.PrimitiveTypeContext)

Source from the content-addressed store, hash-verified

189
190// ExitPrimitiveType 记录当前 ctx 的基本类型
191func (t *TypeResolver) ExitPrimitiveType(ctx *parser.PrimitiveTypeContext) {
192 var symbolType symbol.Type
193 if ctx.INT() != nil {
194 symbolType = symbol.Int
195 }
196 if ctx.STRING() != nil {
197 symbolType = symbol.String
198 }
199 if ctx.FLOAT() != nil {
200 symbolType = symbol.Float
201 }
202 if ctx.BOOLEAN() != nil {
203 symbolType = symbol.Bool
204 }
205 if ctx.ANY() != nil {
206 symbolType = symbol.Any
207 }
208 if ctx.BYTE() != nil {
209 symbolType = symbol.Byte
210 }
211 t.at.PutTypeOfNode(ctx, symbolType)
212}
213
214// ExitFunctionType 函数类型
215func (t *TypeResolver) ExitFunctionType(ctx *parser.FunctionTypeContext) {

Callers

nothing calls this directly

Calls 7

INTMethod · 0.80
STRINGMethod · 0.80
FLOATMethod · 0.80
BOOLEANMethod · 0.80
ANYMethod · 0.80
BYTEMethod · 0.80
PutTypeOfNodeMethod · 0.80

Tested by

no test coverage detected