| 177 | } |
| 178 | |
| 179 | std::pair<std::string, std::vector<ValueType>> ParseContext::parse_param() { |
| 180 | tok_.expect(TokenType::LParen); |
| 181 | tok_.expect_keyword("param"); |
| 182 | std::pair<std::string, std::vector<ValueType>> result; |
| 183 | if (tok_.peek().type == TokenType::Id) { |
| 184 | result.first = tok_.consume().text; |
| 185 | result.second.push_back(parse_valtype()); |
| 186 | } else { |
| 187 | while (tok_.peek().type == TokenType::Keyword && |
| 188 | (tok_.peek().text == "i32" || tok_.peek().text == "i64" || |
| 189 | tok_.peek().text == "f32" || tok_.peek().text == "f64" || |
| 190 | tok_.peek().text == "funcref" || tok_.peek().text == "externref")) { |
| 191 | result.second.push_back(parse_valtype()); |
| 192 | } |
| 193 | } |
| 194 | tok_.expect(TokenType::RParen); |
| 195 | return result; |
| 196 | } |
| 197 | |
| 198 | std::vector<ValueType> ParseContext::parse_result() { |
| 199 | tok_.expect(TokenType::LParen); |
nothing calls this directly
no test coverage detected