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)
| 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. |
nothing calls this directly
no test coverage detected