Tree-sitter: Emit empty_location relation to avoid scan

This commit is contained in:
Tom Hvitved
2024-05-27 09:44:56 +02:00
parent 44f666c90a
commit 94d2e9591d
6 changed files with 23 additions and 3 deletions

View File

@@ -64,5 +64,5 @@ class Location extends @location_default {
/** An entity representing an empty location. */
class EmptyLocation extends Location {
EmptyLocation() { this.hasLocationInfo("", 0, 0, 0, 0) }
EmptyLocation() { empty_location(this) }
}

View File

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