| 1211 | } |
| 1212 | |
| 1213 | ASTNode* NewFunctionParameter( ParserState& state, const Type& type, const InlineString& name ) |
| 1214 | { |
| 1215 | auto param = state.NewNode( NT_FUNCTION_PARAMETER ); |
| 1216 | auto symbol = state.GetSymbolTable().AddSymbol( name ? name : state.AllocateName() ); |
| 1217 | symbol->type = type; |
| 1218 | symbol->definition = param; |
| 1219 | param->SetType( symbol->type ); |
| 1220 | param->SetSymbol( symbol ); |
| 1221 | if( type.arrayDimensions ) |
| 1222 | { |
| 1223 | auto brackets = state.NewNode( NT_BRACKET_LIST ); |
| 1224 | brackets->AddChild( nullptr ); |
| 1225 | param->AddChild( brackets ); |
| 1226 | } |
| 1227 | else |
| 1228 | { |
| 1229 | param->AddChild( nullptr ); |
| 1230 | } |
| 1231 | return param; |
| 1232 | } |
| 1233 | |
| 1234 | |
| 1235 | ASTNode* NewFunctionParameter( ParserState& state, const Type& type, const char* name ) |
no test coverage detected