Skip to content

Commit d3a9ef3

Browse files
committed
Upgrade googleJavaFormat to 1.35
1 parent 88d2092 commit d3a9ef3

5 files changed

Lines changed: 25 additions & 14 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ jobs:
3838
uses: gradle/actions/setup-gradle@v4
3939

4040
- name: Build and Test with Gradle
41-
run: ./gradlew build -x spotlessCheck
41+
run: ./gradlew build

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spotless {
4242
java {
4343
target("src/*/java/**/*.java")
4444

45-
googleJavaFormat("1.25.0")
45+
googleJavaFormat("1.35.0")
4646

4747
removeUnusedImports()
4848
trimTrailingWhitespace()

src/main/java/dev/askov/mjcompiler/CodeGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ public void generateMethodInvocationCode(Obj overriddenMethod) {
695695
}
696696
}
697697

698-
private class ThisParameterLoader extends CodeGenerator {
698+
private class ThisParameterLoader extends VisitorAdaptor {
699699

700700
@Override
701701
public void visit(IdentDesignator identDesignator) {

src/main/java/dev/askov/mjcompiler/MJCompiler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ public class MJCompiler {
4141

4242
private static final Logger LOGGER = LoggerFactory.getLogger(MJCompiler.class);
4343

44-
public static void tsdump() {
44+
public static void dumpSymbolTable() {
4545
MJTab.dump(LOGGER);
4646
}
4747

4848
public static void main(String[] args) throws Exception {
49-
if (args.length != 2) {
49+
if (args.length < 2) {
5050
LOGGER.error("Too few arguments. Usage: MJCompiler <source-file> <obj-file>");
5151
return;
5252
}
@@ -72,7 +72,7 @@ public static void main(String[] args) throws Exception {
7272
var semanticAnalyzer = new SemanticAnalyzer();
7373
program.traverseBottomUp(semanticAnalyzer);
7474

75-
tsdump();
75+
dumpSymbolTable();
7676

7777
if (!semanticAnalyzer.semanticErrorDetected()) {
7878

src/main/java/dev/askov/mjcompiler/mjsymboltable/MJTab.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@
3636
public class MJTab extends Tab {
3737

3838
public static final Struct BOOL_TYPE = new Struct(Struct.Bool);
39-
public static final String MAIN = "main", TRUE = "true", FALSE = "false";
39+
public static final Struct INT_ARRAY_TYPE = new Struct(Struct.Array, Tab.intType);
40+
41+
public static final String MAIN = "main";
42+
public static final String TRUE = "true";
43+
public static final String FALSE = "false";
44+
4045
public static Obj lenMethod;
4146
public static Obj ordMethod;
4247
public static Obj chrMethod;
@@ -46,15 +51,21 @@ public class MJTab extends Tab {
4651
public static Obj vecTimesScalarMethod;
4752
public static Obj scalarTimesVecMethod;
4853
public static Obj vecPlusVecMethod;
49-
public static final Struct INT_ARRAY_TYPE = new Struct(Struct.Array, Tab.intType);
5054

51-
private static final String PRINT_BOOL = "$printBool", READ_BOOL = "$readBool";
52-
private static final String VEC_TIMES_VEC = "$vecTimesVec",
53-
VEC_PLUS_VEC = "$vecPlusVec",
54-
VEC_TIMES_SCALAR = "$vecTimesScalar",
55-
SCALAR_TIMES_VEC = "$scalarTimesVecMethod";
56-
private static final String LEN = "len", ORD = "ord", CHR = "chr";
55+
private static final String PRINT_BOOL = "$printBool";
56+
private static final String READ_BOOL = "$readBool";
57+
58+
private static final String VEC_TIMES_VEC = "$vecTimesVec";
59+
private static final String VEC_PLUS_VEC = "$vecPlusVec";
60+
private static final String VEC_TIMES_SCALAR = "$vecTimesScalar";
61+
private static final String SCALAR_TIMES_VEC = "$scalarTimesVecMethod";
62+
63+
private static final String LEN = "len";
64+
private static final String ORD = "ord";
65+
private static final String CHR = "chr";
66+
5767
private static final Map<Struct, Obj> CLASS_OBJS = new HashMap<>();
68+
5869
private static int classId = 0;
5970

6071
public static void init() {

0 commit comments

Comments
 (0)