build: config spotless plugin and reformat code

This commit is contained in:
Frank.R.Wu
2023-06-15 11:08:04 +08:00
parent b60e81e1a1
commit 8e06d0bc81
7 changed files with 51 additions and 52 deletions

View File

@@ -3,8 +3,8 @@ package org.bdware.sc.parser;
import org.antlr.v4.runtime.*;
/**
* All parser methods that used in grammar (p, prev, notLineTerminator, etc.)
* should start with lower case char similar to parser rules.
* All parser methods that used in grammar (p, prev, notLineTerminator, etc.) should start with
* lower case char similar to parser rules.
*/
public abstract class JavaScriptBaseParser extends Parser {
public JavaScriptBaseParser(TokenStream input) {
@@ -53,12 +53,12 @@ public abstract class JavaScriptBaseParser extends Parser {
}
/**
* Returns {@code true} iff on the current index of the parser's token stream a
* token of the given {@code type} exists on the {@code HIDDEN} channel.
* Returns {@code true} iff on the current index of the parser's token stream a token of the
* given {@code type} exists on the {@code HIDDEN} channel.
*
* @param type the type of the token on the {@code HIDDEN} channel to check.
* @return {@code true} iff on the current index of the parser's token stream a
* token of the given {@code type} exists on the {@code HIDDEN} channel.
* @return {@code true} iff on the current index of the parser's token stream a token of the
* given {@code type} exists on the {@code HIDDEN} channel.
*/
private boolean here(final int type) {
@@ -72,14 +72,13 @@ public abstract class JavaScriptBaseParser extends Parser {
}
/**
* Returns {@code true} iff on the current index of the parser's token stream a
* token exists on the {@code HIDDEN} channel which either is a line terminator,
* or is a multi line comment that contains a line terminator.
* Returns {@code true} iff on the current index of the parser's token stream a token exists on
* the {@code HIDDEN} channel which either is a line terminator, or is a multi line comment that
* contains a line terminator.
*
* @return {@code true} iff on the current index of the parser's token stream a
* token exists on the {@code HIDDEN} channel which either is a line
* terminator, or is a multi line comment that contains a line
* terminator.
* @return {@code true} iff on the current index of the parser's token stream a token exists on
* the {@code HIDDEN} channel which either is a line terminator, or is a multi line
* comment that contains a line terminator.
*/
protected boolean lineTerminatorAhead() {
@@ -111,4 +110,4 @@ public abstract class JavaScriptBaseParser extends Parser {
return (type == YJSParser.MultiLineComment && (text.contains("\r") || text.contains("\n")))
|| (type == YJSParser.LineTerminator);
}
}
}