Cleanup logic of PDT interpreter.

This commit is contained in:
2023-02-15 18:07:36 +08:00
parent 4a5b2a6889
commit c7ea6f1d4b
2 changed files with 5 additions and 3 deletions

View File

@@ -226,6 +226,10 @@ namespace Cryville.Common.Pdt {
while (true) {
try { ws(); }
catch (IndexOutOfRangeException) { return result; }
if (cc == '}') {
GetChar();
return result;
}
object pkey = InterpretKey(type);
char c = GetChar();
switch (c) {
@@ -288,8 +292,6 @@ namespace Cryville.Common.Pdt {
}
}
break;
case '}':
return result;
default:
throw new InvalidOperationException("Internal error: Invalid key interpretation");
}