zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 918dbd4551f6c737d1c4b7416ef40b59c902eac8 (tree)
parent fa9fcab620ada24d9bb7c51a86a1a8944056da02
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Sun, 10 Mar 2019 15:55:38 -0400

std.zig: `this` is no longer a keyword

Diffstat:
Mdoc/docgen.zig | 1-
Msrc-self-hosted/ir.zig | 1-
Mstd/zig/ast.zig | 18------------------
Mstd/zig/parse.zig | 4----
Mstd/zig/render.zig | 4----
Mstd/zig/tokenizer.zig | 2--
6 files changed, 0 insertions(+), 30 deletions(-)

diff --git a/doc/docgen.zig b/doc/docgen.zig @@ -795,7 +795,6 @@ fn tokenizeAndPrintRaw(docgen_tokenizer: *Tokenizer, out: var, source_token: Tok std.zig.Token.Id.Keyword_null, std.zig.Token.Id.Keyword_true, std.zig.Token.Id.Keyword_false, - std.zig.Token.Id.Keyword_this, => { try out.write("<span class=\"tok-null\">"); try writeEscaped(out, src[token.start..token.end]); diff --git a/src-self-hosted/ir.zig b/src-self-hosted/ir.zig @@ -1151,7 +1151,6 @@ pub const Builder = struct { ast.Node.Id.BoolLiteral => return error.Unimplemented, ast.Node.Id.NullLiteral => return error.Unimplemented, ast.Node.Id.UndefinedLiteral => return error.Unimplemented, - ast.Node.Id.ThisLiteral => return error.Unimplemented, ast.Node.Id.Unreachable => return error.Unimplemented, ast.Node.Id.Identifier => { const identifier = @fieldParentPtr(ast.Node.Identifier, "base", node); diff --git a/std/zig/ast.zig b/std/zig/ast.zig @@ -302,7 +302,6 @@ pub const Node = struct { BoolLiteral, NullLiteral, UndefinedLiteral, - ThisLiteral, Unreachable, Identifier, GroupedExpression, @@ -1997,23 +1996,6 @@ pub const Node = struct { } }; - pub const ThisLiteral = struct { - base: Node, - token: TokenIndex, - - pub fn iterate(self: *ThisLiteral, index: usize) ?*Node { - return null; - } - - pub fn firstToken(self: *const ThisLiteral) TokenIndex { - return self.token; - } - - pub fn lastToken(self: *const ThisLiteral) TokenIndex { - return self.token; - } - }; - pub const AsmOutput = struct { base: Node, lbracket: TokenIndex, diff --git a/std/zig/parse.zig b/std/zig/parse.zig @@ -2563,10 +2563,6 @@ pub fn parse(allocator: *mem.Allocator, source: []const u8) !ast.Tree { _ = try createToCtxLiteral(arena, opt_ctx, ast.Node.NullLiteral, token.index); continue; }, - Token.Id.Keyword_this => { - _ = try createToCtxLiteral(arena, opt_ctx, ast.Node.ThisLiteral, token.index); - continue; - }, Token.Id.Keyword_var => { _ = try createToCtxLiteral(arena, opt_ctx, ast.Node.VarType, token.index); continue; diff --git a/std/zig/render.zig b/std/zig/render.zig @@ -880,10 +880,6 @@ fn renderExpression( const null_literal = @fieldParentPtr(ast.Node.NullLiteral, "base", base); return renderToken(tree, stream, null_literal.token, indent, start_col, space); }, - ast.Node.Id.ThisLiteral => { - const this_literal = @fieldParentPtr(ast.Node.ThisLiteral, "base", base); - return renderToken(tree, stream, this_literal.token, indent, start_col, space); - }, ast.Node.Id.Unreachable => { const unreachable_node = @fieldParentPtr(ast.Node.Unreachable, "base", base); return renderToken(tree, stream, unreachable_node.token, indent, start_col, space); diff --git a/std/zig/tokenizer.zig b/std/zig/tokenizer.zig @@ -52,7 +52,6 @@ pub const Token = struct { Keyword{ .bytes = "suspend", .id = Id.Keyword_suspend }, Keyword{ .bytes = "switch", .id = Id.Keyword_switch }, Keyword{ .bytes = "test", .id = Id.Keyword_test }, - Keyword{ .bytes = "this", .id = Id.Keyword_this }, Keyword{ .bytes = "threadlocal", .id = Id.Keyword_threadlocal }, Keyword{ .bytes = "true", .id = Id.Keyword_true }, Keyword{ .bytes = "try", .id = Id.Keyword_try }, @@ -183,7 +182,6 @@ pub const Token = struct { Keyword_suspend, Keyword_switch, Keyword_test, - Keyword_this, Keyword_threadlocal, Keyword_true, Keyword_try,