@@ -13,22 +13,22 @@ import { Graph, RedisClientType, RedisDefaultModules, createClient } from 'falko
13
13
// Tree-Sitter queries
14
14
//-----------------------------------------------------------------------------
15
15
16
- let parser ;
16
+ let parser : Parser ;
17
17
18
18
// class definition tree-sitter query
19
19
// responsible for matching class definition, in addition to extracting the class name
20
- let class_definition_query ;
20
+ let class_definition_query : Parser . Query ;
21
21
22
22
// function definition tree-sitter query
23
23
// responsible for matching function definition, in addition to extracting the function name
24
- let function_definition_query ;
24
+ let function_definition_query : Parser . Query ;
25
25
26
26
// function call tree-sitter query
27
27
// responsible for matching function calls, in addition to extracting the callee function name
28
- let function_call_query ;
28
+ let function_call_query : Parser . Query ;
29
29
30
30
// Process Python file (Module)
31
- function processPythonSource ( source_file ) {
31
+ function processPythonSource ( source_file : string ) {
32
32
// read file
33
33
fs . readFile ( source_file , 'utf8' , function ( err : any , source : string ) {
34
34
if ( err ) {
@@ -49,7 +49,7 @@ function processPythonSource(source_file) {
49
49
}
50
50
51
51
// Process Class declaration
52
- function processClassDeclaration ( source_file , match ) {
52
+ function processClassDeclaration ( source_file : string , match : Parser . QueryMatch ) {
53
53
let class_node = match . captures [ 0 ] . node ;
54
54
let class_name = match . captures [ 1 ] . node . text ;
55
55
console . log ( "Class node: " + class_node ) ;
@@ -63,7 +63,7 @@ function processClassDeclaration(source_file, match) {
63
63
}
64
64
65
65
// Process function declaration
66
- function processFunctionDeclaration ( source_file , match ) {
66
+ function processFunctionDeclaration ( source_file : string , match : Parser . QueryMatch ) {
67
67
let function_node = match . captures [ 0 ] . node ;
68
68
let function_name = match . captures [ 1 ] . node . text ;
69
69
//console.log("Function definition Node: " + function_node);
0 commit comments