From 6b6b827d9bc3185f559327803575dc6fc66133d0 Mon Sep 17 00:00:00 2001
From: Roberto Raggi <roberto.raggi@nokia.com>
Date: Tue, 19 Jan 2010 12:58:55 +0100
Subject: [PATCH] Added helper method QmlJSIndenter::tokenText().

---
 src/libs/qmljs/qmljsindenter.cpp | 5 +++++
 src/libs/qmljs/qmljsindenter.h   | 1 +
 2 files changed, 6 insertions(+)

diff --git a/src/libs/qmljs/qmljsindenter.cpp b/src/libs/qmljs/qmljsindenter.cpp
index b6c82f0e717..e6cdf265392 100644
--- a/src/libs/qmljs/qmljsindenter.cpp
+++ b/src/libs/qmljs/qmljsindenter.cpp
@@ -321,6 +321,11 @@ Token QmlJSIndenter::lastToken() const
     return Token();
 }
 
+QStringRef QmlJSIndenter::tokenText(const Token &token) const
+{
+    return yyLinizerState.line.midRef(token.offset, token.length);
+}
+
 /*
     Saves and restores the state of the global linizer. This enables
     backtracking.
diff --git a/src/libs/qmljs/qmljsindenter.h b/src/libs/qmljs/qmljsindenter.h
index 82e7ae56159..37683a91a9c 100644
--- a/src/libs/qmljs/qmljsindenter.h
+++ b/src/libs/qmljs/qmljsindenter.h
@@ -85,6 +85,7 @@ private:
     int indentForStandaloneLine();
 
     Token lastToken() const;
+    QStringRef tokenText(const Token &token) const;
 
 private:
     int ppHardwareTabSize;
-- 
GitLab