# std/zig/ast: fix Tree.lastToken\(\) for blocks · gitcafe/zig

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

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

Visibility: public

Requested revision: 57cec38e6144754fcd15266100974a7cf0059570

Requested commit: 57cec38e6144754fcd15266100974a7cf0059570

Commit: 57cec38e6144754fcd15266100974a7cf0059570

Tree: 0e84bb83b0802b7643236cf64585a7c46d7e6543

Author: Isaac Freund

Committer: Andrew Kelley

## Message

```
std/zig/ast: fix Tree.lastToken() for blocks

The fact that blocks may end in a semicolon but this semicolon is not
counted by recursive lastToken() evaluation on the sub expression causes
off-by-one errors for lastToken() on blocks currently.

To fix this, introduce BlockSemicolon and BlockTwoSemicolon following
the pattern used for trailing commas in e.g. builtin function arguments.

```

## Parents

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

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