| ... | ... | @@ -6558,25 +6558,25 @@ fn identifier( |
| 6558 | 6558 | if (mem.eql(u8, ident_name_raw, "_")) { |
| 6559 | 6559 | return astgen.failNode(ident, "'_' used as an identifier without @\"_\" syntax", .{}); |
| 6560 | 6560 | } |
| 6561 | | const ident_name = try astgen.identifierTokenString(ident_token); |
| 6562 | 6561 | |
| 6562 | // if not @"" syntax, just use raw token slice |
| 6563 | 6563 | if (ident_name_raw[0] != '@') { |
| 6564 | | if (primitives.get(ident_name)) |zir_const_ref| { |
| 6564 | if (primitives.get(ident_name_raw)) |zir_const_ref| { |
| 6565 | 6565 | return rvalue(gz, rl, zir_const_ref, ident); |
| 6566 | 6566 | } |
| 6567 | 6567 | |
| 6568 | | if (ident_name.len >= 2) integer: { |
| 6569 | | const first_c = ident_name[0]; |
| 6568 | if (ident_name_raw.len >= 2) integer: { |
| 6569 | const first_c = ident_name_raw[0]; |
| 6570 | 6570 | if (first_c == 'i' or first_c == 'u') { |
| 6571 | 6571 | const signedness: std.builtin.Signedness = switch (first_c == 'i') { |
| 6572 | 6572 | true => .signed, |
| 6573 | 6573 | false => .unsigned, |
| 6574 | 6574 | }; |
| 6575 | | const bit_count = std.fmt.parseInt(u16, ident_name[1..], 10) catch |err| switch (err) { |
| 6575 | const bit_count = std.fmt.parseInt(u16, ident_name_raw[1..], 10) catch |err| switch (err) { |
| 6576 | 6576 | error.Overflow => return astgen.failNode( |
| 6577 | 6577 | ident, |
| 6578 | 6578 | "primitive integer type '{s}' exceeds maximum bit width of 65535", |
| 6579 | | .{ident_name}, |
| 6579 | .{ident_name_raw}, |
| 6580 | 6580 | ), |
| 6581 | 6581 | error.InvalidCharacter => break :integer, |
| 6582 | 6582 | }; |
| ... | ... | @@ -6629,6 +6629,7 @@ fn identifier( |
| 6629 | 6629 | |
| 6630 | 6630 | // Can't close over a runtime variable |
| 6631 | 6631 | if (num_namespaces_out != 0 and !local_ptr.maybe_comptime) { |
| 6632 | const ident_name = try astgen.identifierTokenString(ident_token); |
| 6632 | 6633 | return astgen.failNodeNotes(ident, "mutable '{s}' not accessible from here", .{ident_name}, &.{ |
| 6633 | 6634 | try astgen.errNoteTok(local_ptr.token_src, "declared mutable here", .{}), |
| 6634 | 6635 | try astgen.errNoteNode(capturing_namespace.?.node, "crosses namespace boundary here", .{}), |
| ... | ... | @@ -6676,6 +6677,7 @@ fn identifier( |
| 6676 | 6677 | .top => break, |
| 6677 | 6678 | }; |
| 6678 | 6679 | if (found_already == null) { |
| 6680 | const ident_name = try astgen.identifierTokenString(ident_token); |
| 6679 | 6681 | return astgen.failNode(ident, "use of undeclared identifier '{s}'", .{ident_name}); |
| 6680 | 6682 | } |
| 6681 | 6683 | |