Make QmlJS(Tools) build with Qt5 & Qt6

Port from QStringRef to QStringView

Change-Id: I472d16f20e40ca52b8e5d481850a6bd8a1a38f3b
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Eike Ziller
2020-09-16 15:08:57 +02:00
parent 5ad724c61b
commit cf2a651c3b
37 changed files with 442 additions and 321 deletions

View File

@@ -207,10 +207,10 @@ protected:
inline Value &sym(int index)
{ return sym_stack [tos + index - 1]; }
inline QStringRef &stringRef(int index)
inline QStringView &stringRef(int index)
{ return string_stack [tos + index - 1]; }
inline QStringRef &rawStringRef(int index)
inline QStringView &rawStringRef(int index)
{ return rawString_stack [tos + index - 1]; }
inline SourceLocation &loc(int index)
@@ -248,8 +248,8 @@ protected:
Value *sym_stack = nullptr;
int *state_stack = nullptr;
SourceLocation *location_stack = nullptr;
QVector<QStringRef> string_stack;
QVector<QStringRef> rawString_stack;
QVector<QStringView> string_stack;
QVector<QStringView> rawString_stack;
AST::Node *program = nullptr;
@@ -260,14 +260,14 @@ protected:
int token;
double dval;
SourceLocation loc;
QStringRef spell;
QStringRef raw;
QStringView spell;
QStringView raw;
};
int yytoken = -1;
double yylval = 0.;
QStringRef yytokenspell;
QStringRef yytokenraw;
QStringView yytokenspell;
QStringView yytokenraw;
SourceLocation yylloc;
SourceLocation yyprevlloc;