| author | |
| committer | |
| log | 56fad6a19554b83f54c3cdf12b93510546346068 |
| tree | 7a86d5594b76eb21dc8221c15b1ed5d99af5204c |
| parent | 08d534e8d8482b0c59b5311111a6ae70593d783d |
Error messages never contain periods or grave accents.
Get rid of the periods and use apostrophes instead in
probably the only two error messages that had them.4 files changed, 7 insertions(+), 7 deletions(-)
lib/std/zig/Ast.zig+2-2| ... | ... | @@ -323,7 +323,7 @@ pub fn renderError(tree: Ast, parse_error: Error, stream: anytype) !void { |
| 323 | 323 | .asterisk_after_ptr_deref => { |
| 324 | 324 | // Note that the token will point at the `.*` but ideally the source |
| 325 | 325 | // location would point to the `*` after the `.*`. |
| 326 | return stream.writeAll("'.*' cannot be followed by '*'. Are you missing a space?"); | |
| 326 | return stream.writeAll("'.*' cannot be followed by '*'; are you missing a space?"); | |
| 327 | 327 | }, |
| 328 | 328 | .chained_comparison_operators => { |
| 329 | 329 | return stream.writeAll("comparison operators cannot be chained"); |
| ... | ... | @@ -526,7 +526,7 @@ pub fn renderError(tree: Ast, parse_error: Error, stream: anytype) !void { |
| 526 | 526 | return stream.writeAll("expected field initializer"); |
| 527 | 527 | }, |
| 528 | 528 | .mismatched_binary_op_whitespace => { |
| 529 | return stream.print("binary operator `{s}` has whitespace on one side, but not the other.", .{tree.tokenTag(parse_error.token).lexeme().?}); | |
| 529 | return stream.print("binary operator '{s}' has whitespace on one side, but not the other", .{tree.tokenTag(parse_error.token).lexeme().?}); | |
| 530 | 530 | }, |
| 531 | 531 | .invalid_ampersand_ampersand => { |
| 532 | 532 | return stream.writeAll("ambiguous use of '&&'; use 'and' for logical AND, or change whitespace to ' & &' for bitwise AND"); |
lib/std/zig/AstGen.zig+2-2| ... | ... | @@ -4299,12 +4299,12 @@ fn fnDeclInner( |
| 4299 | 4299 | &[_]u32{ |
| 4300 | 4300 | try astgen.errNoteNode( |
| 4301 | 4301 | type_expr, |
| 4302 | "if this is a name, annotate its type '{s}: T'", | |
| 4302 | "if this is a name, annotate its type: '{s}: T'", | |
| 4303 | 4303 | .{identifier_str}, |
| 4304 | 4304 | ), |
| 4305 | 4305 | try astgen.errNoteNode( |
| 4306 | 4306 | type_expr, |
| 4307 | "if this is a type, give it a name '<name>: {s}'", | |
| 4307 | "if this is a type, give it a name: 'name: {s}'", | |
| 4308 | 4308 | .{identifier_str}, |
| 4309 | 4309 | ), |
| 4310 | 4310 | }, |
test/cases/compile_errors/Issue_6823_dont_allow_._to_be_followed_by_.zig+1-1| ... | ... | @@ -7,4 +7,4 @@ fn foo() void { |
| 7 | 7 | // backend=stage2 |
| 8 | 8 | // target=native |
| 9 | 9 | // |
| 10 | // :2:28: error: '.*' cannot be followed by '*'. Are you missing a space? | |
| 10 | // :2:28: error: '.*' cannot be followed by '*'; are you missing a space? |
test/cases/compile_errors/missing_parameter_name.zig+2-2| ... | ... | @@ -15,5 +15,5 @@ fn f1(x) u64 { |
| 15 | 15 | // :1:7: error: missing parameter name |
| 16 | 16 | // :4:7: error: missing parameter name |
| 17 | 17 | // :7:7: error: missing parameter name or type |
| 18 | // :7:7: note: if this is a name, annotate its type 'x: T' | |
| 19 | // :7:7: note: if this is a type, give it a name '<name>: x' | |
| 18 | // :7:7: note: if this is a name, annotate its type: 'x: T' | |
| 19 | // :7:7: note: if this is a type, give it a name: 'name: x' |