Merge pull request #16597 from hvitved/tree-sitter/empty-location

Tree-sitter: Emit `empty_location` relation to avoid scan
This commit is contained in:
Tom Hvitved
2024-05-27 15:19:15 +02:00
committed by GitHub
13 changed files with 6106 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ fn populate_empty_file(writer: &mut trap::Writer) -> trap::Label {
pub fn populate_empty_location(writer: &mut trap::Writer) {
let file_label = populate_empty_file(writer);
global_location(
let loc_label = global_location(
writer,
file_label,
trap::Location {
@@ -85,6 +85,7 @@ pub fn populate_empty_location(writer: &mut trap::Writer) {
end_column: 0,
},
);
writer.add_tuple("empty_location", vec![trap::Arg::Label(loc_label)]);
}
pub fn populate_parent_folders(

View File

@@ -33,6 +33,12 @@ containerparent(
unique int child: @container ref
);
/*- Empty location -*/
empty_location(
int location: @location_default ref
);
/*- Source location prefix -*/
/**