-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Project import generated by Copybara. (#28)
GitOrigin-RevId: 9509a8e193e25d7a4668eab40f36ecd22c7390ed Co-authored-by: Copybara Bot <[email protected]>
- Loading branch information
1 parent
17bb4a1
commit 5302215
Showing
28 changed files
with
810 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Name: "runtime/parser.h" | ||
Definition (definition.import): | ||
#include "runtime/parser.h" | ||
|
||
|
||
|
||
Name: parser__push | ||
Parameters: (Parser* self, StackVersion version, Tree* tree, | ||
TSStateId state) | ||
Return type: void | ||
Definition (definition.function): | ||
static void parser__push(Parser* self, StackVersion version, Tree* tree, | ||
TSStateId state) { | ||
ts_stack_push(self->stack, version, tree, false, state); | ||
ts_tree_release(tree); | ||
} | ||
|
||
Name: parser__lex | ||
Parameters: (Parser* self, StackVersion version) | ||
Return type: Tree | ||
Definition (definition.function): | ||
static Tree* parser__lex(Parser* self, StackVersion version) { | ||
TSStateId parse_state = ts_stack_top_state(self->stack, version); | ||
Length start_position = ts_stack_top_position(self->stack, version); | ||
TSLexMode lex_mode = self->language->lex_modes[parse_state]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
Name: foo | ||
Parameters: () | ||
Definition (definition.function): | ||
void foo() | ||
|
||
Name: bar | ||
Parameters: () | ||
Doc: | ||
/// bar is a docstring | ||
Definition (definition.function): | ||
int bar() | ||
|
||
Name: fooClassBar | ||
Parameters: () | ||
Doc: | ||
/// FCB docstring | ||
Definition (definition.function): | ||
int fooClassBar() | ||
Lineage: [FooClass] | ||
Lineage types: [class] | ||
|
||
Name: FooClass | ||
Definition (definition.class): | ||
class FooClass { | ||
int someField = 0; | ||
|
||
// Constructor | ||
FooClass() { | ||
this.someField = 0; | ||
} | ||
|
||
/// FCB docstring | ||
int fooClassBar() { | ||
return 0; | ||
} | ||
} | ||
|
||
Name: FooMixin | ||
Definition (definition.class): | ||
mixin FooMixin { | ||
int barMixin() { | ||
return 0; | ||
} | ||
} | ||
|
||
Name: barMixin | ||
Parameters: () | ||
Definition (definition.function): | ||
int barMixin() | ||
Lineage: [FooMixin] | ||
Lineage types: [class] | ||
|
||
Name: bar | ||
Parameters: () | ||
Definition (definition.function): | ||
int bar() | ||
Lineage: [FooBar] | ||
Lineage types: [class] | ||
|
||
Name: FooBar | ||
Definition (definition.class): | ||
class FooBar extends FooClass with Foo { | ||
int bar() { | ||
return 0; | ||
} | ||
} | ||
|
||
Name: main | ||
Parameters: () | ||
Definition (definition.function): | ||
void main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Name: kotlinx.coroutines | ||
Named imports: | ||
kotlinx.coroutines | ||
|
||
Name: kotlinx.coroutines.sync | ||
Named imports: | ||
kotlinx.coroutines.sync | ||
|
||
Name: Foo | ||
Definition (definition.class): | ||
class Foo(param1: Int, param2: Int) { | ||
/** | ||
* Constructor docstring | ||
* | ||
* @param param1 | ||
* @param param2 | ||
*/ | ||
constructor(param1: Int, param2: Int) {} | ||
|
||
/** Method docstring */ | ||
fun methodWithDocstring(): void {} | ||
} | ||
|
||
Name: constructor | ||
Parameters: (param1: Int, param2: Int) | ||
Doc: | ||
/** | ||
* Constructor docstring | ||
* | ||
* @param param1 | ||
* @param param2 | ||
*/ | ||
Declaration (definition.constructor): | ||
constructor(param1: Int, param2: Int) {} | ||
Lineage: [Foo] | ||
Lineage types: [class] | ||
|
||
Name: methodWithDocstring | ||
Parameters: () | ||
Doc: | ||
/** Method docstring */ | ||
Definition (definition.function): | ||
fun methodWithDocstring(): void {} | ||
Lineage: [Foo] | ||
Lineage types: [class] | ||
|
||
Name: fib | ||
Parameters: (n: Int) | ||
Definition (definition.function): | ||
fun fib(n: Int): Int { | ||
if (n == 0 || n == 1) { | ||
return n | ||
} | ||
return fib(n - 1) + fib(n - 2) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
Name: strict | ||
Definition (definition.import): | ||
use strict 1.0; | ||
|
||
Name: feature | ||
Definition (definition.import): | ||
use feature 'class'; | ||
|
||
Name: FooClass | ||
Definition (definition.class): | ||
class FooClass { | ||
field $someField = 42; | ||
|
||
method bar { | ||
say "The answer is $someField"; | ||
} | ||
} | ||
|
||
Name: bar | ||
Definition (definition.function): | ||
method bar { | ||
say "The answer is $someField"; | ||
} | ||
Lineage: [FooClass] | ||
Lineage types: [class] | ||
|
||
Name: foo2 | ||
Parameters: () | ||
Doc: | ||
# foo2 comment | ||
Definition (definition.function): | ||
sub foo2 () { | ||
my $foo = Foo.new; | ||
$foo.bar | ||
} | ||
|
||
Name: new | ||
Parameters: ($class, $firstName, $lastName) | ||
Definition (definition.function): | ||
sub new ($class, $firstName, $lastName) { | ||
bless { firstName => $firstName, lastName => $lastName }, $class | ||
} | ||
|
||
Name: getFirstName | ||
Parameters: ($self) | ||
Definition (definition.function): | ||
sub getFirstName($self) { | ||
$self->{firstName} | ||
} | ||
|
||
Name: Average | ||
Definition (definition.function): | ||
sub Average { | ||
# get total number of arguments passed. | ||
$n = scalar(@_); | ||
$sum = 0; | ||
foreach $item (@_) { | ||
$sum += $item; | ||
} | ||
$average = $sum / $n; | ||
return $average; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Name: b | ||
Definition (definition.package): | ||
package a.b; | ||
Lineage: [a] | ||
Lineage types: [package] | ||
|
||
Name: TestService | ||
Declaration (definition.class): | ||
service TestService { | ||
rpc Echo(EchoRequest) returns (EchoResponse) {} | ||
} | ||
Lineage: [a b] | ||
Lineage types: [package package] | ||
|
||
Name: Echo | ||
Declaration (definition.function): | ||
rpc Echo(EchoRequest) returns (EchoResponse) {} | ||
Lineage: [a b TestService] | ||
Lineage types: [package package class] | ||
|
||
Name: EchoRequest | ||
Doc: | ||
// EchoRequest comment. | ||
Definition (definition.class): | ||
message EchoRequest { | ||
string message = 1; | ||
} | ||
Lineage: [a b] | ||
Lineage types: [package package] | ||
|
||
Name: EchoResponse | ||
Doc: | ||
// EchoResponse comment. | ||
Definition (definition.class): | ||
message EchoResponse { | ||
string message = 1; | ||
} | ||
Lineage: [a b] | ||
Lineage types: [package package] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Name: do_something | ||
Definition (definition.function): | ||
do_something() { | ||
echo ok | ||
} | ||
|
||
Name: do_nothing | ||
Definition (definition.function): | ||
do_nothing() { return 0; } | ||
|
||
Name: add | ||
Definition (definition.function): | ||
add() { | ||
sum=$(($1 + $2)) | ||
echo $sum | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
;; Functions | ||
|
||
( | ||
(function_definition | ||
name: (word) @name | ||
body: (_) @body | ||
) @definition.function | ||
) | ||
|
||
;; What else do we need here? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
;; C struct fields. Unlike for C++, there is no `class_specifier` here. | ||
|
||
( | ||
(struct_specifier | ||
body: ( | ||
(field_declaration_list | ||
(_) @field | ||
) | ||
) | ||
) | ||
) |
Oops, something went wrong.