| 212 | // ── Limits / MemType / TableType / GlobalType ───────────────────────────────── |
| 213 | |
| 214 | Limits ParseContext::parse_limits() { |
| 215 | Limits lim; |
| 216 | lim.min = parse_u64(); |
| 217 | if (tok_.peek().type == TokenType::Integer) { |
| 218 | lim.max = parse_u64(); |
| 219 | if (lim.min > lim.max.value()) |
| 220 | throw Exception::Parse("limit min cannot exceed max", tok_.location()); |
| 221 | } |
| 222 | return lim; |
| 223 | } |
| 224 | |
| 225 | MemType ParseContext::parse_memtype() { |
| 226 | MemType mt; |