Fix parsing of built-in Zig identifiers

Fixes #248
unified_patch
Wilfred Hughes 2022-04-09 19:38:07 +07:00
parent 3c6db050dc
commit 1c9ae2fbc6
4 changed files with 9 additions and 5 deletions

@ -1,5 +1,9 @@
## 0.27 (unreleased)
### Parsing
Fixed Zig parsing of `@foo` identifiers.
## 0.26 (released 9th April 2022)
### Build

@ -143,5 +143,5 @@ sample_files/yaml_before.yaml sample_files/yaml_after.yaml
1ae5db1355627f3ca607d76c3e6eed9a -
sample_files/zig_before.zig sample_files/zig_after.zig
fb12532adf98607fc20836b4a6ccd6d8 -
8f02e56a47db8f889fa995a1049ab905 -

@ -1,5 +1,3 @@
const std = @import("std");
pub fn main() void {
std.debug.print("Hello, {s}!", .{"world"});
}
}

@ -580,7 +580,9 @@ pub fn from_language(language: guess::Language) -> TreeSitterConfig {
TreeSitterConfig {
name: "Zig",
language,
atom_nodes: (vec!["STRINGLITERALSINGLE"]).into_iter().collect(),
atom_nodes: vec!["STRINGLITERALSINGLE", "BUILTINIDENTIFIER"]
.into_iter()
.collect(),
delimiter_tokens: (vec![("{", "}"), ("[", "]"), ("(", ")")])
.into_iter()
.collect(),