Skip to content

Commit 7a5b489

Browse files
committed
Add Golang Consts: predeclared identifiers, blank identifier
1 parent 8ce7336 commit 7a5b489

File tree

3 files changed

+72
-58
lines changed

3 files changed

+72
-58
lines changed

src/org/opensolaris/opengrok/analysis/golang/Consts.java

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
/*
2121
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
22+
* Portions Copyright (c) 2017, Chris Fraire <[email protected]>.
2223
*/
2324

2425
package org.opensolaris.opengrok.analysis.golang;
@@ -60,5 +61,50 @@ public class Consts {
6061
kwd.add("switch");
6162
kwd.add("type");
6263
kwd.add("var");
64+
65+
kwd.add("_"); // Blank identifier
66+
67+
kwd.add("bool"); // Predeclared identifiers: Types
68+
kwd.add("byte"); // Predeclared identifiers: Types
69+
kwd.add("complex64"); // Predeclared identifiers: Types
70+
kwd.add("complex128"); // Predeclared identifiers: Types
71+
kwd.add("error"); // Predeclared identifiers: Types
72+
kwd.add("float32"); // Predeclared identifiers: Types
73+
kwd.add("float64"); // Predeclared identifiers: Types
74+
kwd.add("int"); // Predeclared identifiers: Types
75+
kwd.add("int8"); // Predeclared identifiers: Types
76+
kwd.add("int16"); // Predeclared identifiers: Types
77+
kwd.add("int32"); // Predeclared identifiers: Types
78+
kwd.add("int64"); // Predeclared identifiers: Types
79+
kwd.add("rune"); // Predeclared identifiers: Types
80+
kwd.add("string"); // Predeclared identifiers: Types
81+
kwd.add("uint"); // Predeclared identifiers: Types
82+
kwd.add("uint8"); // Predeclared identifiers: Types
83+
kwd.add("uint16"); // Predeclared identifiers: Types
84+
kwd.add("uint32"); // Predeclared identifiers: Types
85+
kwd.add("uint64"); // Predeclared identifiers: Types
86+
kwd.add("uintptr"); // Predeclared identifiers: Types
87+
88+
kwd.add("true"); // Predeclared identifiers: Constants
89+
kwd.add("false"); // Predeclared identifiers: Constants
90+
kwd.add("iota"); // Predeclared identifiers: Constants
91+
92+
kwd.add("nil"); // Predeclared identifiers: Zero value
93+
94+
kwd.add("append"); // Predeclared identifiers: Functions
95+
kwd.add("cap"); // Predeclared identifiers: Functions
96+
kwd.add("close"); // Predeclared identifiers: Functions
97+
kwd.add("complex"); // Predeclared identifiers: Functions
98+
kwd.add("copy"); // Predeclared identifiers: Functions
99+
kwd.add("delete"); // Predeclared identifiers: Functions
100+
kwd.add("imag"); // Predeclared identifiers: Functions
101+
kwd.add("len"); // Predeclared identifiers: Functions
102+
kwd.add("make"); // Predeclared identifiers: Functions
103+
kwd.add("new"); // Predeclared identifiers: Functions
104+
kwd.add("panic"); // Predeclared identifiers: Functions
105+
kwd.add("print"); // Predeclared identifiers: Functions
106+
kwd.add("println"); // Predeclared identifiers: Functions
107+
kwd.add("real"); // Predeclared identifiers: Functions
108+
kwd.add("recover"); // Predeclared identifiers: Functions
63109
}
64110
}

0 commit comments

Comments
 (0)