MCPcopy Index your code
hub / github.com/apache/groovy / lookup

Method lookup

src/main/java/org/codehaus/groovy/syntax/Types.java:1299–1310  ·  view source on GitHub ↗

Returns the token type for the specified symbol or keyword text. Returns #UNKNOWN if the text is not found. Optionally filters the result by type (e.g., restrict to keywords only). @param text the text to look up (e.g., "def", "+", "if") @param filter a type filter (#KEYWORD, {@link

(String text, int filter)

Source from the content-addressed store, hash-verified

1297 * @return the token type, or {@link #UNKNOWN} if not found or doesn't match the filter
1298 */
1299 public static int lookup(String text, int filter) {
1300 int type = UNKNOWN;
1301
1302 if (LOOKUP.containsKey(text)) {
1303 type = LOOKUP.get(text);
1304 if (filter != UNKNOWN && !ofType(type, filter)) {
1305 type = UNKNOWN;
1306 }
1307 }
1308
1309 return type;
1310 }
1311
1312
1313 /**

Callers 13

lookupKeywordMethod · 0.95
lookupSymbolMethod · 0.95
createGroovyTokenMethod · 0.95
newLookupMethod · 0.45
IndyCompoundAssignClass · 0.45
CacheableCallSiteClass · 0.45
IndyArrayAccessClass · 0.45
TypeTransformersClass · 0.45
ReflectionUtilsClass · 0.45
AtnManagerClass · 0.45
AsyncSupportClass · 0.45

Calls 3

ofTypeMethod · 0.95
containsKeyMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected