aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/parser/qqmljsast_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/parser/qqmljsast_p.h')
-rw-r--r--src/qml/parser/qqmljsast_p.h146
1 files changed, 73 insertions, 73 deletions
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h
index 700643e1df..f846a5a3dc 100644
--- a/src/qml/parser/qqmljsast_p.h
+++ b/src/qml/parser/qqmljsast_p.h
@@ -335,11 +335,11 @@ class QML_PARSER_EXPORT UiQualifiedId: public Node
public:
QQMLJS_DECLARE_AST_NODE(UiQualifiedId)
- UiQualifiedId(const QStringRef &name)
+ UiQualifiedId(QStringView name)
: next(this), name(name)
{ kind = K; }
- UiQualifiedId(UiQualifiedId *previous, const QStringRef &name)
+ UiQualifiedId(UiQualifiedId *previous, QStringView name)
: name(name)
{
kind = K;
@@ -364,7 +364,7 @@ public:
// attributes
UiQualifiedId *next;
- QStringRef name;
+ QStringView name;
SourceLocation identifierToken;
};
@@ -549,7 +549,7 @@ class QML_PARSER_EXPORT IdentifierExpression: public LeftHandSideExpression
public:
QQMLJS_DECLARE_AST_NODE(IdentifierExpression)
- IdentifierExpression(const QStringRef &n):
+ IdentifierExpression(QStringView n):
name (n) { kind = K; }
void accept0(BaseVisitor *visitor) override;
@@ -561,7 +561,7 @@ public:
{ return identifierToken; }
// attributes
- QStringRef name;
+ QStringView name;
SourceLocation identifierToken;
};
@@ -698,7 +698,7 @@ class QML_PARSER_EXPORT StringLiteral : public LeftHandSideExpression
public:
QQMLJS_DECLARE_AST_NODE(StringLiteral)
- StringLiteral(const QStringRef &v):
+ StringLiteral(QStringView v):
value (v) { kind = K; }
void accept0(BaseVisitor *visitor) override;
@@ -710,7 +710,7 @@ public:
{ return literalToken; }
// attributes:
- QStringRef value;
+ QStringView value;
SourceLocation literalToken;
};
@@ -719,7 +719,7 @@ class QML_PARSER_EXPORT TemplateLiteral : public LeftHandSideExpression
public:
QQMLJS_DECLARE_AST_NODE(TemplateLiteral)
- TemplateLiteral(const QStringRef &str, const QStringRef &raw, ExpressionNode *e)
+ TemplateLiteral(QStringView str, QStringView raw, ExpressionNode *e)
: value(str), rawValue(raw), expression(e), next(nullptr)
{ kind = K; }
@@ -734,8 +734,8 @@ public:
void accept0(BaseVisitor *visitor) override;
- QStringRef value;
- QStringRef rawValue;
+ QStringView value;
+ QStringView rawValue;
ExpressionNode *expression;
TemplateLiteral *next;
SourceLocation literalToken;
@@ -746,7 +746,7 @@ class QML_PARSER_EXPORT RegExpLiteral: public LeftHandSideExpression
public:
QQMLJS_DECLARE_AST_NODE(RegExpLiteral)
- RegExpLiteral(const QStringRef &p, int f):
+ RegExpLiteral(QStringView p, int f):
pattern (p), flags (f) { kind = K; }
void accept0(BaseVisitor *visitor) override;
@@ -758,7 +758,7 @@ public:
{ return literalToken; }
// attributes:
- QStringRef pattern;
+ QStringView pattern;
int flags;
SourceLocation literalToken;
};
@@ -937,7 +937,7 @@ public:
: initializer(i), type(t)
{ kind = K; }
- PatternElement(const QStringRef &n, TypeAnnotation *typeAnnotation = nullptr, ExpressionNode *i = nullptr, Type t = Binding)
+ PatternElement(QStringView n, TypeAnnotation *typeAnnotation = nullptr, ExpressionNode *i = nullptr, Type t = Binding)
: bindingIdentifier(n), initializer(i), type(t)
, typeAnnotation(typeAnnotation)
{
@@ -973,7 +973,7 @@ public:
// attributes
SourceLocation identifierToken;
- QStringRef bindingIdentifier;
+ QStringView bindingIdentifier;
ExpressionNode *bindingTarget = nullptr;
ExpressionNode *initializer = nullptr;
Type type = Literal;
@@ -1032,7 +1032,7 @@ public:
: PatternElement(i, t), name(name)
{ kind = K; }
- PatternProperty(PropertyName *name, const QStringRef &n, ExpressionNode *i = nullptr)
+ PatternProperty(PropertyName *name, QStringView n, ExpressionNode *i = nullptr)
: PatternElement(n, /*type annotation*/nullptr, i), name(name)
{ kind = K; }
@@ -1102,7 +1102,7 @@ class QML_PARSER_EXPORT IdentifierPropertyName: public PropertyName
public:
QQMLJS_DECLARE_AST_NODE(IdentifierPropertyName)
- IdentifierPropertyName(const QStringRef &n):
+ IdentifierPropertyName(QStringView n):
id (n) { kind = K; }
void accept0(BaseVisitor *visitor) override;
@@ -1110,7 +1110,7 @@ public:
QString asString() const override { return id.toString(); }
// attributes
- QStringRef id;
+ QStringView id;
};
class QML_PARSER_EXPORT StringLiteralPropertyName: public PropertyName
@@ -1118,7 +1118,7 @@ class QML_PARSER_EXPORT StringLiteralPropertyName: public PropertyName
public:
QQMLJS_DECLARE_AST_NODE(StringLiteralPropertyName)
- StringLiteralPropertyName(const QStringRef &n):
+ StringLiteralPropertyName(QStringView n):
id (n) { kind = K; }
void accept0(BaseVisitor *visitor) override;
@@ -1126,7 +1126,7 @@ public:
QString asString() const override { return id.toString(); }
// attributes
- QStringRef id;
+ QStringView id;
};
class QML_PARSER_EXPORT NumericLiteralPropertyName: public PropertyName
@@ -1198,7 +1198,7 @@ class QML_PARSER_EXPORT FieldMemberExpression: public LeftHandSideExpression
public:
QQMLJS_DECLARE_AST_NODE(FieldMemberExpression)
- FieldMemberExpression(ExpressionNode *b, const QStringRef &n):
+ FieldMemberExpression(ExpressionNode *b, QStringView n):
base (b), name (n)
{ kind = K; }
@@ -1212,7 +1212,7 @@ public:
// attributes
ExpressionNode *base;
- QStringRef name;
+ QStringView name;
SourceLocation dotToken;
SourceLocation identifierToken;
};
@@ -1988,7 +1988,7 @@ class QML_PARSER_EXPORT ContinueStatement: public Statement
public:
QQMLJS_DECLARE_AST_NODE(ContinueStatement)
- ContinueStatement(const QStringRef &l = QStringRef()):
+ ContinueStatement(QStringView l = QStringView()):
label (l) { kind = K; }
void accept0(BaseVisitor *visitor) override;
@@ -2000,7 +2000,7 @@ public:
{ return semicolonToken; }
// attributes
- QStringRef label;
+ QStringView label;
SourceLocation continueToken;
SourceLocation identifierToken;
SourceLocation semicolonToken;
@@ -2011,7 +2011,7 @@ class QML_PARSER_EXPORT BreakStatement: public Statement
public:
QQMLJS_DECLARE_AST_NODE(BreakStatement)
- BreakStatement(const QStringRef &l):
+ BreakStatement(QStringView l):
label (l) { kind = K; }
void accept0(BaseVisitor *visitor) override;
@@ -2023,7 +2023,7 @@ public:
{ return semicolonToken; }
// attributes
- QStringRef label;
+ QStringView label;
SourceLocation breakToken;
SourceLocation identifierToken;
SourceLocation semicolonToken;
@@ -2239,7 +2239,7 @@ class QML_PARSER_EXPORT LabelledStatement: public Statement
public:
QQMLJS_DECLARE_AST_NODE(LabelledStatement)
- LabelledStatement(const QStringRef &l, Statement *stmt):
+ LabelledStatement(QStringView l, Statement *stmt):
label (l), statement (stmt)
{ kind = K; }
@@ -2252,7 +2252,7 @@ public:
{ return statement->lastSourceLocation(); }
// attributes
- QStringRef label;
+ QStringView label;
Statement *statement;
SourceLocation identifierToken;
SourceLocation colonToken;
@@ -2372,7 +2372,7 @@ class QML_PARSER_EXPORT FunctionExpression: public ExpressionNode
public:
QQMLJS_DECLARE_AST_NODE(FunctionExpression)
- FunctionExpression(const QStringRef &n, FormalParameterList *f, StatementList *b, TypeAnnotation *typeAnnotation = nullptr):
+ FunctionExpression(QStringView n, FormalParameterList *f, StatementList *b, TypeAnnotation *typeAnnotation = nullptr):
name (n), formals (f), body (b),
typeAnnotation(typeAnnotation)
{ kind = K; }
@@ -2388,7 +2388,7 @@ public:
FunctionExpression *asFunctionDefinition() override;
// attributes
- QStringRef name;
+ QStringView name;
bool isArrowFunction = false;
bool isGenerator = false;
FormalParameterList *formals;
@@ -2407,7 +2407,7 @@ class QML_PARSER_EXPORT FunctionDeclaration: public FunctionExpression
public:
QQMLJS_DECLARE_AST_NODE(FunctionDeclaration)
- FunctionDeclaration(const QStringRef &n, FormalParameterList *f, StatementList *b, TypeAnnotation *typeAnnotation = nullptr):
+ FunctionDeclaration(QStringView n, FormalParameterList *f, StatementList *b, TypeAnnotation *typeAnnotation = nullptr):
FunctionExpression(n, f, b, typeAnnotation)
{ kind = K; }
@@ -2504,7 +2504,7 @@ class QML_PARSER_EXPORT ClassExpression : public ExpressionNode
public:
QQMLJS_DECLARE_AST_NODE(ClassExpression)
- ClassExpression(const QStringRef &n, ExpressionNode *heritage, ClassElementList *elements)
+ ClassExpression(QStringView n, ExpressionNode *heritage, ClassElementList *elements)
: name(n), heritage(heritage), elements(elements)
{ kind = K; }
@@ -2519,7 +2519,7 @@ public:
ClassExpression *asClassDefinition() override;
// attributes
- QStringRef name;
+ QStringView name;
ExpressionNode *heritage;
ClassElementList *elements;
SourceLocation classToken;
@@ -2533,7 +2533,7 @@ class QML_PARSER_EXPORT ClassDeclaration: public ClassExpression
public:
QQMLJS_DECLARE_AST_NODE(ClassDeclaration)
- ClassDeclaration(const QStringRef &n, ExpressionNode *heritage, ClassElementList *elements)
+ ClassDeclaration(QStringView n, ExpressionNode *heritage, ClassElementList *elements)
: ClassExpression(n, heritage, elements)
{ kind = K; }
@@ -2604,13 +2604,13 @@ class QML_PARSER_EXPORT ImportSpecifier: public Node
public:
QQMLJS_DECLARE_AST_NODE(ImportSpecifier)
- ImportSpecifier(const QStringRef &importedBinding)
+ ImportSpecifier(QStringView importedBinding)
: importedBinding(importedBinding)
{
kind = K;
}
- ImportSpecifier(const QStringRef &identifier, const QStringRef &importedBinding)
+ ImportSpecifier(QStringView identifier, QStringView importedBinding)
: identifier(identifier), importedBinding(importedBinding)
{
kind = K;
@@ -2626,8 +2626,8 @@ public:
// attributes
SourceLocation identifierToken;
SourceLocation importedBindingToken;
- QStringRef identifier;
- QStringRef importedBinding;
+ QStringView identifier;
+ QStringView importedBinding;
};
class QML_PARSER_EXPORT ImportsList: public Node
@@ -2711,7 +2711,7 @@ class QML_PARSER_EXPORT NameSpaceImport: public Node
public:
QQMLJS_DECLARE_AST_NODE(NameSpaceImport)
- NameSpaceImport(const QStringRef &importedBinding)
+ NameSpaceImport(QStringView importedBinding)
: importedBinding(importedBinding)
{
kind = K;
@@ -2727,7 +2727,7 @@ public:
// attributes
SourceLocation starToken;
SourceLocation importedBindingToken;
- QStringRef importedBinding;
+ QStringView importedBinding;
};
class QML_PARSER_EXPORT ImportClause: public Node
@@ -2735,7 +2735,7 @@ class QML_PARSER_EXPORT ImportClause: public Node
public:
QQMLJS_DECLARE_AST_NODE(ImportClause)
- ImportClause(const QStringRef &importedDefaultBinding)
+ ImportClause(QStringView importedDefaultBinding)
: importedDefaultBinding(importedDefaultBinding)
{
kind = K;
@@ -2753,14 +2753,14 @@ public:
kind = K;
}
- ImportClause(const QStringRef &importedDefaultBinding, NameSpaceImport *nameSpaceImport)
+ ImportClause(QStringView importedDefaultBinding, NameSpaceImport *nameSpaceImport)
: importedDefaultBinding(importedDefaultBinding)
, nameSpaceImport(nameSpaceImport)
{
kind = K;
}
- ImportClause(const QStringRef &importedDefaultBinding, NamedImports *namedImports)
+ ImportClause(QStringView importedDefaultBinding, NamedImports *namedImports)
: importedDefaultBinding(importedDefaultBinding)
, namedImports(namedImports)
{
@@ -2776,7 +2776,7 @@ public:
// attributes
SourceLocation importedDefaultBindingToken;
- QStringRef importedDefaultBinding;
+ QStringView importedDefaultBinding;
NameSpaceImport *nameSpaceImport = nullptr;
NamedImports *namedImports = nullptr;
};
@@ -2786,7 +2786,7 @@ class QML_PARSER_EXPORT FromClause: public Node
public:
QQMLJS_DECLARE_AST_NODE(FromClause)
- FromClause(const QStringRef &moduleSpecifier)
+ FromClause(QStringView moduleSpecifier)
: moduleSpecifier(moduleSpecifier)
{
kind = K;
@@ -2803,7 +2803,7 @@ public:
// attributes
SourceLocation fromToken;
SourceLocation moduleSpecifierToken;
- QStringRef moduleSpecifier;
+ QStringView moduleSpecifier;
};
class QML_PARSER_EXPORT ImportDeclaration: public Statement
@@ -2817,7 +2817,7 @@ public:
kind = K;
}
- ImportDeclaration(const QStringRef &moduleSpecifier)
+ ImportDeclaration(QStringView moduleSpecifier)
: moduleSpecifier(moduleSpecifier)
{
kind = K;
@@ -2834,7 +2834,7 @@ public:
// attributes
SourceLocation importToken;
SourceLocation moduleSpecifierToken;
- QStringRef moduleSpecifier;
+ QStringView moduleSpecifier;
ImportClause *importClause = nullptr;
FromClause *fromClause = nullptr;
};
@@ -2844,13 +2844,13 @@ class QML_PARSER_EXPORT ExportSpecifier: public Node
public:
QQMLJS_DECLARE_AST_NODE(ExportSpecifier)
- ExportSpecifier(const QStringRef &identifier)
+ ExportSpecifier(QStringView identifier)
: identifier(identifier), exportedIdentifier(identifier)
{
kind = K;
}
- ExportSpecifier(const QStringRef &identifier, const QStringRef &exportedIdentifier)
+ ExportSpecifier(QStringView identifier, QStringView exportedIdentifier)
: identifier(identifier), exportedIdentifier(exportedIdentifier)
{
kind = K;
@@ -2866,8 +2866,8 @@ public:
// attributes
SourceLocation identifierToken;
SourceLocation exportedIdentifierToken;
- QStringRef identifier;
- QStringRef exportedIdentifier;
+ QStringView identifier;
+ QStringView exportedIdentifier;
};
class QML_PARSER_EXPORT ExportsList: public Node
@@ -3038,7 +3038,7 @@ class QML_PARSER_EXPORT UiImport: public Node
public:
QQMLJS_DECLARE_AST_NODE(UiImport)
- UiImport(const QStringRef &fileName)
+ UiImport(QStringView fileName)
: fileName(fileName), importUri(nullptr)
{ kind = K; }
@@ -3055,9 +3055,9 @@ public:
{ return semicolonToken; }
// attributes
- QStringRef fileName;
+ QStringView fileName;
UiQualifiedId *importUri;
- QStringRef importId;
+ QStringView importId;
SourceLocation importToken;
SourceLocation fileNameToken;
SourceLocation asToken;
@@ -3120,7 +3120,7 @@ class QML_PARSER_EXPORT UiPragma: public Node
public:
QQMLJS_DECLARE_AST_NODE(UiPragma)
- UiPragma(QStringRef name)
+ UiPragma(QStringView name)
: name(name)
{ kind = K; }
@@ -3133,7 +3133,7 @@ public:
{ return semicolonToken; }
// attributes
- QStringRef name;
+ QStringView name;
SourceLocation pragmaToken;
SourceLocation semicolonToken;
};
@@ -3143,7 +3143,7 @@ class QML_PARSER_EXPORT UiRequired: public Node
public:
QQMLJS_DECLARE_AST_NODE(UiRequired)
- UiRequired(QStringRef name)
+ UiRequired(QStringView name)
:name(name)
{ kind = K; }
@@ -3155,7 +3155,7 @@ public:
SourceLocation lastSourceLocation() const override
{ return semicolonToken; }
- QStringRef name;
+ QStringView name;
SourceLocation requiredToken;
SourceLocation semicolonToken;
};
@@ -3309,11 +3309,11 @@ class QML_PARSER_EXPORT UiParameterList: public Node
public:
QQMLJS_DECLARE_AST_NODE(UiParameterList)
- UiParameterList(UiQualifiedId *t, const QStringRef &n):
+ UiParameterList(UiQualifiedId *t, QStringView n):
type (t), name (n), next (this)
{ kind = K; }
- UiParameterList(UiParameterList *previous, UiQualifiedId *t, const QStringRef &n):
+ UiParameterList(UiParameterList *previous, UiQualifiedId *t, QStringView n):
type (t), name (n)
{
kind = K;
@@ -3341,7 +3341,7 @@ public:
// attributes
UiQualifiedId *type;
- QStringRef name;
+ QStringView name;
UiParameterList *next;
SourceLocation commaToken;
SourceLocation propertyTypeToken;
@@ -3355,12 +3355,12 @@ public:
QQMLJS_DECLARE_AST_NODE(UiPublicMember)
UiPublicMember(UiQualifiedId *memberType,
- const QStringRef &name)
+ QStringView name)
: type(Property), memberType(memberType), name(name), statement(nullptr), binding(nullptr), isDefaultMember(false), isReadonlyMember(false), parameters(nullptr)
{ kind = K; }
UiPublicMember(UiQualifiedId *memberType,
- const QStringRef &name,
+ QStringView name,
Statement *statement)
: type(Property), memberType(memberType), name(name), statement(statement), binding(nullptr), isDefaultMember(false), isReadonlyMember(false), parameters(nullptr)
{ kind = K; }
@@ -3391,9 +3391,9 @@ public:
// attributes
enum { Signal, Property } type;
- QStringRef typeModifier;
+ QStringView typeModifier;
UiQualifiedId *memberType;
- QStringRef name;
+ QStringView name;
Statement *statement; // initialized with a JS expression
UiObjectMember *binding; // initialized with a QML object or array.
bool isDefaultMember;
@@ -3440,7 +3440,7 @@ class QML_PARSER_EXPORT UiInlineComponent: public UiObjectMember
public:
QQMLJS_DECLARE_AST_NODE(UiInlineComponent)
- UiInlineComponent(const QStringRef& inlineComponentName, UiObjectDefinition* inlineComponent)
+ UiInlineComponent(QStringView inlineComponentName, UiObjectDefinition* inlineComponent)
: name(inlineComponentName), component(inlineComponent)
{ kind = K; }
@@ -3453,7 +3453,7 @@ public:
void accept0(BaseVisitor *visitor) override;
// attributes
- QStringRef name;
+ QStringView name;
UiObjectDefinition* component;
SourceLocation componentToken;
};
@@ -3586,11 +3586,11 @@ class QML_PARSER_EXPORT UiEnumMemberList: public Node
{
QQMLJS_DECLARE_AST_NODE(UiEnumMemberList)
public:
- UiEnumMemberList(const QStringRef &member, double v = 0.0)
+ UiEnumMemberList(QStringView member, double v = 0.0)
: next(this), member(member), value(v)
{ kind = K; }
- UiEnumMemberList(UiEnumMemberList *previous, const QStringRef &member)
+ UiEnumMemberList(UiEnumMemberList *previous, QStringView member)
: member(member)
{
kind = K;
@@ -3599,7 +3599,7 @@ public:
value = previous->value + 1;
}
- UiEnumMemberList(UiEnumMemberList *previous, const QStringRef &member, double v)
+ UiEnumMemberList(UiEnumMemberList *previous, QStringView member, double v)
: member(member), value(v)
{
kind = K;
@@ -3627,7 +3627,7 @@ public:
// attributes
UiEnumMemberList *next;
- QStringRef member;
+ QStringView member;
double value;
SourceLocation memberToken;
SourceLocation valueToken;
@@ -3638,7 +3638,7 @@ class QML_PARSER_EXPORT UiEnumDeclaration: public UiObjectMember
public:
QQMLJS_DECLARE_AST_NODE(UiEnumDeclaration)
- UiEnumDeclaration(const QStringRef &name,
+ UiEnumDeclaration(QStringView name,
UiEnumMemberList *members)
: name(name)
, members(members)
@@ -3655,7 +3655,7 @@ public:
// attributes
SourceLocation enumToken;
SourceLocation rbraceToken;
- QStringRef name;
+ QStringView name;
UiEnumMemberList *members;
};