# std.zig.parser: Refactor, round 1: · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/206c0b8bdb4838010d6a1e70135134dc3edc6723)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 206c0b8bdb4838010d6a1e70135134dc3edc6723

Requested commit: 206c0b8bdb4838010d6a1e70135134dc3edc6723

Commit: 206c0b8bdb4838010d6a1e70135134dc3edc6723

Tree: 3969f0899d9db4a103d11a156bb6de705af6db2e

Author: Jimmi Holst Christensen

Committer: Jimmi Holst Christensen

## Message

```
std.zig.parser: Refactor, round 1:
* Removed the Optional state
  * We now have an OptionalCtx instead of DestPtr
  * OptionalCtx simulated return, instead of reverting states
  * OptionalCtx is a lot less hacky, but is still a small footgun
* Trying to avoid consuming more than one token per state
  * This is required, because of comments
  * The C++ compiler allows comments between all tokens
  * We therefor have to consume comment tokens between each state
* Reordered states so they are grouped in some logical fasion

```

## Parents

- [0d8646d262ebc3db6631421db8fc79228b6622f8](https://git.cafe/gitcafe/zig/commit/0d8646d262ebc3db6631421db8fc79228b6622f8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/206c0b8bdb4838010d6a1e70135134dc3edc6723?format=markdown)
