MCPcopy Create free account
hub / github.com/ZDoom/gzdoom / ParseFlagExpressionString

Function ParseFlagExpressionString

src/scripting/decorate/thingdef_parse.cpp:508–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506};
507
508int ParseFlagExpressionString(FScanner &sc, const FParseValue *vals)
509{
510 // May be given flags by number...
511 if (sc.CheckNumber())
512 {
513 sc.MustGetNumber();
514 return sc.Number;
515 }
516
517 // ... else should be flags by name.
518 // NOTE: Later this should be removed and a normal expression used.
519 // The current DECORATE parser can't handle this though.
520 bool gotparen = sc.CheckString("(");
521 int style = 0;
522 do
523 {
524 sc.MustGetString();
525 style |= vals[sc.MustMatchString(&vals->Name, sizeof (*vals))].Flag;
526 }
527 while (sc.CheckString("|"));
528 if (gotparen)
529 {
530 sc.MustGetStringName(")");
531 }
532
533 return style;
534}
535
536
537

Callers 2

ParseMorphStyleFunction · 0.85
ParseThingActivationFunction · 0.85

Calls 6

MustGetNumberMethod · 0.80
MustGetStringMethod · 0.80
MustMatchStringMethod · 0.80
MustGetStringNameMethod · 0.80
CheckNumberMethod · 0.45
CheckStringMethod · 0.45

Tested by

no test coverage detected