aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-03-25 12:55:45 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-03-25 12:55:45 -0400
commit5eaead6a56ed95c200e249737c4ecf3c7cacf794 (patch)
tree70fe5c0238d6f1d72fc8504a4aaec710f059db37 /src/tokenizer.cpp
parent3306e43984a8b17472ecc4b13a2f2815d6630eef (diff)
downloadzig-5eaead6a56ed95c200e249737c4ecf3c7cacf794.tar.gz
zig-5eaead6a56ed95c200e249737c4ecf3c7cacf794.zip
implement allowzero pointer attribute
closes #1953 only needed for freestanding targets. also adds safety for `@intToPtr` when the address is zero.
Diffstat (limited to 'src/tokenizer.cpp')
-rw-r--r--src/tokenizer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp
index 7d41343e3a..53554d1096 100644
--- a/src/tokenizer.cpp
+++ b/src/tokenizer.cpp
@@ -107,6 +107,7 @@ struct ZigKeyword {
static const struct ZigKeyword zig_keywords[] = {
{"align", TokenIdKeywordAlign},
+ {"allowzero", TokenIdKeywordAllowZero},
{"and", TokenIdKeywordAnd},
{"anyerror", TokenIdKeywordAnyerror},
{"asm", TokenIdKeywordAsm},
@@ -1495,6 +1496,7 @@ const char * token_name(TokenId id) {
case TokenIdIntLiteral: return "IntLiteral";
case TokenIdKeywordAsync: return "async";
case TokenIdKeywordAnyerror: return "anyerror";
+ case TokenIdKeywordAllowZero: return "allowzero";
case TokenIdKeywordAwait: return "await";
case TokenIdKeywordResume: return "resume";
case TokenIdKeywordSuspend: return "suspend";