* Get the token name for error reporting. */
| 117 | * Get the token name for error reporting. |
| 118 | */ |
| 119 | static const char *getTokenName(char token) |
| 120 | { |
| 121 | switch (token) |
| 122 | { |
| 123 | case ':': |
| 124 | return ":"; |
| 125 | case ',': |
| 126 | return ","; |
| 127 | case '{': |
| 128 | return "{"; |
| 129 | case '}': |
| 130 | return "}"; |
| 131 | case '[': |
| 132 | return "["; |
| 133 | case ']': |
| 134 | return "]"; |
| 135 | case EOF: |
| 136 | return "<end-of-file>"; |
| 137 | case TOKEN_BOOL: |
| 138 | return "<bool>"; |
| 139 | case TOKEN_NUMBER: |
| 140 | return "<number>"; |
| 141 | case TOKEN_STRING: |
| 142 | return "<string>"; |
| 143 | case TOKEN_NULL: |
| 144 | return "<null>"; |
| 145 | default: |
| 146 | return "???"; |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | /* |
| 151 | * Duplicate a string. |
no outgoing calls
no test coverage detected