MCPcopy Create free account
hub / github.com/anjo76/angelscript / ParseOneOf

Method ParseOneOf

sdk/angelscript/source/as_parser.cpp:676–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674}
675
676asCScriptNode *asCParser::ParseOneOf(int *tokens, int count)
677{
678 asCScriptNode *node = CreateNode(snUndefined);
679 if( node == 0 ) return 0;
680
681 sToken t1;
682
683 GetToken(&t1);
684 int n;
685 for( n = 0; n < count; n++ )
686 {
687 if( tokens[n] == t1.type )
688 break;
689 }
690 if( n == count )
691 {
692 Error(ExpectedOneOf(tokens, count), &t1);
693 Error(InsteadFound(t1), &t1);
694 return node;
695 }
696
697 node->SetToken(&t1);
698 node->UpdateSourcePos(t1.pos, t1.length);
699
700 return node;
701}
702
703// BNF:5: DATATYPE ::= (IDENTIFIER | PRIMTYPE | '?' | 'auto')
704asCScriptNode *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