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
This commit is contained in:
Thorbjørn Lindeijer
2009-05-27 14:32:09 +02:00
parent b93c9ce347
commit 878bc07201
3 changed files with 112 additions and 80 deletions

View File

@@ -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),