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

Method newKeyword

src/main/java/org/codehaus/groovy/syntax/Token.java:273–279  ·  view source on GitHub ↗

Factory method to create a keyword token if the given text represents a known keyword. @param text the text to check as a keyword @param startLine the source line number (1-based) @param startColumn the source column number (1-based) @return a Token with the appropriate keyword type, or {@code null

(final String text, final int startLine, final int startColumn)

Source from the content-addressed store, hash-verified

271 * @return a Token with the appropriate keyword type, or {@code null} if the text is not a keyword
272 */
273 public static Token newKeyword(final String text, final int startLine, final int startColumn) {
274 int type = Types.lookupKeyword(text);
275 if (type != Types.UNKNOWN) {
276 return new Token(type, text, startLine, startColumn);
277 }
278 return null;
279 }
280
281 /**
282 * Factory method to create a string literal token.

Callers

nothing calls this directly

Calls 1

lookupKeywordMethod · 0.95

Tested by

no test coverage detected