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

Method ParseFunctionDefinition

sdk/angelscript/source/as_parser.cpp:106–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106int asCParser::ParseFunctionDefinition(asCScriptCode *in_script, bool in_expectListPattern)
107{
108 Reset();
109
110 // Set flag that permits ? as datatype for parameters
111 isParsingAppInterface = true;
112
113 this->script = in_script;
114
115 scriptNode = ParseFunctionDefinition();
116
117 if( in_expectListPattern )
118 scriptNode->AddChildLast(ParseListPattern());
119
120 // The declaration should end after the definition
121 if( !isSyntaxError )
122 {
123 sToken t;
124 GetToken(&t);
125 if( t.type != ttEnd )
126 {
127 Error(ExpectedToken(asCTokenizer::GetDefinition(ttEnd)), &t);
128 Error(InsteadFound(t), &t);
129 return -1;
130 }
131 }
132
133 if( errorWhileParsing )
134 return -1;
135
136 return 0;
137}
138
139asCScriptNode *asCParser::CreateNode(eScriptNode type)
140{

Callers 1

Calls 1

AddChildLastMethod · 0.80

Tested by

no test coverage detected