diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-04-21 04:06:20 -0400 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-04-21 18:24:17 -0400 |
| commit | 85330918f05b3a4bd342a69063e7ef5fcdfadd2e (patch) | |
| tree | 6b38f8e3af9ad1079ba94ffc7056263b056d0c00 /queries/zig | |
| parent | fix(c): types are optional in sized_type_specifier (diff) | |
| download | nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.tar nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.tar.gz nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.tar.bz2 nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.tar.lz nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.tar.xz nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.tar.zst nvim-treesitter-85330918f05b3a4bd342a69063e7ef5fcdfadd2e.zip | |
perf: remove match where possible
Diffstat (limited to 'queries/zig')
| -rw-r--r-- | queries/zig/highlights.scm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/queries/zig/highlights.scm b/queries/zig/highlights.scm index 37afe1c2f..72d2e642b 100644 --- a/queries/zig/highlights.scm +++ b/queries/zig/highlights.scm @@ -24,7 +24,7 @@ parameter: (IDENTIFIER) @parameter field_access: (IDENTIFIER) parameter: (IDENTIFIER) ] @type - (#match? @type "^[A-Z]([a-z]+[A-Za-z0-9]*)*$") + (#lua-match? @type "^%u([%l]+[%u%l%d]*)*$") ) ;; assume camelCase is a function ( @@ -33,7 +33,7 @@ parameter: (IDENTIFIER) @parameter field_access: (IDENTIFIER) parameter: (IDENTIFIER) ] @function - (#match? @function "^[a-z]+([A-Z][a-z0-9]*)+$") + (#lua-match? @function "^%l+([%u][%l%d]*)+$") ) ;; assume all CAPS_1 is a constant @@ -42,7 +42,7 @@ parameter: (IDENTIFIER) @parameter variable_type_function: (IDENTIFIER) field_access: (IDENTIFIER) ] @constant - (#match? @constant "^[A-Z][A-Z_0-9]+$") + (#lua-match? @constant "^%u[%u%d_]+$") ) [ |
