Explorar o código

Add GoTokenUtils

Robin Maisch %!s(int64=4) %!d(string=hai) anos
pai
achega
87909b8221

+ 17 - 0
jplag.frontend.golang/src/main/java/de/jplag/golang/grammar/GoTokenUtils.java

@@ -0,0 +1,17 @@
+package de.jplag.golang.grammar;
+
+import de.jplag.golang.GoToken;
+
+public class GoTokenUtils {
+
+    private static final int NOT_SET = -1;
+    private static final String NOT_SET_STRING = "";
+
+    public static GoToken getDummyToken(int type) {
+        return new GoToken(type, NOT_SET_STRING, NOT_SET, NOT_SET, NOT_SET);
+    }
+
+    public static GoToken getDummyToken(int type, String fileName) {
+        return new GoToken(type, fileName, NOT_SET, NOT_SET, NOT_SET);
+    }
+}