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

View File

@@ -85,7 +85,7 @@ namespace Cryville.Crtr {
case '{': case '{':
return new SkinSelectors(s, a); return new SkinSelectors(s, a);
case '}': case '}':
return null; throw new FormatException("Invalid token");
case '*': case '*':
GetChar(); GetChar();
compKeyFlag = true; compKeyFlag = true;