| 1108 | } |
| 1109 | |
| 1110 | ASTNode* NewBinaryExpression( ParserState& state, int op, ASTNode* left, ASTNode* right ) |
| 1111 | { |
| 1112 | auto expr = state.NewNode( NT_EXPRESSION, ScannerToken::FromTokenType( op ) ); |
| 1113 | expr->AddChild( left ); |
| 1114 | expr->AddChild( right ); |
| 1115 | Type type; |
| 1116 | if( !GetCommonType( left->GetType(), right->GetType(), type ) ) |
| 1117 | { |
| 1118 | state.ShowMessage( EC_TYPE_MISMATCH ); |
| 1119 | type.FromTokenType( OP_VOID ); |
| 1120 | } |
| 1121 | expr->SetType( type ); |
| 1122 | return expr; |
| 1123 | } |
| 1124 | |
| 1125 | ASTNode* NewConditionalExpression( ParserState& state, ASTNode* condition, ASTNode* trueExpr, ASTNode* falseExpr ) |
| 1126 | { |
no test coverage detected