diff --git a/data/fixtures/scopes/zig/argument.actual.iteration.scope b/data/fixtures/scopes/zig/argument.actual.iteration.scope new file mode 100644 index 0000000000..131575792b --- /dev/null +++ b/data/fixtures/scopes/zig/argument.actual.iteration.scope @@ -0,0 +1,2 @@ +foo(aaa, bbb); +--- diff --git a/data/fixtures/scopes/zig/argument.actual.multiLine.scope b/data/fixtures/scopes/zig/argument.actual.multiLine.scope new file mode 100644 index 0000000000..f5787791ec --- /dev/null +++ b/data/fixtures/scopes/zig/argument.actual.multiLine.scope @@ -0,0 +1,5 @@ +foo( + aaa, + bbb +); +--- diff --git a/data/fixtures/scopes/zig/argument.actual.singleLine.scope b/data/fixtures/scopes/zig/argument.actual.singleLine.scope new file mode 100644 index 0000000000..6568e7a68c --- /dev/null +++ b/data/fixtures/scopes/zig/argument.actual.singleLine.scope @@ -0,0 +1,10 @@ +foo(aaa, bbb); +--- + +[Content] = +[Removal] = +[Domain] = 0:4-0:6 + >--< +0| foo(aa); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/argument.formal.iteration.scope b/data/fixtures/scopes/zig/argument.formal.iteration.scope new file mode 100644 index 0000000000..39b5001413 --- /dev/null +++ b/data/fixtures/scopes/zig/argument.formal.iteration.scope @@ -0,0 +1,10 @@ +fn foo(aaa: u8, bbb: u8) void {} +--- + +[Content] = 0:7-0:23 + >----------------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[Domain] = 0:0-0:32 + >--------------------------------< +0| fn foo(aaa: u8, bbb: u8) void {} diff --git a/data/fixtures/scopes/zig/argument.formal.multiLine.scope b/data/fixtures/scopes/zig/argument.formal.multiLine.scope new file mode 100644 index 0000000000..1d5a0a7a7c --- /dev/null +++ b/data/fixtures/scopes/zig/argument.formal.multiLine.scope @@ -0,0 +1,44 @@ +fn foo( + aa: u8, + bb: u8, +) void {} +--- + +[#1 Content] = +[#1 Domain] = 1:4-1:10 + >------< +1| aa: u8, + +[#1 Removal] = 1:4-2:4 + >------- +1| aa: u8, +2| bb: u8, + ----< + +[#1 Trailing delimiter] = 1:10-2:4 + >- +1| aa: u8, +2| bb: u8, + ----< + +[#1 Insertion delimiter] = ",\n" + + +[#2 Content] = +[#2 Domain] = 2:4-2:10 + >------< +2| bb: u8, + +[#2 Removal] = 1:10-2:10 + >- +1| aa: u8, +2| bb: u8, + ----------< + +[#2 Leading delimiter] = 1:10-2:4 + >- +1| aa: u8, +2| bb: u8, + ----< + +[#2 Insertion delimiter] = ",\n" diff --git a/data/fixtures/scopes/zig/argument.formal.singleLine.scope b/data/fixtures/scopes/zig/argument.formal.singleLine.scope new file mode 100644 index 0000000000..04edfa7086 --- /dev/null +++ b/data/fixtures/scopes/zig/argument.formal.singleLine.scope @@ -0,0 +1,10 @@ +fn foo(arg: u8) void {} +--- + +[Content] = +[Removal] = +[Domain] = 0:7-0:14 + >-------< +0| fn foo(arg: u8) void {} + +[Insertion delimiter] = ", " diff --git a/data/fixtures/scopes/zig/argumentList.actual.empty.scope b/data/fixtures/scopes/zig/argumentList.actual.empty.scope new file mode 100644 index 0000000000..7f62df58de --- /dev/null +++ b/data/fixtures/scopes/zig/argumentList.actual.empty.scope @@ -0,0 +1,13 @@ +foo(); +--- + +[Content] = +[Removal] = 0:4-0:4 + >< +0| foo(); + +[Domain] = 0:0-0:5 + >-----< +0| foo(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/argumentList.actual.multiLine.scope b/data/fixtures/scopes/zig/argumentList.actual.multiLine.scope new file mode 100644 index 0000000000..131575792b --- /dev/null +++ b/data/fixtures/scopes/zig/argumentList.actual.multiLine.scope @@ -0,0 +1,2 @@ +foo(aaa, bbb); +--- diff --git a/data/fixtures/scopes/zig/argumentList.actual.singleLine.scope b/data/fixtures/scopes/zig/argumentList.actual.singleLine.scope new file mode 100644 index 0000000000..e11f994e9f --- /dev/null +++ b/data/fixtures/scopes/zig/argumentList.actual.singleLine.scope @@ -0,0 +1,13 @@ +foo(aaa, bbb); +--- + +[Content] = +[Removal] = 0:4-0:12 + >--------< +0| foo(aaa, bbb); + +[Domain] = 0:0-0:13 + >-------------< +0| foo(aaa, bbb); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/argumentList.formal.empty.scope b/data/fixtures/scopes/zig/argumentList.formal.empty.scope new file mode 100644 index 0000000000..1f9b49ec0f --- /dev/null +++ b/data/fixtures/scopes/zig/argumentList.formal.empty.scope @@ -0,0 +1,13 @@ +fn foo() void {} +--- + +[Content] = +[Removal] = 0:7-0:7 + >< +0| fn foo() void {} + +[Domain] = 0:0-0:16 + >----------------< +0| fn foo() void {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/argumentList.formal.multiLine.scope b/data/fixtures/scopes/zig/argumentList.formal.multiLine.scope new file mode 100644 index 0000000000..5ef23675b0 --- /dev/null +++ b/data/fixtures/scopes/zig/argumentList.formal.multiLine.scope @@ -0,0 +1,32 @@ +foo( + aaa, + bbb +); +--- + +[Content] = 1:4-2:7 + >----- +1| aaa, +2| bbb + -------< + +[Removal] = 1:0-3:0 + >--------- +1| aaa, +2| bbb +3| ); + < + +[Leading delimiter] = 1:0-1:4 + >----< +1| aaa, + +[Domain] = 0:0-3:1 + >---- +0| foo( +1| aaa, +2| bbb +3| ); + -< + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/argumentList.formal.singleLine.scope b/data/fixtures/scopes/zig/argumentList.formal.singleLine.scope new file mode 100644 index 0000000000..4f2ffb899b --- /dev/null +++ b/data/fixtures/scopes/zig/argumentList.formal.singleLine.scope @@ -0,0 +1,13 @@ +fn foo(aaa: u8, bbb: u8) void {} +--- + +[Content] = +[Removal] = 0:7-0:23 + >----------------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[Domain] = 0:0-0:32 + >--------------------------------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/functionCall.scope b/data/fixtures/scopes/zig/functionCall.scope new file mode 100644 index 0000000000..633f02ca5e --- /dev/null +++ b/data/fixtures/scopes/zig/functionCall.scope @@ -0,0 +1,10 @@ +foo(); +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:5 + >-----< +0| foo(); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/functionCallee.scope b/data/fixtures/scopes/zig/functionCallee.scope new file mode 100644 index 0000000000..66bd7c37f6 --- /dev/null +++ b/data/fixtures/scopes/zig/functionCallee.scope @@ -0,0 +1,13 @@ +foo(aa, bb); +--- + +[Content] = +[Removal] = 0:0-0:3 + >---< +0| foo(aa, bb); + +[Domain] = 0:0-0:11 + >-----------< +0| foo(aa, bb); + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/name.argument.formal.scope b/data/fixtures/scopes/zig/name.argument.formal.scope new file mode 100644 index 0000000000..f042beeb11 --- /dev/null +++ b/data/fixtures/scopes/zig/name.argument.formal.scope @@ -0,0 +1,55 @@ +fn foo(aaa: u8, bbb: u8) void {} +--- + +[#1 Content] = +[#1 Removal] = 0:3-0:6 + >---< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Leading delimiter] = 0:2-0:3 + >-< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Domain] = 0:0-0:32 + >--------------------------------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:7-0:10 + >---< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#2 Removal] = 0:7-0:16 + >---------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#2 Trailing delimiter] = 0:10-0:16 + >------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#2 Domain] = 0:7-0:14 + >-------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 0:16-0:19 + >---< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#3 Removal] = 0:14-0:19 + >-----< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#3 Leading delimiter] = 0:14-0:16 + >--< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#3 Domain] = 0:16-0:23 + >-------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/name.assignment.scope b/data/fixtures/scopes/zig/name.assignment.scope new file mode 100644 index 0000000000..cb6a3eab56 --- /dev/null +++ b/data/fixtures/scopes/zig/name.assignment.scope @@ -0,0 +1,24 @@ +const foo = "bar"; +--- + +[Content] = 0:6-0:9 + >---< +0| const foo = "bar"; + +[Removal] = 0:6-0:10 + >----< +0| const foo = "bar"; + +[Leading delimiter] = 0:5-0:6 + >-< +0| const foo = "bar"; + +[Trailing delimiter] = 0:9-0:10 + >-< +0| const foo = "bar"; + +[Domain] = 0:0-0:18 + >------------------< +0| const foo = "bar"; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/name.function.scope b/data/fixtures/scopes/zig/name.function.scope new file mode 100644 index 0000000000..cce2929c6d --- /dev/null +++ b/data/fixtures/scopes/zig/name.function.scope @@ -0,0 +1,17 @@ +fn foo() void {} +--- + +[Content] = +[Removal] = 0:3-0:6 + >---< +0| fn foo() void {} + +[Leading delimiter] = 0:2-0:3 + >-< +0| fn foo() void {} + +[Domain] = 0:0-0:16 + >----------------< +0| fn foo() void {} + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/namedFunction.scope b/data/fixtures/scopes/zig/namedFunction.scope new file mode 100644 index 0000000000..da391d1a06 --- /dev/null +++ b/data/fixtures/scopes/zig/namedFunction.scope @@ -0,0 +1,10 @@ +fn someFunk() void {} +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:21 + >---------------------< +0| fn someFunk() void {} + +[Insertion delimiter] = "\n\n" diff --git a/data/fixtures/scopes/zig/statement.assignment.scope b/data/fixtures/scopes/zig/statement.assignment.scope new file mode 100644 index 0000000000..60eb993e9e --- /dev/null +++ b/data/fixtures/scopes/zig/statement.assignment.scope @@ -0,0 +1,10 @@ +const foo = "hello"; +--- + +[Content] = +[Removal] = +[Domain] = 0:0-0:20 + >--------------------< +0| const foo = "hello"; + +[Insertion delimiter] = "\n" diff --git a/data/fixtures/scopes/zig/type.argument.formal.iteration.scope b/data/fixtures/scopes/zig/type.argument.formal.iteration.scope new file mode 100644 index 0000000000..571c7b2966 --- /dev/null +++ b/data/fixtures/scopes/zig/type.argument.formal.iteration.scope @@ -0,0 +1,2 @@ +fn foo(aaa: u8, bbb: u8) void {} +--- diff --git a/data/fixtures/scopes/zig/type.argument.formal.scope b/data/fixtures/scopes/zig/type.argument.formal.scope new file mode 100644 index 0000000000..8a179c3571 --- /dev/null +++ b/data/fixtures/scopes/zig/type.argument.formal.scope @@ -0,0 +1,62 @@ +fn foo(aaa: u8, bbb: u8) void {} +--- + +[#1 Content] = 0:25-0:29 + >----< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Removal] = 0:25-0:30 + >-----< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Leading delimiter] = 0:24-0:25 + >-< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Trailing delimiter] = 0:29-0:30 + >-< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Domain] = 0:0-0:32 + >--------------------------------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:12-0:14 + >--< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#2 Removal] = 0:12-0:16 + >----< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#2 Trailing delimiter] = 0:14-0:16 + >--< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#2 Domain] = 0:7-0:14 + >-------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 0:21-0:23 + >--< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#3 Removal] = 0:14-0:23 + >---------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#3 Leading delimiter] = 0:14-0:21 + >-------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#3 Domain] = 0:16-0:23 + >-------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/type.return.scope b/data/fixtures/scopes/zig/type.return.scope new file mode 100644 index 0000000000..8a179c3571 --- /dev/null +++ b/data/fixtures/scopes/zig/type.return.scope @@ -0,0 +1,62 @@ +fn foo(aaa: u8, bbb: u8) void {} +--- + +[#1 Content] = 0:25-0:29 + >----< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Removal] = 0:25-0:30 + >-----< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Leading delimiter] = 0:24-0:25 + >-< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Trailing delimiter] = 0:29-0:30 + >-< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Domain] = 0:0-0:32 + >--------------------------------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#1 Insertion delimiter] = " " + + +[#2 Content] = 0:12-0:14 + >--< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#2 Removal] = 0:12-0:16 + >----< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#2 Trailing delimiter] = 0:14-0:16 + >--< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#2 Domain] = 0:7-0:14 + >-------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#2 Insertion delimiter] = " " + + +[#3 Content] = 0:21-0:23 + >--< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#3 Removal] = 0:14-0:23 + >---------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#3 Leading delimiter] = 0:14-0:21 + >-------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#3 Domain] = 0:16-0:23 + >-------< +0| fn foo(aaa: u8, bbb: u8) void {} + +[#3 Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/type.variable.scope b/data/fixtures/scopes/zig/type.variable.scope new file mode 100644 index 0000000000..33ba156573 --- /dev/null +++ b/data/fixtures/scopes/zig/type.variable.scope @@ -0,0 +1,24 @@ +const foo: u8 = 0; +--- + +[Content] = 0:11-0:13 + >--< +0| const foo: u8 = 0; + +[Removal] = 0:11-0:14 + >---< +0| const foo: u8 = 0; + +[Leading delimiter] = 0:10-0:11 + >-< +0| const foo: u8 = 0; + +[Trailing delimiter] = 0:13-0:14 + >-< +0| const foo: u8 = 0; + +[Domain] = 0:0-0:18 + >------------------< +0| const foo: u8 = 0; + +[Insertion delimiter] = " " diff --git a/data/fixtures/scopes/zig/value.assignment.scope b/data/fixtures/scopes/zig/value.assignment.scope new file mode 100644 index 0000000000..b679fbff3b --- /dev/null +++ b/data/fixtures/scopes/zig/value.assignment.scope @@ -0,0 +1,20 @@ +const foo = "bar"; +--- + +[Content] = 0:12-0:17 + >-----< +0| const foo = "bar"; + +[Removal] = 0:11-0:17 + >------< +0| const foo = "bar"; + +[Leading delimiter] = 0:11-0:12 + >-< +0| const foo = "bar"; + +[Domain] = 0:0-0:18 + >------------------< +0| const foo = "bar"; + +[Insertion delimiter] = " " diff --git a/data/playground/zig.zig b/data/playground/zig.zig new file mode 100644 index 0000000000..be68c8c3b7 --- /dev/null +++ b/data/playground/zig.zig @@ -0,0 +1,12 @@ +const std = @import("std"); + +const bob: *const [6]u8 = "bobert"; +const b = "bobert"; +fn printNumber(num: u8, numTwo: u8, numThree: u8) void { + std.debug.print("%n", .{ num, numTwo, numThree }); +} +fn foo() void {} +fn main() !void { + printNumber(3, 4, 20); + foo(); +} diff --git a/packages/common/src/scopeSupportFacets/languageScopeSupport.ts b/packages/common/src/scopeSupportFacets/languageScopeSupport.ts index d1cfc7879b..41cefba4aa 100644 --- a/packages/common/src/scopeSupportFacets/languageScopeSupport.ts +++ b/packages/common/src/scopeSupportFacets/languageScopeSupport.ts @@ -32,6 +32,7 @@ import { typescriptScopeSupport } from "./typescript"; import { typescriptreactScopeSupport } from "./typescriptreact"; import { xmlScopeSupport } from "./xml"; import { yamlScopeSupport } from "./yaml"; +import { zigScopeSupport } from "./zig"; /* eslint-disable @typescript-eslint/naming-convention */ @@ -69,4 +70,5 @@ export const languageScopeSupport: StringRecord = typescriptreact: typescriptreactScopeSupport, xml: xmlScopeSupport, yaml: yamlScopeSupport, + zig: zigScopeSupport, }; diff --git a/packages/common/src/scopeSupportFacets/zig.ts b/packages/common/src/scopeSupportFacets/zig.ts new file mode 100644 index 0000000000..057a21933d --- /dev/null +++ b/packages/common/src/scopeSupportFacets/zig.ts @@ -0,0 +1,118 @@ +import type { LanguageScopeSupportFacetMap } from "./scopeSupportFacets.types"; +import { ScopeSupportFacetLevel } from "./scopeSupportFacets.types"; + +const { supported, notApplicable, unsupported } = ScopeSupportFacetLevel; + +export const zigScopeSupport: LanguageScopeSupportFacetMap = { + namedFunction: supported, + functionCall: supported, + functionCallee: supported, + "argument.formal.singleLine": supported, + "argument.formal.multiLine": supported, + "argument.formal.iteration": supported, + "argument.actual.singleLine": supported, + "argument.actual.multiLine": supported, + "argument.actual.iteration": supported, + "argumentList.formal.singleLine": supported, + "argumentList.formal.multiLine": supported, + "argumentList.formal.empty": supported, + "argumentList.actual.singleLine": supported, + "argumentList.actual.multiLine": supported, + "argumentList.actual.empty": supported, + "statement.assignment": supported, + "name.assignment": supported, + "name.function": supported, + "name.argument.formal": supported, + "value.assignment": supported, + "type.argument.formal": supported, + "type.argument.formal.iteration": supported, + "type.return": supported, + "type.variable": supported, + + /* UNSUPPORTED */ + + list: unsupported, + + "statement.function": unsupported, + "statement.class": unsupported, + "statement.if": unsupported, + "statement.try": unsupported, + "statement.for": unsupported, + "statement.foreach": unsupported, + "statement.return": unsupported, + "statement.break": unsupported, + "statement.continue": unsupported, + "statement.doWhile": unsupported, + "statement.enum": unsupported, + "statement.field.class": unsupported, + "statement.method": unsupported, + "statement.misc": unsupported, + "statement.switch": unsupported, + "statement.variable": unsupported, + + "comment.line": unsupported, + "comment.block": unsupported, + + "string.multiLine": unsupported, + "string.singleLine": unsupported, + + "branch.if": unsupported, + "branch.if.elif.else": unsupported, + "branch.if.else": unsupported, + "branch.if.iteration": unsupported, + "branch.try": unsupported, + "branch.try.iteration": unsupported, + "branch.switchCase": unsupported, + "branch.switchCase.iteration": unsupported, + + "condition.if": unsupported, + "condition.while": unsupported, + "condition.doWhile": unsupported, + "condition.for": unsupported, + "condition.ternary": unsupported, + "condition.switchCase": unsupported, + "condition.switchCase.iteration": unsupported, + + "name.argument.catch": unsupported, + "name.foreach": unsupported, + + "value.argument.formal": unsupported, + "value.argument.formal.iteration": unsupported, + "value.variable": unsupported, + "value.foreach": unsupported, + "value.return": unsupported, + "value.switch": unsupported, + "value.iteration.block": unsupported, + + "interior.class": unsupported, + "interior.function": unsupported, + "interior.constructor": unsupported, + "interior.method": unsupported, + "interior.if": unsupported, + "interior.lambda": unsupported, + "interior.for": unsupported, + "interior.foreach": unsupported, + "interior.while": unsupported, + "interior.doWhile": unsupported, + "interior.switch": unsupported, + "interior.switchCase": unsupported, + "interior.try": unsupported, + + // /* NOT APPLICABLE */ + + // Section + section: notApplicable, + "section.iteration.document": notApplicable, + "section.iteration.parent": notApplicable, + + // Command + command: notApplicable, + "statement.command": notApplicable, + "name.command": notApplicable, + "value.command": notApplicable, + "interior.command": notApplicable, + + // Notebook cell + notebookCell: notApplicable, + "interior.cell": notApplicable, +}; diff --git a/queries/zig.scm b/queries/zig.scm new file mode 100644 index 0000000000..dbd2a6bedb --- /dev/null +++ b/queries/zig.scm @@ -0,0 +1,65 @@ +;;!! fn foo() void {} +;;! ^^^ name +;;! ^^^^ type +;;! ---------------- namedFunction ^domain +(function_declaration + name: (_) @name + type: (_) @type +) @namedFunction @_.domain + +;;!! fn foo(aa: u8) void {} +;;! ^^ name +;;! ^^ type +;;! ^^^^^^ argumentOrParameter ^domain +;;! ---------------------- ^domain +(function_declaration + (parameters + (_)? @_.leading.endOf + . + (parameter + (identifier) @name + ":" + type: (_) @type + ) @argumentOrParameter @_.domain + . + (_)? @_.trailing.startOf + ) @_dummy + (#not-type? @argumentOrParameter "comment") + (#single-or-multi-line-delimiter! @argumentOrParameter @_dummy ", " ",\n") +) @argumentOrParameter.domain @_.domain + +;;!! fn foo(aa: u8, bb:u8) void {} +;;! ^^^^^^^^^^^^^ argumentList +;;! ----------------------------- ^domain +(function_declaration + (parameters) @argumentList + (#child-range! @argumentList 1 -2) +) @argumentList.domain + +;;!! foo(aa, bb); +;;! ^^^ functionCallee +;;! ^^^^^^ argumentList +;;! ^^ ^^ argumentOrParameter +;;! ----------- functionCall ^domain +(call_expression + function: (_) @functionCallee + (arguments + (_)* @argumentOrParameter + ) @argumentList @_.domain + (#child-range! @argumentList 1 -2) +) @functionCall @_.domain + +(statement) @statement + +;;!! const foo: *const [3]u8 = "bar"; +;;! ^^^ name +;;! ^^^^^^^^^^^^ type +;;! ^^^^^ value +;;! -------------------------------- statement ^domain +(variable_declaration + (identifier) @name + type: (_)? @type + "=" + (_) @value + ";" +) @statement @_.domain