queries
c.h c.scm cpp.h cpp.scm cuda.h cuda.scm glsl.h glsl.scm go.h go.scm javascript.h javascript.scm kotlin.h kotlin.scm lua.h lua.scm odin.h odin.scm php.h php.scm python.h python.scm rust.h rust.scm tcl.h tcl.scm zig.h zig.scmtests
test.c test.cpp test.cu test.cuh test.glsl test.go test.js test.kt test.lua test.odin test.php test.py test.rs test.tcl test.zigvendor
tree-sitter
lib
src
alloc.c alloc.h array.h atomic.h clock.h error_costs.h get_changed_ranges.c get_changed_ranges.h host.h language.c language.h length.h lexer.c lexer.h lib.c node.c parser.c point.h query.c reduce_action.h reusable_node.h stack.c stack.h subtree.c subtree.h tree.c tree.h tree_cursor.c tree_cursor.h unicode.h
tests/test.php
raw
1<?php
2
3function simple_function() {
4 echo "Hello";
5}
6
7function function_with_args($a, $b) {
8 return $a + $b;
9}
10
11class MyClass {
12 public function myMethod() {
13 echo "Method";
14 }
15
16 protected static function protectedStaticMethod() {
17 // ...
18 }
19}
20
21const GLOBAL_CONST = 1;
22
23class AnotherClass {
24 const CLASS_CONST = 2;
25}
26
27interface MyInterface {
28 public function interfaceMethod();
29}