| 2083 | } |
| 2084 | |
| 2085 | bool reshadefx::parser::parse_technique() |
| 2086 | { |
| 2087 | if (!expect(tokenid::identifier)) |
| 2088 | return false; |
| 2089 | |
| 2090 | technique info; |
| 2091 | info.name = std::move(_token.literal_as_string); |
| 2092 | |
| 2093 | bool parse_success = parse_annotations(info.annotations); |
| 2094 | |
| 2095 | if (!expect('{')) |
| 2096 | return false; |
| 2097 | |
| 2098 | while (!peek('}')) |
| 2099 | { |
| 2100 | pass pass; |
| 2101 | if (parse_technique_pass(pass)) |
| 2102 | { |
| 2103 | info.passes.push_back(std::move(pass)); |
| 2104 | } |
| 2105 | else |
| 2106 | { |
| 2107 | parse_success = false; |
| 2108 | if (!peek(tokenid::pass) && !peek('}')) // If there is another pass definition following, try to parse that despite the error |
| 2109 | { |
| 2110 | consume_until('}'); |
| 2111 | return false; |
| 2112 | } |
| 2113 | } |
| 2114 | } |
| 2115 | |
| 2116 | _codegen->define_technique(std::move(info)); |
| 2117 | |
| 2118 | return expect('}') && parse_success; |
| 2119 | } |
| 2120 | bool reshadefx::parser::parse_technique_pass(pass &info) |
| 2121 | { |
| 2122 | if (!expect(tokenid::pass)) |
nothing calls this directly
no test coverage detected