diff options
Diffstat (limited to 'src/lib/corelib/language/asttools.cpp')
-rw-r--r-- | src/lib/corelib/language/asttools.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/corelib/language/asttools.cpp b/src/lib/corelib/language/asttools.cpp index c394fc187..f1aec7d9b 100644 --- a/src/lib/corelib/language/asttools.cpp +++ b/src/lib/corelib/language/asttools.cpp @@ -54,5 +54,11 @@ QString textOf(const QString &source, QbsQmlJS::AST::Node *node) node->lastSourceLocation().end() - node->firstSourceLocation().begin()); } +QStringRef textRefOf(const QString &source, QbsQmlJS::AST::Node *node) +{ + const quint32 firstBegin = node->firstSourceLocation().begin(); + return source.midRef(firstBegin, node->lastSourceLocation().end() - firstBegin); +} + } // namespace Internal } // namespace qbs |