Non-functional: Fix HLSL error message, and code formatting.

This commit is contained in:
John Kessenich
2018-01-08 11:41:59 -07:00
parent 99892d5a9a
commit adc33b23cc
3 changed files with 26 additions and 16 deletions

View File

@@ -565,10 +565,15 @@ EHlslTokenClass HlslScanContext::tokenizeClass(HlslToken& token)
case EndOfInput: return EHTokNone;
default:
char buf[2];
buf[0] = (char)token;
buf[1] = 0;
parseContext.error(loc, "unexpected token", buf, "");
if (token < PpAtomMaxSingle) {
char buf[2];
buf[0] = (char)token;
buf[1] = 0;
parseContext.error(loc, "unexpected token", buf, "");
} else if (tokenText[0] != 0)
parseContext.error(loc, "unexpected token", tokenText, "");
else
parseContext.error(loc, "unexpected token", "", "");
break;
}
} while (true);