MCPcopy Create free account
hub / github.com/ZDoom/Raze / TokenName

Method TokenName

source/common/engine/sc_man.cpp:1025–1058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1023//==========================================================================
1024
1025FString FScanner::TokenName (int token, const char *string)
1026{
1027 static const char *const names[] =
1028 {
1029#define xx(sym,str) str,
1030#include "sc_man_tokens.h"
1031 };
1032
1033 FString work;
1034
1035 if (token > ' ' && token < 256)
1036 {
1037 work = '\'';
1038 work += token;
1039 work += '\'';
1040 }
1041 else if (token >= TK_Identifier && token < TK_LastToken)
1042 {
1043 work = names[token - TK_Identifier];
1044 if (string != NULL && token >= TK_Identifier && token <= TK_FloatConst)
1045 {
1046 work += ' ';
1047 char quote = (token == TK_StringConst) ? '"' : '\'';
1048 work += quote;
1049 work += string;
1050 work += quote;
1051 }
1052 }
1053 else
1054 {
1055 work.Format("Unknown(%d)", token);
1056 }
1057 return work;
1058}
1059
1060//==========================================================================
1061//

Callers 1

ParseSingleFileFunction · 0.80

Calls 1

FormatMethod · 0.45

Tested by

no test coverage detected