| 248 | } |
| 249 | |
| 250 | GlobalType ParseContext::parse_globaltype() { |
| 251 | GlobalType gt; |
| 252 | if (tok_.peek().type == TokenType::LParen && |
| 253 | tok_.peek2().type == TokenType::Keyword && tok_.peek2().text == "mut") { |
| 254 | tok_.consume(); tok_.consume(); // '(' 'mut' |
| 255 | gt.mut = GlobalType::variable; |
| 256 | gt.type = parse_valtype(); |
| 257 | tok_.expect(TokenType::RParen); |
| 258 | } else { |
| 259 | gt.mut = GlobalType::constant; |
| 260 | gt.type = parse_valtype(); |
| 261 | } |
| 262 | return gt; |
| 263 | } |
| 264 | |
| 265 | // ── Typeuse ─────────────────────────────────────────────────────────────────── |
| 266 | |