| 294 | //**-------------------------------------------------------------------------- |
| 295 | |
| 296 | static void ParseSingleFile(FScanner *pSC, const char *filename, int lump, void *parser, ZCCParseState &state) |
| 297 | { |
| 298 | int tokentype; |
| 299 | //bool failed; |
| 300 | ZCCToken value; |
| 301 | FScanner lsc; |
| 302 | |
| 303 | if (pSC == nullptr) |
| 304 | { |
| 305 | if (filename != nullptr) |
| 306 | { |
| 307 | lump = fileSystem.CheckNumForFullName(filename, true); |
| 308 | if (lump >= 0) |
| 309 | { |
| 310 | lsc.OpenLumpNum(lump); |
| 311 | } |
| 312 | else |
| 313 | { |
| 314 | Printf("Could not find script lump '%s'\n", filename); |
| 315 | return; |
| 316 | } |
| 317 | } |
| 318 | else lsc.OpenLumpNum(lump); |
| 319 | |
| 320 | pSC = &lsc; |
| 321 | } |
| 322 | FScanner &sc = *pSC; |
| 323 | sc.SetParseVersion(state.ParseVersion); |
| 324 | state.sc = ≻ |
| 325 | |
| 326 | while (sc.GetToken()) |
| 327 | { |
| 328 | value.Largest = 0; |
| 329 | value.SourceLoc = sc.GetMessageLine(); |
| 330 | switch (sc.TokenType) |
| 331 | { |
| 332 | case TK_StringConst: |
| 333 | value.String = state.Strings.Alloc(sc.String, sc.StringLen); |
| 334 | tokentype = ZCC_STRCONST; |
| 335 | break; |
| 336 | |
| 337 | case TK_NameConst: |
| 338 | value.Int = FName(sc.String).GetIndex(); |
| 339 | tokentype = ZCC_NAMECONST; |
| 340 | break; |
| 341 | |
| 342 | case TK_IntConst: |
| 343 | value.Int = sc.Number; |
| 344 | tokentype = ZCC_INTCONST; |
| 345 | break; |
| 346 | |
| 347 | case TK_UIntConst: |
| 348 | value.Int = sc.Number; |
| 349 | tokentype = ZCC_UINTCONST; |
| 350 | break; |
| 351 | |
| 352 | case TK_FloatConst: |
| 353 | value.Float = sc.Float; |
no test coverage detected