From 7f1a550760a7a01d4ae8de51be16fb02d56b5cd2 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 18 Jul 2018 17:56:34 -0400 Subject: [PATCH] std.zig.parse: fix treating integer literals as string literals --- README.md | 8 ++++---- std/zig/parse.zig | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a5868bf44e6d8b1585e3405b7f110bafc331ecfd..f4daee9e591a64a0a60359c70cb607f93d04d31a 100644 --- a/README.md +++ b/README.md @@ -21,19 +21,19 @@ clarity. * Compatible with C libraries with no wrapper necessary. Directly include C .h files and get access to the functions and symbols therein. * Provides standard library which competes with the C standard library and is - always compiled against statically in source form. Compile units do not + always compiled against statically in source form. Zig binaries do not depend on libc unless explicitly linked. - * Nullable type instead of null pointers. + * Optional type instead of null pointers. * Safe unions, tagged unions, and C ABI compatible unions. * Generics so that one can write efficient data structures that work for any data type. * No header files required. Top level declarations are entirely order-independent. * Compile-time code execution. Compile-time reflection. - * Partial compile-time function evaluation with eliminates the need for + * Partial compile-time function evaluation which eliminates the need for a preprocessor or macros. * The binaries produced by Zig have complete debugging information so you can, - for example, use GDB or MSVC to debug your software. + for example, use GDB, MSVC, or LLDB to debug your software. * Built-in unit tests with `zig test`. * Friendly toward package maintainers. Reproducible build, bootstrapping process carefully documented. Issues filed by package maintainers are diff --git a/std/zig/parse.zig b/std/zig/parse.zig index 9842ba2a17e2d5e472a0583df017933ac3045e3a..73d51e787077e5c1614dc03b7953a534c0e7eebd 100644 --- a/std/zig/parse.zig +++ b/std/zig/parse.zig @@ -2356,7 +2356,7 @@ pub fn parse(allocator: *mem.Allocator, source: []const u8) !ast.Tree { const token = nextToken(&tok_it, &tree); switch (token.ptr.id) { Token.Id.IntegerLiteral => { - _ = try createToCtxLiteral(arena, opt_ctx, ast.Node.StringLiteral, token.index); + _ = try createToCtxLiteral(arena, opt_ctx, ast.Node.IntegerLiteral, token.index); continue; }, Token.Id.FloatLiteral => { -- 2.54.0