| 1023 | //========================================================================== |
| 1024 | |
| 1025 | FString 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 | // |
no test coverage detected