-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuiltin.go
52 lines (49 loc) · 1.35 KB
/
builtin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package references
var builtins map[string]struct{} = map[string]struct{}{
"bool": struct{}{},
"true": struct{}{},
"false": struct{}{},
"uint8": struct{}{},
"uint16": struct{}{},
"uint32": struct{}{},
"uint64": struct{}{},
"int8": struct{}{},
"int16": struct{}{},
"int32": struct{}{},
"int64": struct{}{},
"float32": struct{}{},
"float64": struct{}{},
"complex64": struct{}{},
"complex128": struct{}{},
"string": struct{}{},
"int": struct{}{},
"uint": struct{}{},
"uintptr": struct{}{},
"byte": struct{}{},
"rune": struct{}{},
"Type": struct{}{},
"Type1": struct{}{},
"IntegerType": struct{}{},
"FloatType": struct{}{},
"ComplexType": struct{}{},
"append": struct{}{},
"copy": struct{}{},
"delete": struct{}{},
"len": struct{}{},
"cap": struct{}{},
"make": struct{}{},
"new": struct{}{},
"complex": struct{}{},
"real": struct{}{},
"imag": struct{}{},
"close": struct{}{},
"panic": struct{}{},
"recover": struct{}{},
"print": struct{}{},
"println": struct{}{},
"error": struct{}{},
}
func isBuiltin(ident string) bool {
_, ok := builtins[ident]
return ok
}