MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / ParseOneOf

Method ParseOneOf

src/server/angelscript/angelscript/source/as_parser.cpp:620–645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620asCScriptNode *asCParser::ParseOneOf(int *tokens, int count)
621{
622 asCScriptNode *node = CreateNode(snUndefined);
623 if( node == 0 ) return 0;
624
625 sToken t1;
626
627 GetToken(&t1);
628 int n;
629 for( n = 0; n < count; n++ )
630 {
631 if( tokens[n] == t1.type )
632 break;
633 }
634 if( n == count )
635 {
636 Error(ExpectedOneOf(tokens, count), &t1);
637 Error(InsteadFound(t1), &t1);
638 return node;
639 }
640
641 node->SetToken(&t1);
642 node->UpdateSourcePos(t1.pos, t1.length);
643
644 return node;
645}
646
647// BNF:5: DATATYPE ::= (IDENTIFIER | PRIMTYPE | '?' | 'auto')
648asCScriptNode *asCParser::ParseDataType(bool allowVariableType, bool allowAuto)

Callers

nothing calls this directly

Calls 2

SetTokenMethod · 0.80
UpdateSourcePosMethod · 0.80

Tested by

no test coverage detected