| 1123 | } |
| 1124 | |
| 1125 | ASTNode* NewConditionalExpression( ParserState& state, ASTNode* condition, ASTNode* trueExpr, ASTNode* falseExpr ) |
| 1126 | { |
| 1127 | auto expr = state.NewNode( NT_CONDITIONAL_EXPRESSION, ScannerToken::FromTokenType( OP_QUESTION ) ); |
| 1128 | expr->AddChild( condition ); |
| 1129 | expr->AddChild( trueExpr ); |
| 1130 | expr->AddChild( falseExpr ); |
| 1131 | Type type; |
| 1132 | if( !GetCommonType( trueExpr->GetType(), falseExpr->GetType(), type ) ) |
| 1133 | { |
| 1134 | state.ShowMessage( EC_TYPE_MISMATCH ); |
| 1135 | type.FromTokenType( OP_VOID ); |
| 1136 | } |
| 1137 | expr->SetType( type ); |
| 1138 | return expr; |
| 1139 | } |
| 1140 | |
| 1141 | ASTNode* NewVarDeclaration( ParserState& state, const Type& type, const InlineString& name ) |
| 1142 | { |
nothing calls this directly
no test coverage detected