Add the method tokenKind() to the QML/JS lexer.
authorRoberto Raggi <roberto.raggi@nokia.com>
Thu, 15 Sep 2011 14:56:49 +0000 (16:56 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 19 Sep 2011 10:07:46 +0000 (12:07 +0200)
The method returns the last token recognized by the lexer.

Change-Id: I9464e96c1276852737ddc8330d08d57326b48888
Reviewed-on: http://codereview.qt-project.org/5015
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
src/declarative/qml/parser/qdeclarativejslexer.cpp
src/declarative/qml/parser/qdeclarativejslexer_p.h

index 238ea8f..aee444e 100644 (file)
@@ -970,6 +970,11 @@ bool Lexer::isOctalDigit(ushort c)
     return (c >= '0' && c <= '7');
 }
 
+int Lexer::tokenKind() const
+{
+    return _tokenKind;
+}
+
 int Lexer::tokenOffset() const
 {
     return _tokenStartPtr - _code.unicode();
index e20490c..dd9f0de 100644 (file)
@@ -150,6 +150,7 @@ public:
     int regExpFlags() const { return _patternFlags; }
     QString regExpPattern() const { return _tokenText; }
 
+    int tokenKind() const;
     int tokenOffset() const;
     int tokenLength() const;