| 1769 | } |
| 1770 | |
| 1771 | int EvaluateIntegerExpression( ParserState& state, ASTNode* node, int defaultValue ) |
| 1772 | { |
| 1773 | Type type; |
| 1774 | ExpressionValue value; |
| 1775 | if( !EvaluateExpression( state, node, type, value, nullptr ) ) |
| 1776 | { |
| 1777 | return defaultValue; |
| 1778 | } |
| 1779 | |
| 1780 | Type newType; |
| 1781 | newType.FromTokenType( OP_INT ); |
| 1782 | if( !CastExpressionValue( value, type, newType ) ) |
| 1783 | { |
| 1784 | state.ShowMessage( node->GetToken()->fileLocation, EC_INVALID_IMPLICIT_CAST ); |
| 1785 | return defaultValue; |
| 1786 | } |
| 1787 | return int( value[0].intValue ); |
| 1788 | } |
| 1789 | |
| 1790 | |
| 1791 | std::optional<RtShaderType> ParseRtShaderName( const InlineString& name ) |
nothing calls this directly
no test coverage detected