aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/SimpleLexer.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <[email protected]>2009-05-27 14:32:09 +0200
committerThorbjørn Lindeijer <[email protected]>2009-05-27 16:00:10 +0200
commit878bc0720181a2fb7afb95d9fd950f9e911443be (patch)
tree92398468af2103a0d2faff0961728a540c993757 /src/libs/cplusplus/SimpleLexer.h
parentb93c9ce347aa3336e599ae179f5205377bae7f79 (diff)
Introduced a backwards scanner for finding expression under cursor
The backwards scanner lazily tokenizes strings. This optimizes the common case where scanning one or two lines is enough while at the same time we extended the limit from 5 to 10 lines. Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/libs/cplusplus/SimpleLexer.h')
-rw-r--r--src/libs/cplusplus/SimpleLexer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libs/cplusplus/SimpleLexer.h b/src/libs/cplusplus/SimpleLexer.h
index 0366738c6bd..666478016a7 100644
--- a/src/libs/cplusplus/SimpleLexer.h
+++ b/src/libs/cplusplus/SimpleLexer.h
@@ -41,6 +41,13 @@ class SimpleLexer;
class CPLUSPLUS_EXPORT SimpleToken
{
public:
+ SimpleToken(int kind, int position, int length, const QStringRef &text)
+ : _kind(kind)
+ , _position(position)
+ , _length(length)
+ , _text(text)
+ { }
+
SimpleToken()
: _kind(0),
_position(0),