Text-Treesitter-Bash
view release on metacpan or search on metacpan
lib/Text/Treesitter/Bash.pm view on Meta::CPAN
for my $file (
qw(
LICENSE
package.json
src/parser.c
src/scanner.c
src/node-types.json
)
) {
my $source = $share->child( split m{/}, $file );
my $target = $tmp->child( split m{/}, $file );
next unless -f $source;
$target->parent->mkpath;
$source->copy($target);
}
$self->{_tmpdir} = $tmp;
return $tmp;
}
lib/Text/Treesitter/Bash.pm view on Meta::CPAN
context => [@$context],
before_op => $before_op,
after_op => undef
};
}
sub _simple_command_entry {
my ( $self, $node, $context, $before_op ) = @_;
my $source = $node->text;
my @argv = grep { length $_ } split m/\s+/, $source;
my $name = _clean_word( $argv[0] // _first_child_text($node) );
return {
source => $source,
command => $name,
argv => \@argv,
start_byte => $node->start_byte,
end_byte => $node->end_byte,
context => [@$context],
before_op => $before_op,
( run in 1.156 second using v1.01-cache-2.11-cpan-71847e10f99 )