Commit fd26a8c8 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Get rid of the QmlJS prefix.

parent 8fb82ef7
......@@ -205,7 +205,7 @@ void QmlJSIndenter::eraseChar(QString &t, int k, QChar ch) const
*/
QString QmlJSIndenter::trimmedCodeLine(const QString &t)
{
QmlJSScanner scanner;
Scanner scanner;
QTextBlock currentLine = yyLinizerState.iter;
int startState = qMax(0, currentLine.previous().userState()) & 0xff;
......
......@@ -76,22 +76,22 @@ const _Tp *end(const _Tp (&a)[N])
return a + N;
}
QmlJSScanner::QmlJSScanner()
Scanner::Scanner()
: _state(0),
_scanComments(true)
{
}
QmlJSScanner::~QmlJSScanner()
Scanner::~Scanner()
{
}
bool QmlJSScanner::scanComments() const
bool Scanner::scanComments() const
{
return _scanComments;
}
void QmlJSScanner::setScanComments(bool scanComments)
void Scanner::setScanComments(bool scanComments)
{
_scanComments = scanComments;
}
......@@ -120,7 +120,7 @@ static bool isNumberChar(QChar ch)
}
}
QList<Token> QmlJSScanner::operator()(const QString &text, int startState)
QList<Token> Scanner::operator()(const QString &text, int startState)
{
enum {
Normal = 0,
......@@ -297,12 +297,12 @@ QList<Token> QmlJSScanner::operator()(const QString &text, int startState)
return tokens;
}
int QmlJSScanner::state() const
int Scanner::state() const
{
return _state;
}
bool QmlJSScanner::isKeyword(const QString &text) const
bool Scanner::isKeyword(const QString &text) const
{
if (qBinaryFind(begin(js_keywords), end(js_keywords), text) != end(js_keywords))
return true;
......
......@@ -74,11 +74,11 @@ public:
Kind kind;
};
class QMLJS_EXPORT QmlJSScanner
class QMLJS_EXPORT Scanner
{
public:
QmlJSScanner();
virtual ~QmlJSScanner();
Scanner();
virtual ~Scanner();
bool scanComments() const;
void setScanComments(bool scanComments);
......
......@@ -402,7 +402,7 @@ void FunctionArgumentWidget::updateArgumentHighlight()
QString str = m_editor->textAt(m_startpos, curpos - m_startpos);
int argnr = 0;
int parcount = 0;
QmlJSScanner tokenize;
Scanner tokenize;
const QList<Token> tokens = tokenize(str);
for (int i = 0; i < tokens.count(); ++i) {
const Token &tk = tokens.at(i);
......@@ -557,7 +557,7 @@ bool QmlCodeCompletion::triggersCompletion(TextEditor::ITextEditable *editor)
const int blockState = qMax(0, block.previous().userState()) & 0xff;
const QString blockText = block.text();
QmlJSScanner scanner;
Scanner scanner;
const QList<Token> tokens = scanner(blockText, blockState);
foreach (const Token &tk, tokens) {
if (column >= tk.begin() && column <= tk.end()) {
......
......@@ -45,7 +45,7 @@ namespace QmlJSEditor {
class ExpressionUnderCursor
{
QTextCursor _cursor;
QmlJSScanner scanner;
Scanner scanner;
public:
ExpressionUnderCursor()
......
......@@ -1048,7 +1048,7 @@ bool QmlJSTextEditor::contextAllowsAutoParentheses(const QTextCursor &cursor, co
const QString blockText = cursor.block().text();
const int blockState = blockStartState(cursor.block());
QmlJSScanner tokenize;
Scanner tokenize;
const QList<Token> tokens = tokenize(blockText, blockState);
const int pos = cursor.columnNumber();
......
......@@ -94,7 +94,7 @@ private:
bool m_qmlEnabled;
int m_braceDepth;
QmlJS::QmlJSScanner m_scanner;
QmlJS::Scanner m_scanner;
Parentheses m_currentBlockParentheses;
QTextCharFormat m_formats[NumFormats];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment