Skip to content

Commit

Permalink
Merge pull request #225 from calebdw/bump_cli
Browse files Browse the repository at this point in the history
chore: bump tree-sitter-cli version to 0.21.0
  • Loading branch information
calebdw authored Feb 25, 2024
2 parents 1ea74a6 + f833f53 commit ae9ef7d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 23 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"eslint-config-google": "^0.14.0",
"node-gyp": "^10.0.1",
"shelljs": "^0.8.5",
"tree-sitter-cli": "^0.20.8"
"tree-sitter-cli": "^0.21.0"
},
"scripts": {
"build": "npm run build-php && npm run build-php_only && node-gyp rebuild",
Expand All @@ -49,7 +49,10 @@
"queries/injections.scm",
"queries/injections-text.scm"
],
"tags": "queries/tags.scm"
"tags": "queries/tags.scm",
"external-files": [
"common/scanner.h"
]
}
]
}
1 change: 0 additions & 1 deletion php/src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -9192,4 +9192,3 @@
"_literal"
]
}

1 change: 0 additions & 1 deletion php_only/src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -9183,4 +9183,3 @@
"_literal"
]
}

35 changes: 18 additions & 17 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
(php_tag) @tag
"?>" @tag


; Variables

(relative_scope) @variable.builtin

(variable_name) @variable

((name) @constant
(#match? @constant "^_?[A-Z][A-Z\\d_]+$"))
((name) @constant.builtin
(#match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))

((name) @constructor
(#match? @constructor "^[A-Z]"))

; Types

(primitive_type) @type.builtin
Expand Down Expand Up @@ -38,23 +53,6 @@
(member_access_expression
name: (name) @property)

; Variables

(relative_scope) @variable.builtin

((name) @constant
(#match? @constant "^_?[A-Z][A-Z\\d_]+$"))
((name) @constant.builtin
(#match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))

((name) @constructor
(#match? @constructor "^[A-Z]"))

((name) @variable.builtin
(#eq? @variable.builtin "this"))

(variable_name) @variable

; Basic tokens
[
(string)
Expand All @@ -70,6 +68,9 @@
(float) @number
(comment) @comment

((name) @variable.builtin
(#eq? @variable.builtin "this"))

"$" @operator

; Keywords
Expand Down
4 changes: 2 additions & 2 deletions script/parse-examples
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ function clone_repo {
path=examples/$name
if [ ! -d "$path" ]; then
echo "Cloning $owner/$name"
git clone "https://github.com/$owner/$name" "$path"
git clone --depth 1 "https://github.com/$owner/$name" "$path"
fi

pushd "$path" >/dev/null
actual_sha=$(git rev-parse HEAD)
if [ "$actual_sha" != "$sha" ]; then
echo "Updating $owner/$name to $sha"
git fetch
git fetch --depth 1 origin "$sha"
git reset --hard "$sha"
fi
popd >/dev/null
Expand Down

0 comments on commit ae9ef7d

Please sign in to comment.