Skip to content

Commit

Permalink
use keyword.declaration
Browse files Browse the repository at this point in the history
fixup! use keyword.declaration
  • Loading branch information
gwenzek authored and aidenfoxivey committed Aug 10, 2024
1 parent 86f7c55 commit aa5ee2f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions Syntaxes/Zig.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ contexts:
function_def:
- match: '\b(fn)\s+([a-zA-Z_]\w*|@\".+\")(\()'
captures:
1: storage.type.function.zig
1: keyword.declaration.function.zig
2: entity.name.function
3: punctuation.section.parens.begin.zig
push:
Expand All @@ -147,7 +147,7 @@ contexts:
function_type:
- match: \b(fn)\s*(\()
captures:
1: storage.type.function.zig
1: keyword.declaration.function.zig
2: punctuation.section.parens.begin.zig
push:
- meta_content_scope: meta.function.parameters.zig
Expand Down Expand Up @@ -234,19 +234,19 @@ contexts:
storage:
- match: '\b(anyframe)\b\s*(->)?\s*(?:([a-zA-Z_][\w.]*|@\".+\")\b(?!\s*\())?'
captures:
1: storage.type.zig
1: keyword.declaration.anyframe.zig
2: keyword.operator.zig
3: storage.type.zig
3: keyword.declaration.zig
- match: \btest\b
scope: storage.type.test.zig
scope: keyword.declaration.test.zig
- match: \bstruct\b
scope: storage.type.struct.zig
scope: keyword.declaration.struct.zig
- match: \benum\b
scope: storage.type.enum.zig
scope: keyword.declaration.enum.zig
- match: \bunion\b
scope: storage.type.union.zig
scope: keyword.declaration.union.zig
- match: \berror\b
scope: storage.type.error.zig
scope: keyword.declaration.error.zig
storage_modifier:
- match: \b(const|var|extern|packed|export|pub|noalias|inline|noinline|comptime|volatile|align|linksection|threadlocal|allowzero)\b
scope: storage.modifier.zig
Expand Down Expand Up @@ -280,10 +280,10 @@ contexts:
scope: variable.constant.zig

- match: '\b[_a-zA-Z][_a-zA-Z0-9]*_t\b'
scope: entity.name.type.zig
scope: storage.type.zig

- match: '\b[A-Z][a-zA-Z0-9]*\b'
scope: entity.name.type.zig
scope: storage.type.zig

- match: '\b[_a-zA-Z][_a-zA-Z0-9]*\b'
scope: variable.zig
Expand All @@ -292,6 +292,6 @@ contexts:
- match: \b(test)\b\s+(\")(.*)(\")
captures:
0: entity.name.function.test.zig
1: storage.type.zig keyword.declaration.test.zig
1: keyword.declaration.test.zig
2: punctuation.string.start.zig
4: punctuation.string.end.zig
24 changes: 12 additions & 12 deletions Syntaxes/syntax_test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const std = @import("std");

pub fn main() !void {
//^ storage.modifier.zig
// ^^ storage.type.function.zig
// ^^ keyword.declaration.function.zig
// ^^^^ entity.name.function
// ^ punctuation.section.parens.begin.zig
// ^ punctuation.section.parens.end.zig
Expand Down Expand Up @@ -55,7 +55,7 @@ asd {
}

fn dump(
// ^^ storage.type.function.zig
// ^^ keyword.declaration.function.zig
// ^^^^ entity.name.function
// ^ punctuation.section.parens.begin.zig
value: var.asda.ad.asd,
Expand Down Expand Up @@ -180,7 +180,7 @@ a.*
a || b

test "tests" {
// ^^^^ storage.type.zig keyword.declaration.test.zig
// ^^^^ keyword.declaration.test.zig
// ^^^^^^^^^^^^ entity.name.function.test.zig
// ^ punctuation.section.braces.begin.zig
}
Expand Down Expand Up @@ -254,7 +254,7 @@ const \\ adsjfaf23n9
const v = fn(aas, 2342, 23) as;

fn foo(a:as) i32 {
// <- storage.type.function.zig
// <- keyword.declaration.function.zig
// ^^^ entity.name.function
// ^ punctuation.section.parens.begin.zig
// ^ variable.parameter.zig
Expand Down Expand Up @@ -312,7 +312,7 @@ test "strings" {
'💩';
}
fn(i13i,Foo) Bar;
// ^^ storage.type.function.zig
// ^^ keyword.declaration.function.zig
// ^ punctuation.section.parens.begin.zig
// ^^^^ meta.function.parameters.zig storage.type.zig
// ^ meta.function.parameters.zig punctuation.separator.zig
Expand Down Expand Up @@ -441,21 +441,21 @@ pub fn asBytes(ptr: var) asdsa!AsBytesReturnType(@typeOf(ptr)) {
pub const LARGE_INTEGER = extern struct {
// <- storage.modifier.zig
// ^^^^^ storage.modifier.zig
// ^^^^^^^^^^^^^ entity.name.struct.zig
// ^^^^^^^^^^^^^ entity.name.class.struct.zig
// ^ keyword.operator.assignment.zig
// ^^^^^^ storage.modifier.zig
// ^^^^^^ storage.type.struct.zig
// ^^^^^^ keyword.declaration.struct.zig
// ^ punctuation.section.braces.begin.zig
_u2: extern struct {
// ^^^ variable.other.member.zig
// ^ punctuation.separator.zig
// ^^^^^^ storage.modifier.zig
// ^^^^^^ storage.type.struct.zig
// ^^^^^^ keyword.declaration.struct.zig
// ^ punctuation.section.braces.begin.zig
LowPart: fn(a, b, c)d,
// ^^^^^^^ variable.other.member.zig
// ^ punctuation.separator.zig
// ^^ storage.type.function.zig
// ^^ keyword.declaration.function.zig
// ^ punctuation.section.parens.begin.zig
// ^ meta.function.parameters.zig storage.type.zig
// ^ meta.function.parameters.zig punctuation.separator.zig
Expand All @@ -481,10 +481,10 @@ pub const LARGE_INTEGER = extern struct {

pub const GUID = extern struct {
// ^^^^^ storage.modifier.zig
// ^^^^ entity.name.struct.zig
// ^^^^ entity.name.class.struct.zig
// ^ keyword.operator.assignment.zig
// ^^^^^^ storage.modifier.zig
// ^^^^^^ storage.type.struct.zig
// ^^^^^^ keyword.declaration.struct.zig
// ^ punctuation.section.braces.begin.zig
Data1: c_ulong,
// ^^^^^ variable.other.member.zig
Expand All @@ -501,7 +501,7 @@ pub const GUID = extern struct {

pub async fn function() Error!ReturnType {
// ^^^^^ keyword.control.async.zig
// ^^ storage.type.function.zig
// ^^ keyword.declaration.function.zig
// ^^^^^^^^ entity.name.function
}

Expand Down

0 comments on commit aa5ee2f

Please sign in to comment.