| 104 | } |
| 105 | |
| 106 | int 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 | |
| 139 | asCScriptNode *asCParser::CreateNode(eScriptNode type) |
| 140 | { |
no test coverage detected