Fixed ulong constant not being accepted with an unchecked cast to long.

Fixed the argument passed to Substring. Java expects a position but C# expects a length.
This commit is contained in:
2023-05-14 20:10:54 +02:00
parent c078b94243
commit 21b8c43ceb
2 changed files with 2 additions and 2 deletions

View File

@@ -1770,7 +1770,7 @@ public class CSJavaFiles
ostr.println(" default:");
ostr.println(" if ((ch = str[i]) < 0x20 || ch > 0x7e) {");
ostr.println(" String s = \"0000\" + ((int)ch).ToString(\"X\");");
ostr.println(" retval.Append(\"\\\\u\" + s.Substring(s.Length - 4, s.Length));");
ostr.println(" retval.Append(\"\\\\u\" + s.Substring(s.Length - 4, 4));");
ostr.println(" } else {");
ostr.println(" retval.Append(ch);");
ostr.println(" }");

View File

@@ -666,7 +666,7 @@ public class LexGen extends CSJavaCCGlobals implements CSJavaCCParserConstants{
ostr.print("static long[] jjtoToken = {");
for (i = 0; i < maxOrdinal / 64 + 1; i++){
if (i % 4 == 0)ostr.print("\n ");
ostr.print("0x" + Long.toHexString(toToken[i]) + "L, ");
ostr.print("unchecked((long)0x" + Long.toHexString(toToken[i]) + "L), ");
}
ostr.println("\n};");
}