yvt c98f792ff8 Improve the handling of zig fmt: off/on
This commit reworks the handling of `zig fmt: off/on`. A motivating
example is shown below:

    const c = d;
    // zig fmt: off
    // comment
    const a = b;
    // zig fmt: on

Before processing the decl `const a = b;`, `renderRoot` looks for
`zig fmt: off` that appears between this decl and the previous one. If
it finds one, it searches for the next `zig fmt: on` that re-enables
reformatting (or EOF if none was found), and copies the input code
between `zig fmt: off` and `zig fmt: on` to the output stream. After
that, it proceeds to the next decl.

The important thing to notice here is that `renderTopLevelDecl` emits
line comment tokens that follow the decl. Therefore, when copying code,
we must be careful not to copy the line comment tokens that already have
been written to the output stream. The original code failed to take this
fact into consideration. It did skip `// zig fmt: off`, but not the
remaining ones. As a result, when the above example is fed as input, it
duplicated the line `// comment`.
2019-08-28 11:57:01 -04:00
..
2019-08-20 15:25:30 -04:00
2019-06-27 12:04:14 -04:00
2019-06-26 14:32:19 -04:00
2019-05-27 01:35:58 -04:00
2019-05-19 16:33:31 -04:00
2019-05-26 18:32:44 -04:00
2019-08-20 14:42:39 -04:00
2019-07-05 14:14:25 -04:00
2019-05-26 23:35:26 -04:00
2018-09-30 17:28:35 -04:00
2019-08-27 19:42:37 +02:00
2019-06-27 12:04:14 -04:00
2019-06-11 22:54:40 +10:00
2019-08-20 14:52:10 -04:00
2019-06-30 22:25:03 +12:00
2019-06-10 15:41:40 +10:00
2018-11-13 05:08:37 -08:00
2019-08-20 15:25:30 -04:00
2019-06-10 00:39:40 -04:00
2019-08-15 18:19:04 -04:00
2019-07-15 19:50:56 -04:00
2019-05-12 12:56:01 -04:00