Implement FilteredASTVisitor (#81)

This commit is contained in:
ykiko
2025-02-17 20:43:54 +08:00
committed by GitHub
parent 26c66100b9
commit 59aba25474
6 changed files with 322 additions and 92 deletions

View File

@@ -12,6 +12,14 @@ struct LocalSourceRange {
/// The end position offset to the source file.
uint32_t end;
bool contains(uint32_t offset) const {
return offset >= begin && offset <= end;
}
bool intersects(const LocalSourceRange& other) const {
return begin <= other.end && end >= other.begin;
}
};
/// Get the content of the file with the given file ID.