From 6d2d276de14a220ac470c64c193db385b87712ac Mon Sep 17 00:00:00 2001 From: Yardanico <21169548+Yardanico@users.noreply.github.com> Date: Sat, 7 Sep 2019 18:35:46 +0300 Subject: [PATCH] Fir for float literals with scientific notation --- example.zig | 1 + zig/zig_lexer.zig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/example.zig b/example.zig index 61583e7..040d3ef 100644 --- a/example.zig +++ b/example.zig @@ -17,6 +17,7 @@ pub async fn nextCodepointSlice(it: *Utf8Iterator) ?[]const u8 { cklj = asdf; var num = 0.0; + var num2 = 1e2; const c = @cImport({ @cInclude("lzma_header.c"); }); diff --git a/zig/zig_lexer.zig b/zig/zig_lexer.zig index fcfe78e..693f39c 100644 --- a/zig/zig_lexer.zig +++ b/zig/zig_lexer.zig @@ -103,7 +103,7 @@ pub const Lexer = struct { while(true) { switch (self.peek) { '0'...'9' => {}, - '.' => return self.float_digits(false), + '.', 'e' => return self.float_digits(false), else => return Id.IntegerLiteral, } self.getc();