Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30f844d
commit 15cb49e
Showing
7 changed files
with
168 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
javaparser-core/src/main/java/com/github/javaparser/printer/TokenConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
package com.github.javaparser.printer; | ||
|
||
import com.github.javaparser.ASTParserConstants; | ||
|
||
/** | ||
* It complements ASTParserConstants | ||
*/ | ||
public class TokenConstants { | ||
public static int EOF_TOKEN = 0; | ||
public static int SPACE_TOKEN = 1; | ||
public static int NEWLINE_TOKEN = 3; | ||
|
||
public static boolean isWhitespace(int tokenType) { | ||
return tokenType == EOF_TOKEN || tokenType == NEWLINE_TOKEN || tokenType == SPACE_TOKEN; | ||
} | ||
|
||
public static boolean isWhitespaceOrComment(int tokenType) { | ||
return isWhitespace(tokenType) || isComment(tokenType); | ||
} | ||
|
||
public static boolean isComment(int tokenType) { | ||
return tokenType == ASTParserConstants.SINGLE_LINE_COMMENT | ||
|| tokenType == ASTParserConstants.MULTI_LINE_COMMENT | ||
|| tokenType == ASTParserConstants.JAVA_DOC_COMMENT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.