diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-11-28 03:00:13 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-11-28 03:00:13 -0500 |
| commit | 8d5c4a67a7dfe2e1fc07f84515d59405c4100b5c (patch) | |
| tree | 9e0a7501730d34fd8fe0dafdadb172733008e162 /src/c_tokenizer.cpp | |
| parent | 1ab84a27d374e666463c606dc1cd1c4972b52a74 (diff) | |
| parent | e745544dacc5bda010fc65e5c8b81cb3b5249223 (diff) | |
| download | zig-8d5c4a67a7dfe2e1fc07f84515d59405c4100b5c.tar.gz zig-8d5c4a67a7dfe2e1fc07f84515d59405c4100b5c.zip | |
Merge branch 'dimenus-c-field-expr'
Diffstat (limited to 'src/c_tokenizer.cpp')
| -rw-r--r-- | src/c_tokenizer.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/c_tokenizer.cpp b/src/c_tokenizer.cpp index 044831f72e..6be2cf991e 100644 --- a/src/c_tokenizer.cpp +++ b/src/c_tokenizer.cpp @@ -120,6 +120,7 @@ static void begin_token(CTokenize *ctok, CTokId id) { case CTokIdLParen: case CTokIdRParen: case CTokIdEOF: + case CTokIdDot: break; } } @@ -216,9 +217,8 @@ void tokenize_c_macro(CTokenize *ctok, const uint8_t *c) { buf_append_char(&ctok->buf, '0'); break; case '.': - begin_token(ctok, CTokIdNumLitFloat); - ctok->state = CTokStateFloat; - buf_init_from_str(&ctok->buf, "0."); + begin_token(ctok, CTokIdDot); + end_token(ctok); break; case '(': begin_token(ctok, CTokIdLParen); @@ -238,6 +238,8 @@ void tokenize_c_macro(CTokenize *ctok, const uint8_t *c) { break; case CTokStateFloat: switch (*c) { + case '.': + break; case 'e': case 'E': buf_append_char(&ctok->buf, 'e'); |
