Skip to content

Commit 9fee6bd

Browse files
committed
update static importment of MachineContext
1 parent c1f3e76 commit 9fee6bd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/java/main/com/xxvlang/MachineContext.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.xxvlang.exception.*;
1919

2020
import static com.xxvlang.XXVFlag.*;
21+
import static com.xxvlang.exception.XXVExceptionType.*;
2122

2223
public class MachineContext {
2324

@@ -79,7 +80,7 @@ public static void extractDigit(Statement statement, XXVTrees trees) throws XXVE
7980
if (trees.getFlag(DIGIT_ARG_AS_MOD)) {
8081
index %= XXVInt.DIGITS_NUM;
8182
} else if (index >= XXVInt.DIGITS_NUM) {
82-
throw new XXVException(XXVExceptionType.ILLEGAL_ARGUMENT);
83+
throw new XXVException(ILLEGAL_ARGUMENT);
8384
}
8485
resultBytes[index] = beforeBytes[index];
8586
trees.pushStack(new XXVInt(resultBytes), statement.subject());
@@ -227,7 +228,7 @@ public static void merrychristmas(Statement statement, XXVTrees trees) throws XX
227228
private static void checkXmas() throws XXVException {
228229
ZonedDateTime today = ZonedDateTime.now(ZoneOffset.UTC);
229230
boolean isReallyXmas = today.getMonth() == Month.DECEMBER && today.getDayOfMonth() == 25;
230-
if (!isReallyXmas) throw new XXVException(XXVExceptionType.IS_NOT_XMAS);
231+
if (!isReallyXmas) throw new XXVException(IS_NOT_XMAS);
231232
}
232233

233234
private static void outputOnce(XXVTrees trees, int index) throws XXVException {
@@ -260,16 +261,16 @@ private static void outputOnceUTF8(XXVTrees trees, int index) throws XXVExceptio
260261
value += nextValue;
261262
}
262263
value += nextValue;
263-
if (value >= 0xF4BFBFC0) throw new XXVException(XXVExceptionType.ILLEGAL_CHAR_CODE);
264+
if (value >= 0xF4BFBFC0) throw new XXVException(ILLEGAL_CHAR_CODE);
264265
utfChar[size++] = (byte)(value / 0x1000000);
265266
utfChar[size++] = (byte)(value / 0x10000 % 0x100);
266267
utfChar[size++] = (byte)(value / 0x100 % 0x100);
267268
utfChar[size++] = (byte)(value % 0x100);
268269
} else {
269-
throw new XXVException(XXVExceptionType.ILLEGAL_CHAR_CODE);
270+
throw new XXVException(ILLEGAL_CHAR_CODE);
270271
}
271272
} catch (ArrayIndexOutOfBoundsException ae) {
272-
throw new XXVException(XXVExceptionType.ILLEGAL_CHAR_CODE);
273+
throw new XXVException(ILLEGAL_CHAR_CODE);
273274
}
274275
if (
275276
utfChar[0] >= 0xC2 && utfChar[0] < 0xE0 && size == 2 ||

0 commit comments

Comments
 (0)