Commit Graph

25 Commits

Author SHA1 Message Date
Andrew Kelley
8df0841d6a stage2 parser: token ids in their own array
To prevent cache misses, token ids go in their own array, and the
start/end offsets go in a different one.

perf measurement before:
         2,667,914      cache-misses:u
     2,139,139,935      instructions:u
       894,167,331      cycles:u

perf measurement after:
         1,757,723      cache-misses:u
     2,069,932,298      instructions:u
       858,105,570      cycles:u
2020-05-22 12:34:12 -04:00
Vexu
2296906e2a modernize std.zig.tokenizer 2020-05-13 23:08:42 +03:00
Tadeo Kondrak
7ada59f873 remove nakedcc/stdcallcc/async fn/extern fn fnproto 2020-05-05 09:37:28 -06:00
Tadeo Kondrak
8d5636ebe4 Rename noasync to nosuspend in self-hosted, add rewriter 2020-05-05 05:17:33 -06:00
LemonBoy
0a2519fafb stage2: Allow \t in string literals
Lift the ban on literal tab chars in string literals as they have
nothing to do with code formatting.
2020-04-22 12:48:45 -04:00
momumi
2d18178c27 minor fixes and more tests for _ separators
* Make the tokenizer spit out an Invalid token on the first invalid
  character found in the number literal.
* More parsing and tokenizer tests for number literals
* fix invalid switch statement in ir.zig
2020-03-23 09:21:34 +10:00
momumi
29324e6f39 fix formatting in tokenizer tests 2020-03-22 12:41:11 +10:00
momumi
138dab4524 add number _ separators for stage 2 tokenizer 2020-03-22 10:35:19 +10:00
LemonBoy
59a243ce24 std: Remove now-superflous hack 2020-02-16 19:53:53 +01:00
LemonBoy
563d9ebfe5 Implement the callconv() annotation 2020-01-02 18:53:16 +01:00
Lachlan Easton
fe0e8c87b7 Tokenizer: Copy optional tokens prior to being set to null #3737 (#3910)
* Tokenizer: Copy optional tokens prior to being set to null #3737

* Add TODO comments, reminder to audit copying optional pattern.
2019-12-16 11:01:02 -05:00
Vexu
1f84586836 translate-c-2 avoid collisions with zig keywords 2019-12-14 17:00:10 +02:00
Andrew Kelley
8b2622cdd5 std.fmt.format: tuple parameter instead of var args 2019-12-08 22:53:51 -05:00
Andrew Kelley
bf3ac66150 remove type coercion from array values to references
* Implements #3768. This is a sweeping breaking change that requires
   many (trivial) edits to Zig source code. Array values no longer
   coerced to slices; however one may use `&` to obtain a reference to
   an array value, which may then be coerced to a slice.

 * Adds `IrInstruction::dump`, for debugging purposes. It's useful to
   call to inspect the instruction when debugging Zig IR.

 * Fixes bugs with result location semantics. See the new behavior test
   cases, and compile error test cases.

 * Fixes bugs with `@typeInfo` not properly resolving const values.

 * Behavior tests are passing but std lib tests are not yet. There
   is more work to do before merging this branch.
2019-11-27 03:37:50 -05:00
Andrew Kelley
00878a15d7 zig fmt: support sentinel-terminated pointer syntax 2019-11-23 22:21:25 -05:00
Andrew Kelley
fd6020c4e2 update tests, better error messages, update self-hosted tokenizer 2019-11-21 20:43:41 -05:00
Andrew Kelley
874b34a30f self-hosted tokenizer handles \r in string literals 2019-11-20 21:03:17 -05:00
Andrew Kelley
ed619245e9 remove dead code shebang support from self-hosted tokenizer 2019-11-20 20:18:19 -05:00
Vexu
b92f42d1f4 implemented container doc comments in stage 2 2019-11-14 16:25:06 +02:00
Andrew Kelley
ae0a219d1f stop accepting deprecated use keyword
closes #2591
2019-11-11 13:02:39 -05:00
Andrew Kelley
e0db54e89d update the codebase to use @as 2019-11-08 15:57:24 -05:00
LemonBoy
cf6fb89ced Add small tokenizer test case for #3468 2019-11-07 02:46:10 -05:00
Brendan Hansknecht
c1e8fdf812 add token for parsing pointer dereference 2019-11-06 14:03:21 -05:00
Nick Erdmann
ae7392e504 unicode character literals 2019-10-07 08:18:16 +02:00
Andrew Kelley
ed36dbbd9c mv std/ lib/
that's all this commit does. further commits will fix cli flags and
such.

see #2221
2019-09-25 23:35:41 -04:00