From e83bf531362a9626ad41b97dd3fbfa39d6665c85 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 14 May 2009 11:09:07 +0200 Subject: Removed javascriptvalue.h --- src/declarative/qml/parser/javascriptengine_p.cpp | 13 ++++++------- src/declarative/qml/parser/javascriptengine_p.h | 1 - src/declarative/qml/parser/javascriptlexer.cpp | 2 +- src/declarative/qml/parser/javascriptprettypretty.cpp | 2 +- src/declarative/qml/parser/javascriptvalue.h | 6 ------ src/declarative/qml/parser/parser.pri | 3 +-- 6 files changed, 9 insertions(+), 18 deletions(-) delete mode 100644 src/declarative/qml/parser/javascriptvalue.h diff --git a/src/declarative/qml/parser/javascriptengine_p.cpp b/src/declarative/qml/parser/javascriptengine_p.cpp index ca15b75..56ee76c 100644 --- a/src/declarative/qml/parser/javascriptengine_p.cpp +++ b/src/declarative/qml/parser/javascriptengine_p.cpp @@ -29,7 +29,6 @@ #include "javascriptengine_p.h" #include "javascriptnodepool_p.h" -#include "javascriptvalue.h" #include #include @@ -37,7 +36,7 @@ QT_BEGIN_NAMESPACE namespace JavaScript { -QString numberToString(qjsreal value) +QString numberToString(double value) { return QString::number(value); } int Ecma::RegExp::flagFromChar(const QChar &ch) @@ -93,12 +92,12 @@ static int toDigit(char c) return -1; } -qjsreal integerFromString(const char *buf, int size, int radix) +double integerFromString(const char *buf, int size, int radix) { if (size == 0) return qSNaN(); - qjsreal sign = 1.0; + double sign = 1.0; int i = 0; if (buf[0] == '+') { ++i; @@ -130,7 +129,7 @@ qjsreal integerFromString(const char *buf, int size, int radix) if ((d == -1) || (d >= radix)) break; } - qjsreal result; + double result; if (j == i) { if (!qstrcmp(buf, "Infinity")) result = qInf(); @@ -138,7 +137,7 @@ qjsreal integerFromString(const char *buf, int size, int radix) result = qSNaN(); } else { result = 0; - qjsreal multiplier = 1; + double multiplier = 1; for (--i ; i >= j; --i, multiplier *= radix) result += toDigit(buf[i]) * multiplier; } @@ -146,7 +145,7 @@ qjsreal integerFromString(const char *buf, int size, int radix) return result; } -qjsreal integerFromString(const QString &str, int radix) +double integerFromString(const QString &str, int radix) { QByteArray ba = str.trimmed().toUtf8(); return integerFromString(ba.constData(), ba.size(), radix); diff --git a/src/declarative/qml/parser/javascriptengine_p.h b/src/declarative/qml/parser/javascriptengine_p.h index 1e6e568..7941b27 100644 --- a/src/declarative/qml/parser/javascriptengine_p.h +++ b/src/declarative/qml/parser/javascriptengine_p.h @@ -30,7 +30,6 @@ #ifndef JAVASCRIPTENGINE_P_H #define JAVASCRIPTENGINE_P_H -#include "javascriptvalue.h" #include #include diff --git a/src/declarative/qml/parser/javascriptlexer.cpp b/src/declarative/qml/parser/javascriptlexer.cpp index c0a4b63..dbb7351 100644 --- a/src/declarative/qml/parser/javascriptlexer.cpp +++ b/src/declarative/qml/parser/javascriptlexer.cpp @@ -73,7 +73,7 @@ extern double qstrtod(const char *s00, char const **se, bool *ok); while (0) namespace JavaScript { -extern qjsreal integerFromString(const char *buf, int size, int radix); +extern double integerFromString(const char *buf, int size, int radix); } JavaScript::Lexer::Lexer(JavaScriptEnginePrivate *eng) diff --git a/src/declarative/qml/parser/javascriptprettypretty.cpp b/src/declarative/qml/parser/javascriptprettypretty.cpp index 6e632b7..9685de5 100644 --- a/src/declarative/qml/parser/javascriptprettypretty.cpp +++ b/src/declarative/qml/parser/javascriptprettypretty.cpp @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE namespace JavaScript { -QString numberToString(qjsreal value); +QString numberToString(double value); } using namespace JavaScript; diff --git a/src/declarative/qml/parser/javascriptvalue.h b/src/declarative/qml/parser/javascriptvalue.h deleted file mode 100644 index c68b817..0000000 --- a/src/declarative/qml/parser/javascriptvalue.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef JAVASCRIPTVALUE_H -#define JAVASCRIPTVALUE_H - -typedef double qjsreal; - -#endif // JAVASCRIPTVALUE_H diff --git a/src/declarative/qml/parser/parser.pri b/src/declarative/qml/parser/parser.pri index 130aeaf..b4d226a 100644 --- a/src/declarative/qml/parser/parser.pri +++ b/src/declarative/qml/parser/parser.pri @@ -8,8 +8,7 @@ HEADERS += $$PWD/javascriptast_p.h \ $$PWD/javascriptmemorypool_p.h \ $$PWD/javascriptnodepool_p.h \ $$PWD/javascriptparser_p.h \ - $$PWD/javascriptprettypretty_p.h \ - $$PWD/javascriptvalue.h \ + $$PWD/javascriptprettypretty_p.h SOURCES += $$PWD/javascriptast.cpp \ $$PWD/javascriptastvisitor.cpp \ -- cgit v0.12 From 96bf1dee730651afa4f763fd5d7d52e49921d214 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 14 May 2009 11:30:40 +0200 Subject: Protect the QML front-end using the namespace JavaScript. --- src/declarative/qml/parser/javascript.g | 132 +++++++++++----------- src/declarative/qml/parser/javascriptast_p.h | 88 +++++++-------- src/declarative/qml/parser/javascriptengine_p.cpp | 3 + src/declarative/qml/parser/javascriptengine_p.h | 56 ++++----- src/declarative/qml/parser/javascriptlexer_p.h | 12 +- src/declarative/qml/parser/javascriptnodepool_p.h | 3 +- src/declarative/qml/parser/javascriptparser.cpp | 26 ++--- src/declarative/qml/parser/javascriptparser_p.h | 106 +++++++++-------- src/declarative/qml/qmlscriptparser.cpp | 4 +- 9 files changed, 222 insertions(+), 208 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 48e8244..b70774b 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -212,52 +212,55 @@ QT_BEGIN_NAMESPACE class QString; + +namespace JavaScript { + class JavaScriptEnginePrivate; -class JavaScriptNameIdImpl; +class NameId; -class JavaScriptParser: protected $table +class Parser: protected $table { public: union Value { int ival; double dval; - JavaScriptNameIdImpl *sval; - JavaScript::AST::ArgumentList *ArgumentList; - JavaScript::AST::CaseBlock *CaseBlock; - JavaScript::AST::CaseClause *CaseClause; - JavaScript::AST::CaseClauses *CaseClauses; - JavaScript::AST::Catch *Catch; - JavaScript::AST::DefaultClause *DefaultClause; - JavaScript::AST::ElementList *ElementList; - JavaScript::AST::Elision *Elision; - JavaScript::AST::ExpressionNode *Expression; - JavaScript::AST::Finally *Finally; - JavaScript::AST::FormalParameterList *FormalParameterList; - JavaScript::AST::FunctionBody *FunctionBody; - JavaScript::AST::FunctionDeclaration *FunctionDeclaration; - JavaScript::AST::Node *Node; - JavaScript::AST::PropertyName *PropertyName; - JavaScript::AST::PropertyNameAndValueList *PropertyNameAndValueList; - JavaScript::AST::SourceElement *SourceElement; - JavaScript::AST::SourceElements *SourceElements; - JavaScript::AST::Statement *Statement; - JavaScript::AST::StatementList *StatementList; - JavaScript::AST::Block *Block; - JavaScript::AST::VariableDeclaration *VariableDeclaration; - JavaScript::AST::VariableDeclarationList *VariableDeclarationList; - - JavaScript::AST::UiProgram *UiProgram; - JavaScript::AST::UiImportList *UiImportList; - JavaScript::AST::UiImport *UiImport; - JavaScript::AST::UiPublicMember *UiPublicMember; - JavaScript::AST::UiObjectDefinition *UiObjectDefinition; - JavaScript::AST::UiObjectInitializer *UiObjectInitializer; - JavaScript::AST::UiObjectBinding *UiObjectBinding; - JavaScript::AST::UiScriptBinding *UiScriptBinding; - JavaScript::AST::UiArrayBinding *UiArrayBinding; - JavaScript::AST::UiObjectMember *UiObjectMember; - JavaScript::AST::UiObjectMemberList *UiObjectMemberList; - JavaScript::AST::UiQualifiedId *UiQualifiedId; + NameId *sval; + AST::ArgumentList *ArgumentList; + AST::CaseBlock *CaseBlock; + AST::CaseClause *CaseClause; + AST::CaseClauses *CaseClauses; + AST::Catch *Catch; + AST::DefaultClause *DefaultClause; + AST::ElementList *ElementList; + AST::Elision *Elision; + AST::ExpressionNode *Expression; + AST::Finally *Finally; + AST::FormalParameterList *FormalParameterList; + AST::FunctionBody *FunctionBody; + AST::FunctionDeclaration *FunctionDeclaration; + AST::Node *Node; + AST::PropertyName *PropertyName; + AST::PropertyNameAndValueList *PropertyNameAndValueList; + AST::SourceElement *SourceElement; + AST::SourceElements *SourceElements; + AST::Statement *Statement; + AST::StatementList *StatementList; + AST::Block *Block; + AST::VariableDeclaration *VariableDeclaration; + AST::VariableDeclarationList *VariableDeclarationList; + + AST::UiProgram *UiProgram; + AST::UiImportList *UiImportList; + AST::UiImport *UiImport; + AST::UiPublicMember *UiPublicMember; + AST::UiObjectDefinition *UiObjectDefinition; + AST::UiObjectInitializer *UiObjectInitializer; + AST::UiObjectBinding *UiObjectBinding; + AST::UiScriptBinding *UiScriptBinding; + AST::UiArrayBinding *UiArrayBinding; + AST::UiObjectMember *UiObjectMember; + AST::UiObjectMemberList *UiObjectMemberList; + AST::UiQualifiedId *UiQualifiedId; }; struct DiagnosticMessage { @@ -266,7 +269,7 @@ public: DiagnosticMessage() : kind(Error) {} - DiagnosticMessage(Kind kind, const JavaScript::AST::SourceLocation &loc, const QString &message) + DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message) : kind(kind), loc(loc), message(message) {} bool isWarning() const @@ -276,17 +279,17 @@ public: { return kind == Error; } Kind kind; - JavaScript::AST::SourceLocation loc; + AST::SourceLocation loc; QString message; }; public: - JavaScriptParser(); - ~JavaScriptParser(); + Parser(); + ~Parser(); bool parse(JavaScriptEnginePrivate *driver); - JavaScript::AST::UiProgram *ast() + AST::UiProgram *ast() { return program; } QList diagnosticMessages() const @@ -317,7 +320,7 @@ protected: inline Value &sym(int index) { return sym_stack [tos + index - 1]; } - inline JavaScript::AST::SourceLocation &loc(int index) + inline AST::SourceLocation &loc(int index) { return location_stack [tos + index - 1]; } protected: @@ -325,9 +328,9 @@ protected: int stack_size; Value *sym_stack; int *state_stack; - JavaScript::AST::SourceLocation *location_stack; + AST::SourceLocation *location_stack; - JavaScript::AST::UiProgram *program; + AST::UiProgram *program; // error recovery enum { TOKEN_BUFFER_SIZE = 3 }; @@ -335,12 +338,12 @@ protected: struct SavedToken { int token; double dval; - JavaScript::AST::SourceLocation loc; + AST::SourceLocation loc; }; double yylval; - JavaScript::AST::SourceLocation yylloc; - JavaScript::AST::SourceLocation yyprevlloc; + AST::SourceLocation yylloc; + AST::SourceLocation yyprevlloc; SavedToken token_buffer[TOKEN_BUFFER_SIZE]; SavedToken *first_token; @@ -349,6 +352,9 @@ protected: QList diagnostic_messages; }; +} // end of namespace JavaScript + + :/ @@ -365,7 +371,7 @@ using namespace JavaScript; QT_BEGIN_NAMESPACE -void JavaScriptParser::reallocateStack() +void Parser::reallocateStack() { if (! stack_size) stack_size = 128; @@ -385,7 +391,7 @@ inline static bool automatic(JavaScriptEnginePrivate *driver, int token) } -JavaScriptParser::JavaScriptParser(): +Parser::Parser(): tos(0), stack_size(0), sym_stack(0), @@ -396,7 +402,7 @@ JavaScriptParser::JavaScriptParser(): { } -JavaScriptParser::~JavaScriptParser() +Parser::~Parser() { if (stack_size) { qFree(sym_stack); @@ -415,7 +421,7 @@ static inline AST::SourceLocation location(Lexer *lexer) return loc; } -bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) +bool Parser::parse(JavaScriptEnginePrivate *driver) { Lexer *lexer = driver->lexer(); bool hadErrors = false; @@ -475,7 +481,7 @@ UiProgram: UiImportListOpt UiRootMember ; case $rule_number: { program = makeAstNode (driver->nodePool(), sym(1).UiImportList, sym(2).UiObjectMemberList->finish()); - sym(1).UiProgram = program; + sym(1).UiProgram = program; } break; ./ @@ -648,7 +654,7 @@ case $rule_number: { UiPropertyType: T_VAR ; /. -case $rule_number: +case $rule_number: ./ UiPropertyType: T_RESERVED_WORD ; /. @@ -663,7 +669,7 @@ UiPropertyType: T_IDENTIFIER ; UiObjectMember: T_SIGNAL T_IDENTIFIER ; /. case $rule_number: { - AST::UiPublicMember *node = makeAstNode (driver->nodePool(), (JavaScriptNameIdImpl *)0, sym(2).sval); + AST::UiPublicMember *node = makeAstNode (driver->nodePool(), (NameId *)0, sym(2).sval); node->type = AST::UiPublicMember::Signal; node->propertyToken = loc(1); node->typeToken = loc(2); @@ -1038,7 +1044,7 @@ case $rule_number: { sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); node->commaToken = loc(2); node->colonToken = loc(4); - sym(1).Node = node; + sym(1).Node = node; } break; ./ @@ -1047,7 +1053,7 @@ PropertyName: T_IDENTIFIER %prec REDUCE_HERE ; case $rule_number: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); - sym(1).Node = node; + sym(1).Node = node; } break; ./ @@ -1059,7 +1065,7 @@ PropertyName: T_PROPERTY ; case $rule_number: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->propertyNameToken = loc(1); - sym(1).Node = node; + sym(1).Node = node; } break; ./ @@ -1068,7 +1074,7 @@ PropertyName: T_STRING_LITERAL ; case $rule_number: { AST::StringLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); - sym(1).Node = node; + sym(1).Node = node; } break; ./ @@ -1077,7 +1083,7 @@ PropertyName: T_NUMERIC_LITERAL ; case $rule_number: { AST::NumericLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).dval); node->propertyNameToken = loc(1); - sym(1).Node = node; + sym(1).Node = node; } break; ./ @@ -1086,7 +1092,7 @@ PropertyName: ReservedIdentifier ; case $rule_number: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); - sym(1).Node = node; + sym(1).Node = node; } break; ./ diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index cd47e42..816835e 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE #define JAVASCRIPT_DECLARE_AST_NODE(name) \ enum { K = Kind_##name }; -class JavaScriptNameIdImpl; +class NameId; namespace QSOperator // ### rename { @@ -339,7 +339,7 @@ class IdentifierExpression: public ExpressionNode public: JAVASCRIPT_DECLARE_AST_NODE(IdentifierExpression) - IdentifierExpression(JavaScriptNameIdImpl *n): + IdentifierExpression(NameId *n): name (n) { kind = K; } virtual ~IdentifierExpression() {} @@ -353,7 +353,7 @@ public: { return identifierToken; } // attributes - JavaScriptNameIdImpl *name; + NameId *name; SourceLocation identifierToken; }; @@ -444,7 +444,7 @@ class StringLiteral: public ExpressionNode public: JAVASCRIPT_DECLARE_AST_NODE(StringLiteral) - StringLiteral(JavaScriptNameIdImpl *v): + StringLiteral(NameId *v): value (v) { kind = K; } virtual ~StringLiteral() {} @@ -458,7 +458,7 @@ public: { return literalToken; } // attributes: - JavaScriptNameIdImpl *value; + NameId *value; SourceLocation literalToken; }; @@ -467,7 +467,7 @@ class RegExpLiteral: public ExpressionNode public: JAVASCRIPT_DECLARE_AST_NODE(RegExpLiteral) - RegExpLiteral(JavaScriptNameIdImpl *p, int f): + RegExpLiteral(NameId *p, int f): pattern (p), flags (f) { kind = K; } virtual ~RegExpLiteral() {} @@ -481,7 +481,7 @@ public: { return literalToken; } // attributes: - JavaScriptNameIdImpl *pattern; + NameId *pattern; int flags; SourceLocation literalToken; }; @@ -667,7 +667,7 @@ class IdentifierPropertyName: public PropertyName public: JAVASCRIPT_DECLARE_AST_NODE(IdentifierPropertyName) - IdentifierPropertyName(JavaScriptNameIdImpl *n): + IdentifierPropertyName(NameId *n): id (n) { kind = K; } virtual ~IdentifierPropertyName() {} @@ -675,7 +675,7 @@ public: virtual void accept0(Visitor *visitor); // attributes - JavaScriptNameIdImpl *id; + NameId *id; }; class StringLiteralPropertyName: public PropertyName @@ -683,14 +683,14 @@ class StringLiteralPropertyName: public PropertyName public: JAVASCRIPT_DECLARE_AST_NODE(StringLiteralPropertyName) - StringLiteralPropertyName(JavaScriptNameIdImpl *n): + StringLiteralPropertyName(NameId *n): id (n) { kind = K; } virtual ~StringLiteralPropertyName() {} virtual void accept0(Visitor *visitor); // attributes - JavaScriptNameIdImpl *id; + NameId *id; }; class NumericLiteralPropertyName: public PropertyName @@ -739,7 +739,7 @@ class FieldMemberExpression: public ExpressionNode public: JAVASCRIPT_DECLARE_AST_NODE(FieldMemberExpression) - FieldMemberExpression(ExpressionNode *b, JavaScriptNameIdImpl *n): + FieldMemberExpression(ExpressionNode *b, NameId *n): base (b), name (n) { kind = K; } @@ -755,7 +755,7 @@ public: // attributes ExpressionNode *base; - JavaScriptNameIdImpl *name; + NameId *name; SourceLocation dotToken; SourceLocation identifierToken; }; @@ -1288,7 +1288,7 @@ class VariableDeclaration: public Node public: JAVASCRIPT_DECLARE_AST_NODE(VariableDeclaration) - VariableDeclaration(JavaScriptNameIdImpl *n, ExpressionNode *e): + VariableDeclaration(NameId *n, ExpressionNode *e): name (n), expression (e), readOnly(false) { kind = K; } @@ -1297,7 +1297,7 @@ public: virtual void accept0(Visitor *visitor); // attributes - JavaScriptNameIdImpl *name; + NameId *name; ExpressionNode *expression; bool readOnly; SourceLocation identifierToken; @@ -1602,7 +1602,7 @@ class ContinueStatement: public Statement public: JAVASCRIPT_DECLARE_AST_NODE(ContinueStatement) - ContinueStatement(JavaScriptNameIdImpl *l = 0): + ContinueStatement(NameId *l = 0): label (l) { kind = K; } virtual ~ContinueStatement() {} @@ -1616,7 +1616,7 @@ public: { return semicolonToken; } // attributes - JavaScriptNameIdImpl *label; + NameId *label; SourceLocation continueToken; SourceLocation identifierToken; SourceLocation semicolonToken; @@ -1627,7 +1627,7 @@ class BreakStatement: public Statement public: JAVASCRIPT_DECLARE_AST_NODE(BreakStatement) - BreakStatement(JavaScriptNameIdImpl *l = 0): + BreakStatement(NameId *l = 0): label (l) { kind = K; } virtual ~BreakStatement() {} @@ -1641,7 +1641,7 @@ public: { return semicolonToken; } // attributes - JavaScriptNameIdImpl *label; + NameId *label; SourceLocation breakToken; SourceLocation identifierToken; SourceLocation semicolonToken; @@ -1823,7 +1823,7 @@ class LabelledStatement: public Statement public: JAVASCRIPT_DECLARE_AST_NODE(LabelledStatement) - LabelledStatement(JavaScriptNameIdImpl *l, Statement *stmt): + LabelledStatement(NameId *l, Statement *stmt): label (l), statement (stmt) { kind = K; } @@ -1838,7 +1838,7 @@ public: { return statement->lastSourceLocation(); } // attributes - JavaScriptNameIdImpl *label; + NameId *label; Statement *statement; SourceLocation identifierToken; SourceLocation colonToken; @@ -1873,7 +1873,7 @@ class Catch: public Node public: JAVASCRIPT_DECLARE_AST_NODE(Catch) - Catch(JavaScriptNameIdImpl *n, Block *stmt): + Catch(NameId *n, Block *stmt): name (n), statement (stmt) { kind = K; } @@ -1882,7 +1882,7 @@ public: virtual void accept0(Visitor *visitor); // attributes - JavaScriptNameIdImpl *name; + NameId *name; Block *statement; SourceLocation catchToken; SourceLocation lparenToken; @@ -1954,7 +1954,7 @@ class FunctionExpression: public ExpressionNode public: JAVASCRIPT_DECLARE_AST_NODE(FunctionExpression) - FunctionExpression(JavaScriptNameIdImpl *n, FormalParameterList *f, FunctionBody *b): + FunctionExpression(NameId *n, FormalParameterList *f, FunctionBody *b): name (n), formals (f), body (b) { kind = K; } @@ -1969,7 +1969,7 @@ public: { return rbraceToken; } // attributes - JavaScriptNameIdImpl *name; + NameId *name; FormalParameterList *formals; FunctionBody *body; SourceLocation functionToken; @@ -1985,7 +1985,7 @@ class FunctionDeclaration: public FunctionExpression public: JAVASCRIPT_DECLARE_AST_NODE(FunctionDeclaration) - FunctionDeclaration(JavaScriptNameIdImpl *n, FormalParameterList *f, FunctionBody *b): + FunctionDeclaration(NameId *n, FormalParameterList *f, FunctionBody *b): FunctionExpression(n, f, b) { kind = K; } @@ -1999,11 +1999,11 @@ class FormalParameterList: public Node public: JAVASCRIPT_DECLARE_AST_NODE(FormalParameterList) - FormalParameterList(JavaScriptNameIdImpl *n): + FormalParameterList(NameId *n): name (n), next (this) { kind = K; } - FormalParameterList(FormalParameterList *previous, JavaScriptNameIdImpl *n): + FormalParameterList(FormalParameterList *previous, NameId *n): name (n) { kind = K; @@ -2023,7 +2023,7 @@ public: } // attributes - JavaScriptNameIdImpl *name; + NameId *name; FormalParameterList *next; SourceLocation commaToken; SourceLocation identifierToken; @@ -2185,11 +2185,11 @@ class UiQualifiedId: public Node public: JAVASCRIPT_DECLARE_AST_NODE(UiQualifiedId) - UiQualifiedId(JavaScriptNameIdImpl *name) + UiQualifiedId(NameId *name) : next(this), name(name) { kind = K; } - UiQualifiedId(UiQualifiedId *previous, JavaScriptNameIdImpl *name) + UiQualifiedId(UiQualifiedId *previous, NameId *name) : name(name) { kind = K; @@ -2210,7 +2210,7 @@ public: // attributes UiQualifiedId *next; - JavaScriptNameIdImpl *name; + NameId *name; SourceLocation identifierToken; }; @@ -2219,14 +2219,14 @@ class UiImport: public Node public: JAVASCRIPT_DECLARE_AST_NODE(UiImport) - UiImport(JavaScriptNameIdImpl *fileName) + UiImport(NameId *fileName) : fileName(fileName) { kind = K; } virtual void accept0(Visitor *visitor); // attributes - JavaScriptNameIdImpl *fileName; + NameId *fileName; SourceLocation importToken; SourceLocation fileNameToken; SourceLocation semicolonToken; @@ -2324,13 +2324,13 @@ class UiPublicMember: public UiObjectMember public: JAVASCRIPT_DECLARE_AST_NODE(UiPublicMember) - UiPublicMember(JavaScriptNameIdImpl *memberType, - JavaScriptNameIdImpl *name) + UiPublicMember(NameId *memberType, + NameId *name) : type(Property), memberType(memberType), name(name), expression(0), isDefaultMember(false) { kind = K; } - UiPublicMember(JavaScriptNameIdImpl *memberType, - JavaScriptNameIdImpl *name, + UiPublicMember(NameId *memberType, + NameId *name, ExpressionNode *expression) : type(Property), memberType(memberType), name(name), expression(expression), isDefaultMember(false) { kind = K; } @@ -2352,8 +2352,8 @@ public: // attributes enum { Signal, Property } type; - JavaScriptNameIdImpl *memberType; - JavaScriptNameIdImpl *name; + NameId *memberType; + NameId *name; ExpressionNode *expression; bool isDefaultMember; SourceLocation defaultToken; @@ -2369,7 +2369,7 @@ class UiObjectDefinition: public UiObjectMember public: JAVASCRIPT_DECLARE_AST_NODE(UiObjectDefinition) - UiObjectDefinition(JavaScriptNameIdImpl *name, + UiObjectDefinition(NameId *name, UiObjectInitializer *initializer) : name(name), initializer(initializer) { kind = K; } @@ -2388,7 +2388,7 @@ public: virtual void accept0(Visitor *visitor); // attributes - JavaScriptNameIdImpl *name; + NameId *name; UiObjectInitializer *initializer; SourceLocation identifierToken; }; @@ -2435,7 +2435,7 @@ public: JAVASCRIPT_DECLARE_AST_NODE(UiObjectBinding) UiObjectBinding(UiQualifiedId *qualifiedId, - JavaScriptNameIdImpl *name, + NameId *name, UiObjectInitializer *initializer) : qualifiedId(qualifiedId), name(name), @@ -2452,7 +2452,7 @@ public: // attributes UiQualifiedId *qualifiedId; - JavaScriptNameIdImpl *name; + NameId *name; UiObjectInitializer *initializer; SourceLocation colonToken; SourceLocation identifierToken; diff --git a/src/declarative/qml/parser/javascriptengine_p.cpp b/src/declarative/qml/parser/javascriptengine_p.cpp index 56ee76c..ab1e370 100644 --- a/src/declarative/qml/parser/javascriptengine_p.cpp +++ b/src/declarative/qml/parser/javascriptengine_p.cpp @@ -34,6 +34,9 @@ QT_BEGIN_NAMESPACE +uint qHash(const JavaScript::NameId &id) +{ return qHash(id.asString()); } + namespace JavaScript { QString numberToString(double value) diff --git a/src/declarative/qml/parser/javascriptengine_p.h b/src/declarative/qml/parser/javascriptengine_p.h index 7941b27..b768f5e 100644 --- a/src/declarative/qml/parser/javascriptengine_p.h +++ b/src/declarative/qml/parser/javascriptengine_p.h @@ -36,15 +36,19 @@ QT_BEGIN_NAMESPACE namespace JavaScript { +class NameId; +} + +uint qHash(const JavaScript::NameId &id); + +namespace JavaScript { class Node; class Lexer; class NodePool; namespace AST { - class Node; - } // end of namespace AST namespace Ecma { @@ -65,79 +69,75 @@ public: } // end of namespace Ecma -} // end of namespace JavaScript - - -class JavaScriptNameIdImpl +class NameId { QString _text; public: - JavaScriptNameIdImpl(const QChar *u, int s) + NameId(const QChar *u, int s) : _text(u, s) { } const QString asString() const { return _text; } - bool operator == (const JavaScriptNameIdImpl &other) const + bool operator == (const NameId &other) const { return _text == other._text; } - bool operator != (const JavaScriptNameIdImpl &other) const + bool operator != (const NameId &other) const { return _text != other._text; } - bool operator < (const JavaScriptNameIdImpl &other) const + bool operator < (const NameId &other) const { return _text < other._text; } }; -inline uint qHash(const JavaScriptNameIdImpl &id) -{ return qHash(id.asString()); } - class JavaScriptEnginePrivate { - JavaScript::Lexer *_lexer; - JavaScript::NodePool *_nodePool; - JavaScript::AST::Node *_ast; - QSet _literals; + Lexer *_lexer; + NodePool *_nodePool; + AST::Node *_ast; + QSet _literals; public: JavaScriptEnginePrivate() : _lexer(0), _nodePool(0), _ast(0) { } - QSet literals() const + QSet literals() const { return _literals; } - JavaScriptNameIdImpl *intern(const QChar *u, int s) - { return const_cast(&*_literals.insert(JavaScriptNameIdImpl(u, s))); } + NameId *intern(const QChar *u, int s) + { return const_cast(&*_literals.insert(NameId(u, s))); } - static QString toString(JavaScriptNameIdImpl *id) + static QString toString(NameId *id) { return id->asString(); } - JavaScript::Lexer *lexer() const + Lexer *lexer() const { return _lexer; } - void setLexer(JavaScript::Lexer *lexer) + void setLexer(Lexer *lexer) { _lexer = lexer; } - JavaScript::NodePool *nodePool() const + NodePool *nodePool() const { return _nodePool; } - void setNodePool(JavaScript::NodePool *nodePool) + void setNodePool(NodePool *nodePool) { _nodePool = nodePool; } - JavaScript::AST::Node *ast() const + AST::Node *ast() const { return _ast; } - JavaScript::AST::Node *changeAbstractSyntaxTree(JavaScript::AST::Node *node) + AST::Node *changeAbstractSyntaxTree(AST::Node *node) { - JavaScript::AST::Node *previousAST = _ast; + AST::Node *previousAST = _ast; _ast = node; return previousAST; } }; +} // end of namespace JavaScript + QT_END_NAMESPACE #endif // JAVASCRIPTENGINE_P_H diff --git a/src/declarative/qml/parser/javascriptlexer_p.h b/src/declarative/qml/parser/javascriptlexer_p.h index e71c10c..55351c4 100644 --- a/src/declarative/qml/parser/javascriptlexer_p.h +++ b/src/declarative/qml/parser/javascriptlexer_p.h @@ -59,11 +59,11 @@ QT_BEGIN_NAMESPACE -class JavaScriptEnginePrivate; -class JavaScriptNameIdImpl; - namespace JavaScript { +class JavaScriptEnginePrivate; +class NameId; + class Lexer { public: @@ -136,7 +136,7 @@ public: bool scanRegExp(RegExpBodyPrefix prefix = NoPrefix); - JavaScriptNameIdImpl *pattern; + NameId *pattern; int flags; State lexerState() const @@ -194,7 +194,7 @@ public: inline int ival() const { return qsyylval.ival; } inline double dval() const { return qsyylval.dval; } - inline JavaScriptNameIdImpl *ustr() const { return qsyylval.ustr; } + inline NameId *ustr() const { return qsyylval.ustr; } const QChar *characterBuffer() const { return buffer16; } int characterCount() const { return pos16; } @@ -219,7 +219,7 @@ private: union { int ival; double dval; - JavaScriptNameIdImpl *ustr; + NameId *ustr; } qsyylval; // current and following unicode characters diff --git a/src/declarative/qml/parser/javascriptnodepool_p.h b/src/declarative/qml/parser/javascriptnodepool_p.h index 3f59123..91b9132 100644 --- a/src/declarative/qml/parser/javascriptnodepool_p.h +++ b/src/declarative/qml/parser/javascriptnodepool_p.h @@ -60,8 +60,6 @@ QT_BEGIN_NAMESPACE -class JavaScriptEnginePrivate; - namespace JavaScript { namespace AST { @@ -70,6 +68,7 @@ class Node; class Code; class CompilationUnit; +class JavaScriptEnginePrivate; template inline NodeType *makeAstNode(MemoryPool *storage) diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index ed791c8..39e7aba 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -63,7 +63,7 @@ using namespace JavaScript; QT_BEGIN_NAMESPACE -void JavaScriptParser::reallocateStack() +void Parser::reallocateStack() { if (! stack_size) stack_size = 128; @@ -83,7 +83,7 @@ inline static bool automatic(JavaScriptEnginePrivate *driver, int token) } -JavaScriptParser::JavaScriptParser(): +Parser::Parser(): tos(0), stack_size(0), sym_stack(0), @@ -94,7 +94,7 @@ JavaScriptParser::JavaScriptParser(): { } -JavaScriptParser::~JavaScriptParser() +Parser::~Parser() { if (stack_size) { qFree(sym_stack); @@ -113,7 +113,7 @@ static inline AST::SourceLocation location(Lexer *lexer) return loc; } -bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) +bool Parser::parse(JavaScriptEnginePrivate *driver) { Lexer *lexer = driver->lexer(); bool hadErrors = false; @@ -166,7 +166,7 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) case 0: { program = makeAstNode (driver->nodePool(), sym(1).UiImportList, sym(2).UiObjectMemberList->finish()); - sym(1).UiProgram = program; + sym(1).UiProgram = program; } break; case 2: { @@ -275,7 +275,7 @@ case 23: { sym(1).Node = node; } break; -case 24: +case 24: case 25: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); @@ -283,7 +283,7 @@ case 25: { } case 27: { - AST::UiPublicMember *node = makeAstNode (driver->nodePool(), (JavaScriptNameIdImpl *)0, sym(2).sval); + AST::UiPublicMember *node = makeAstNode (driver->nodePool(), (NameId *)0, sym(2).sval); node->type = AST::UiPublicMember::Signal; node->propertyToken = loc(1); node->typeToken = loc(2); @@ -529,37 +529,37 @@ case 67: { sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); node->commaToken = loc(2); node->colonToken = loc(4); - sym(1).Node = node; + sym(1).Node = node; } break; case 68: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); - sym(1).Node = node; + sym(1).Node = node; } break; case 69: case 70: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->propertyNameToken = loc(1); - sym(1).Node = node; + sym(1).Node = node; } break; case 71: { AST::StringLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); - sym(1).Node = node; + sym(1).Node = node; } break; case 72: { AST::NumericLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).dval); node->propertyNameToken = loc(1); - sym(1).Node = node; + sym(1).Node = node; } break; case 73: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); - sym(1).Node = node; + sym(1).Node = node; } break; case 74: diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index 5e68fe7..e3e08cb 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -67,52 +67,55 @@ QT_BEGIN_NAMESPACE class QString; + +namespace JavaScript { + class JavaScriptEnginePrivate; -class JavaScriptNameIdImpl; +class NameId; -class JavaScriptParser: protected JavaScriptGrammar +class Parser: protected JavaScriptGrammar { public: union Value { int ival; double dval; - JavaScriptNameIdImpl *sval; - JavaScript::AST::ArgumentList *ArgumentList; - JavaScript::AST::CaseBlock *CaseBlock; - JavaScript::AST::CaseClause *CaseClause; - JavaScript::AST::CaseClauses *CaseClauses; - JavaScript::AST::Catch *Catch; - JavaScript::AST::DefaultClause *DefaultClause; - JavaScript::AST::ElementList *ElementList; - JavaScript::AST::Elision *Elision; - JavaScript::AST::ExpressionNode *Expression; - JavaScript::AST::Finally *Finally; - JavaScript::AST::FormalParameterList *FormalParameterList; - JavaScript::AST::FunctionBody *FunctionBody; - JavaScript::AST::FunctionDeclaration *FunctionDeclaration; - JavaScript::AST::Node *Node; - JavaScript::AST::PropertyName *PropertyName; - JavaScript::AST::PropertyNameAndValueList *PropertyNameAndValueList; - JavaScript::AST::SourceElement *SourceElement; - JavaScript::AST::SourceElements *SourceElements; - JavaScript::AST::Statement *Statement; - JavaScript::AST::StatementList *StatementList; - JavaScript::AST::Block *Block; - JavaScript::AST::VariableDeclaration *VariableDeclaration; - JavaScript::AST::VariableDeclarationList *VariableDeclarationList; - - JavaScript::AST::UiProgram *UiProgram; - JavaScript::AST::UiImportList *UiImportList; - JavaScript::AST::UiImport *UiImport; - JavaScript::AST::UiPublicMember *UiPublicMember; - JavaScript::AST::UiObjectDefinition *UiObjectDefinition; - JavaScript::AST::UiObjectInitializer *UiObjectInitializer; - JavaScript::AST::UiObjectBinding *UiObjectBinding; - JavaScript::AST::UiScriptBinding *UiScriptBinding; - JavaScript::AST::UiArrayBinding *UiArrayBinding; - JavaScript::AST::UiObjectMember *UiObjectMember; - JavaScript::AST::UiObjectMemberList *UiObjectMemberList; - JavaScript::AST::UiQualifiedId *UiQualifiedId; + NameId *sval; + AST::ArgumentList *ArgumentList; + AST::CaseBlock *CaseBlock; + AST::CaseClause *CaseClause; + AST::CaseClauses *CaseClauses; + AST::Catch *Catch; + AST::DefaultClause *DefaultClause; + AST::ElementList *ElementList; + AST::Elision *Elision; + AST::ExpressionNode *Expression; + AST::Finally *Finally; + AST::FormalParameterList *FormalParameterList; + AST::FunctionBody *FunctionBody; + AST::FunctionDeclaration *FunctionDeclaration; + AST::Node *Node; + AST::PropertyName *PropertyName; + AST::PropertyNameAndValueList *PropertyNameAndValueList; + AST::SourceElement *SourceElement; + AST::SourceElements *SourceElements; + AST::Statement *Statement; + AST::StatementList *StatementList; + AST::Block *Block; + AST::VariableDeclaration *VariableDeclaration; + AST::VariableDeclarationList *VariableDeclarationList; + + AST::UiProgram *UiProgram; + AST::UiImportList *UiImportList; + AST::UiImport *UiImport; + AST::UiPublicMember *UiPublicMember; + AST::UiObjectDefinition *UiObjectDefinition; + AST::UiObjectInitializer *UiObjectInitializer; + AST::UiObjectBinding *UiObjectBinding; + AST::UiScriptBinding *UiScriptBinding; + AST::UiArrayBinding *UiArrayBinding; + AST::UiObjectMember *UiObjectMember; + AST::UiObjectMemberList *UiObjectMemberList; + AST::UiQualifiedId *UiQualifiedId; }; struct DiagnosticMessage { @@ -121,7 +124,7 @@ public: DiagnosticMessage() : kind(Error) {} - DiagnosticMessage(Kind kind, const JavaScript::AST::SourceLocation &loc, const QString &message) + DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message) : kind(kind), loc(loc), message(message) {} bool isWarning() const @@ -131,17 +134,17 @@ public: { return kind == Error; } Kind kind; - JavaScript::AST::SourceLocation loc; + AST::SourceLocation loc; QString message; }; public: - JavaScriptParser(); - ~JavaScriptParser(); + Parser(); + ~Parser(); bool parse(JavaScriptEnginePrivate *driver); - JavaScript::AST::UiProgram *ast() + AST::UiProgram *ast() { return program; } QList diagnosticMessages() const @@ -172,7 +175,7 @@ protected: inline Value &sym(int index) { return sym_stack [tos + index - 1]; } - inline JavaScript::AST::SourceLocation &loc(int index) + inline AST::SourceLocation &loc(int index) { return location_stack [tos + index - 1]; } protected: @@ -180,9 +183,9 @@ protected: int stack_size; Value *sym_stack; int *state_stack; - JavaScript::AST::SourceLocation *location_stack; + AST::SourceLocation *location_stack; - JavaScript::AST::UiProgram *program; + AST::UiProgram *program; // error recovery enum { TOKEN_BUFFER_SIZE = 3 }; @@ -190,12 +193,12 @@ protected: struct SavedToken { int token; double dval; - JavaScript::AST::SourceLocation loc; + AST::SourceLocation loc; }; double yylval; - JavaScript::AST::SourceLocation yylloc; - JavaScript::AST::SourceLocation yyprevlloc; + AST::SourceLocation yylloc; + AST::SourceLocation yyprevlloc; SavedToken token_buffer[TOKEN_BUFFER_SIZE]; SavedToken *first_token; @@ -204,6 +207,9 @@ protected: QList diagnostic_messages; }; +} // end of namespace JavaScript + + #define J_SCRIPT_REGEXPLITERAL_RULE1 52 diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index ff19d25..cd33624 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -632,7 +632,7 @@ bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url) QTextStream stream(data, QIODevice::ReadOnly); const QString code = stream.readAll(); - JavaScriptParser parser; + Parser parser; JavaScriptEnginePrivate driver; NodePool nodePool(fileName, &driver); @@ -645,7 +645,7 @@ bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url) if (! parser.parse(&driver) || !_errors.isEmpty()) { // Extract errors from the parser - foreach (const JavaScriptParser::DiagnosticMessage &m, parser.diagnosticMessages()) { + foreach (const Parser::DiagnosticMessage &m, parser.diagnosticMessages()) { if (m.isWarning()) continue; -- cgit v0.12 From 699e4ebfca621d4a009221b4304c3773cb783f7b Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 14 May 2009 11:43:12 +0200 Subject: Renamed JavaScriptEnginePrivate in Engine. --- src/declarative/qml/parser/javascript.g | 8 +++--- src/declarative/qml/parser/javascriptengine_p.cpp | 2 +- src/declarative/qml/parser/javascriptengine_p.h | 4 +-- src/declarative/qml/parser/javascriptlexer.cpp | 2 +- src/declarative/qml/parser/javascriptlexer_p.h | 6 ++--- src/declarative/qml/parser/javascriptnodepool_p.h | 8 +++--- src/declarative/qml/parser/javascriptparser.cpp | 4 +-- src/declarative/qml/parser/javascriptparser_p.h | 4 +-- .../qml/parser/javascriptprettypretty.cpp | 30 +++++++++++----------- src/declarative/qml/qmlscriptparser.cpp | 12 ++++----- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index b70774b..53d10b6 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -215,7 +215,7 @@ class QString; namespace JavaScript { -class JavaScriptEnginePrivate; +class Engine; class NameId; class Parser: protected $table @@ -287,7 +287,7 @@ public: Parser(); ~Parser(); - bool parse(JavaScriptEnginePrivate *driver); + bool parse(Engine *driver); AST::UiProgram *ast() { return program; } @@ -383,7 +383,7 @@ void Parser::reallocateStack() location_stack = reinterpret_cast (qRealloc(location_stack, stack_size * sizeof(AST::SourceLocation))); } -inline static bool automatic(JavaScriptEnginePrivate *driver, int token) +inline static bool automatic(Engine *driver, int token) { return token == $table::T_RBRACE || token == 0 @@ -421,7 +421,7 @@ static inline AST::SourceLocation location(Lexer *lexer) return loc; } -bool Parser::parse(JavaScriptEnginePrivate *driver) +bool Parser::parse(Engine *driver) { Lexer *lexer = driver->lexer(); bool hadErrors = false; diff --git a/src/declarative/qml/parser/javascriptengine_p.cpp b/src/declarative/qml/parser/javascriptengine_p.cpp index ab1e370..679202c 100644 --- a/src/declarative/qml/parser/javascriptengine_p.cpp +++ b/src/declarative/qml/parser/javascriptengine_p.cpp @@ -69,7 +69,7 @@ QString Ecma::RegExp::flagsToString(int flags) return result; } -NodePool::NodePool(const QString &fileName, JavaScriptEnginePrivate *engine) +NodePool::NodePool(const QString &fileName, Engine *engine) : m_fileName(fileName), m_engine(engine) { } diff --git a/src/declarative/qml/parser/javascriptengine_p.h b/src/declarative/qml/parser/javascriptengine_p.h index b768f5e..6aa4a76 100644 --- a/src/declarative/qml/parser/javascriptengine_p.h +++ b/src/declarative/qml/parser/javascriptengine_p.h @@ -92,7 +92,7 @@ public: { return _text < other._text; } }; -class JavaScriptEnginePrivate +class Engine { Lexer *_lexer; NodePool *_nodePool; @@ -100,7 +100,7 @@ class JavaScriptEnginePrivate QSet _literals; public: - JavaScriptEnginePrivate() + Engine() : _lexer(0), _nodePool(0), _ast(0) { } diff --git a/src/declarative/qml/parser/javascriptlexer.cpp b/src/declarative/qml/parser/javascriptlexer.cpp index dbb7351..a0081c7 100644 --- a/src/declarative/qml/parser/javascriptlexer.cpp +++ b/src/declarative/qml/parser/javascriptlexer.cpp @@ -76,7 +76,7 @@ namespace JavaScript { extern double integerFromString(const char *buf, int size, int radix); } -JavaScript::Lexer::Lexer(JavaScriptEnginePrivate *eng) +JavaScript::Lexer::Lexer(Engine *eng) : driver(eng), yylineno(0), done(false), diff --git a/src/declarative/qml/parser/javascriptlexer_p.h b/src/declarative/qml/parser/javascriptlexer_p.h index 55351c4..092609c 100644 --- a/src/declarative/qml/parser/javascriptlexer_p.h +++ b/src/declarative/qml/parser/javascriptlexer_p.h @@ -61,13 +61,13 @@ QT_BEGIN_NAMESPACE namespace JavaScript { -class JavaScriptEnginePrivate; +class Engine; class NameId; class Lexer { public: - Lexer(JavaScriptEnginePrivate *eng); + Lexer(Engine *eng); ~Lexer(); void setCode(const QString &c, int lineno); @@ -155,7 +155,7 @@ public: { err = NoError; } private: - JavaScriptEnginePrivate *driver; + Engine *driver; int yylineno; bool done; char *buffer8; diff --git a/src/declarative/qml/parser/javascriptnodepool_p.h b/src/declarative/qml/parser/javascriptnodepool_p.h index 91b9132..cb56fbb 100644 --- a/src/declarative/qml/parser/javascriptnodepool_p.h +++ b/src/declarative/qml/parser/javascriptnodepool_p.h @@ -68,7 +68,7 @@ class Node; class Code; class CompilationUnit; -class JavaScriptEnginePrivate; +class Engine; template inline NodeType *makeAstNode(MemoryPool *storage) @@ -108,13 +108,13 @@ inline NodeType *makeAstNode(MemoryPool *storage, Arg1 arg1, Arg2 arg2, Arg3 arg class NodePool : public MemoryPool { public: - NodePool(const QString &fileName, JavaScriptEnginePrivate *engine); + NodePool(const QString &fileName, Engine *engine); virtual ~NodePool(); Code *createCompiledCode(AST::Node *node, CompilationUnit &compilation); inline QString fileName() const { return m_fileName; } - inline JavaScriptEnginePrivate *engine() const { return m_engine; } + inline Engine *engine() const { return m_engine; } #ifndef J_SCRIPT_NO_EVENT_NOTIFY inline qint64 id() const { return m_id; } #endif @@ -122,7 +122,7 @@ public: private: QHash m_codeCache; QString m_fileName; - JavaScriptEnginePrivate *m_engine; + Engine *m_engine; #ifndef J_SCRIPT_NO_EVENT_NOTIFY qint64 m_id; #endif diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 39e7aba..3c853cb 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -75,7 +75,7 @@ void Parser::reallocateStack() location_stack = reinterpret_cast (qRealloc(location_stack, stack_size * sizeof(AST::SourceLocation))); } -inline static bool automatic(JavaScriptEnginePrivate *driver, int token) +inline static bool automatic(Engine *driver, int token) { return token == JavaScriptGrammar::T_RBRACE || token == 0 @@ -113,7 +113,7 @@ static inline AST::SourceLocation location(Lexer *lexer) return loc; } -bool Parser::parse(JavaScriptEnginePrivate *driver) +bool Parser::parse(Engine *driver) { Lexer *lexer = driver->lexer(); bool hadErrors = false; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index e3e08cb..deb6176 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -70,7 +70,7 @@ class QString; namespace JavaScript { -class JavaScriptEnginePrivate; +class Engine; class NameId; class Parser: protected JavaScriptGrammar @@ -142,7 +142,7 @@ public: Parser(); ~Parser(); - bool parse(JavaScriptEnginePrivate *driver); + bool parse(Engine *driver); AST::UiProgram *ast() { return program; } diff --git a/src/declarative/qml/parser/javascriptprettypretty.cpp b/src/declarative/qml/parser/javascriptprettypretty.cpp index 9685de5..0342b39 100644 --- a/src/declarative/qml/parser/javascriptprettypretty.cpp +++ b/src/declarative/qml/parser/javascriptprettypretty.cpp @@ -182,7 +182,7 @@ void PrettyPretty::endVisit(AST::ThisExpression *node) bool PrettyPretty::visit(AST::IdentifierExpression *node) { - out << JavaScriptEnginePrivate::toString(node->name); + out << Engine::toString(node->name); return true; } @@ -229,7 +229,7 @@ void PrettyPretty::endVisit(AST::FalseLiteral *node) bool PrettyPretty::visit(AST::StringLiteral *node) { - QString lit = JavaScriptEnginePrivate::toString(node->value); + QString lit = Engine::toString(node->value); lit.replace(QLatin1String("\\"), QLatin1String("\\\\")); out << "\"" << lit << "\""; return false; @@ -253,7 +253,7 @@ void PrettyPretty::endVisit(AST::NumericLiteral *node) bool PrettyPretty::visit(AST::RegExpLiteral *node) { - out << "/" << JavaScriptEnginePrivate::toString(node->pattern) << "/"; + out << "/" << Engine::toString(node->pattern) << "/"; if (node->flags) out << JavaScript::Ecma::RegExp::flagsToString(node->flags); @@ -348,7 +348,7 @@ void PrettyPretty::endVisit(AST::PropertyNameAndValueList *node) bool PrettyPretty::visit(AST::IdentifierPropertyName *node) { - out << JavaScriptEnginePrivate::toString(node->id); + out << Engine::toString(node->id); return false; } @@ -359,7 +359,7 @@ void PrettyPretty::endVisit(AST::IdentifierPropertyName *node) bool PrettyPretty::visit(AST::StringLiteralPropertyName *node) { - QString lit = JavaScriptEnginePrivate::toString(node->id); + QString lit = Engine::toString(node->id); lit.replace(QLatin1String("\\"), QLatin1String("\\\\")); out << lit; return false; @@ -398,7 +398,7 @@ void PrettyPretty::endVisit(AST::ArrayMemberExpression *node) bool PrettyPretty::visit(AST::FieldMemberExpression *node) { accept(node->base); - out << "." << JavaScriptEnginePrivate::toString(node->name); + out << "." << Engine::toString(node->name); return false; } @@ -803,7 +803,7 @@ void PrettyPretty::endVisit(AST::VariableStatement *node) bool PrettyPretty::visit(AST::VariableDeclaration *node) { - out << JavaScriptEnginePrivate::toString(node->name); + out << Engine::toString(node->name); if (node->expression) { out << " = "; accept(node->expression); @@ -959,7 +959,7 @@ bool PrettyPretty::visit(AST::ContinueStatement *node) { out << "continue"; if (node->label) { - out << " " << JavaScriptEnginePrivate::toString(node->label); + out << " " << Engine::toString(node->label); } out << ";"; return false; @@ -974,7 +974,7 @@ bool PrettyPretty::visit(AST::BreakStatement *node) { out << "break"; if (node->label) { - out << " " << JavaScriptEnginePrivate::toString(node->label); + out << " " << Engine::toString(node->label); } out << ";"; return false; @@ -1095,7 +1095,7 @@ void PrettyPretty::endVisit(AST::DefaultClause *node) bool PrettyPretty::visit(AST::LabelledStatement *node) { - out << JavaScriptEnginePrivate::toString(node->label) << ": "; + out << Engine::toString(node->label) << ": "; return true; } @@ -1123,7 +1123,7 @@ bool PrettyPretty::visit(AST::TryStatement *node) out << "try "; acceptAsBlock(node->statement); if (node->catchExpression) { - out << " catch (" << JavaScriptEnginePrivate::toString(node->catchExpression->name) << ") "; + out << " catch (" << Engine::toString(node->catchExpression->name) << ") "; acceptAsBlock(node->catchExpression->statement); } if (node->finallyExpression) { @@ -1166,13 +1166,13 @@ bool PrettyPretty::visit(AST::FunctionDeclaration *node) out << "function"; if (node->name) - out << " " << JavaScriptEnginePrivate::toString(node->name); + out << " " << Engine::toString(node->name); // the arguments out << "("; for (AST::FormalParameterList *it = node->formals; it; it = it->next) { if (it->name) - out << JavaScriptEnginePrivate::toString(it->name); + out << Engine::toString(it->name); if (it->next) out << ", "; @@ -1205,13 +1205,13 @@ bool PrettyPretty::visit(AST::FunctionExpression *node) out << "function"; if (node->name) - out << " " << JavaScriptEnginePrivate::toString(node->name); + out << " " << Engine::toString(node->name); // the arguments out << "("; for (AST::FormalParameterList *it = node->formals; it; it = it->next) { if (it->name) - out << JavaScriptEnginePrivate::toString(it->name); + out << Engine::toString(it->name); if (it->next) out << ", "; diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index cd33624..6f29d17 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -633,16 +633,16 @@ bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url) const QString code = stream.readAll(); Parser parser; - JavaScriptEnginePrivate driver; + Engine engine; - NodePool nodePool(fileName, &driver); - driver.setNodePool(&nodePool); + NodePool nodePool(fileName, &engine); + engine.setNodePool(&nodePool); - Lexer lexer(&driver); + Lexer lexer(&engine); lexer.setCode(code, /*line = */ 1); - driver.setLexer(&lexer); + engine.setLexer(&lexer); - if (! parser.parse(&driver) || !_errors.isEmpty()) { + if (! parser.parse(&engine) || !_errors.isEmpty()) { // Extract errors from the parser foreach (const Parser::DiagnosticMessage &m, parser.diagnosticMessages()) { -- cgit v0.12 From 3bf4db673c3e74ab9a4c3319fd7a1df15ff52ea9 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 14 May 2009 11:50:46 +0200 Subject: Moved Parser::DiagnosticMessage and AST::SourceLocation --- src/declarative/qml/parser/javascript.g | 22 ++----------------- src/declarative/qml/parser/javascriptast_p.h | 26 +--------------------- src/declarative/qml/parser/javascriptastfwd_p.h | 21 +++++++++++++++++- src/declarative/qml/parser/javascriptengine_p.h | 29 ++++++++++++++++++++----- src/declarative/qml/parser/javascriptparser_p.h | 22 ++----------------- src/declarative/qml/qmlscriptparser.cpp | 2 +- 6 files changed, 50 insertions(+), 72 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 53d10b6..53db3d9 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -207,6 +207,8 @@ #include "javascriptgrammar_p.h" #include "javascriptast_p.h" +#include "javascriptengine_p.h" + #include QT_BEGIN_NAMESPACE @@ -263,26 +265,6 @@ public: AST::UiQualifiedId *UiQualifiedId; }; - struct DiagnosticMessage { - enum Kind { Warning, Error }; - - DiagnosticMessage() - : kind(Error) {} - - DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message) - : kind(kind), loc(loc), message(message) {} - - bool isWarning() const - { return kind == Warning; } - - bool isError() const - { return kind == Error; } - - Kind kind; - AST::SourceLocation loc; - QString message; - }; - public: Parser(); ~Parser(); diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 816835e..571fdff 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -53,11 +53,8 @@ // We mean it. // -#include - - - #include "javascriptastvisitor_p.h" +#include QT_BEGIN_NAMESPACE @@ -120,27 +117,6 @@ _T1 cast(_T2 *ast) return 0; } -class SourceLocation -{ -public: - SourceLocation(quint32 offset = 0, quint32 length = 0) - : offset(offset), length(length), - startLine(0), startColumn(0) - { } - - bool isValid() const { return length != 0; } - - quint32 begin() const { return offset; } - quint32 end() const { return offset + length; } - -// attributes - // ### encode - quint32 offset; - quint32 length; - quint32 startLine; - quint32 startColumn; -}; - class Node { public: diff --git a/src/declarative/qml/parser/javascriptastfwd_p.h b/src/declarative/qml/parser/javascriptastfwd_p.h index 858e393..822a2d7 100644 --- a/src/declarative/qml/parser/javascriptastfwd_p.h +++ b/src/declarative/qml/parser/javascriptastfwd_p.h @@ -59,7 +59,26 @@ QT_BEGIN_NAMESPACE namespace JavaScript { namespace AST { -class SourceLocation; +class SourceLocation +{ +public: + SourceLocation(quint32 offset = 0, quint32 length = 0) + : offset(offset), length(length), + startLine(0), startColumn(0) + { } + + bool isValid() const { return length != 0; } + + quint32 begin() const { return offset; } + quint32 end() const { return offset + length; } + +// attributes + // ### encode + quint32 offset; + quint32 length; + quint32 startLine; + quint32 startColumn; +}; class Visitor; class Node; diff --git a/src/declarative/qml/parser/javascriptengine_p.h b/src/declarative/qml/parser/javascriptengine_p.h index 6aa4a76..966349b 100644 --- a/src/declarative/qml/parser/javascriptengine_p.h +++ b/src/declarative/qml/parser/javascriptengine_p.h @@ -33,6 +33,8 @@ #include #include +#include "javascriptastfwd_p.h" + QT_BEGIN_NAMESPACE namespace JavaScript { @@ -43,14 +45,9 @@ uint qHash(const JavaScript::NameId &id); namespace JavaScript { -class Node; class Lexer; class NodePool; -namespace AST { -class Node; -} // end of namespace AST - namespace Ecma { class RegExp @@ -92,6 +89,28 @@ public: { return _text < other._text; } }; +class DiagnosticMessage +{ +public: + enum Kind { Warning, Error }; + + DiagnosticMessage() + : kind(Error) {} + + DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message) + : kind(kind), loc(loc), message(message) {} + + bool isWarning() const + { return kind == Warning; } + + bool isError() const + { return kind == Error; } + + Kind kind; + AST::SourceLocation loc; + QString message; +}; + class Engine { Lexer *_lexer; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index deb6176..6980cc8 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -62,6 +62,8 @@ #include "javascriptgrammar_p.h" #include "javascriptast_p.h" +#include "javascriptengine_p.h" + #include QT_BEGIN_NAMESPACE @@ -118,26 +120,6 @@ public: AST::UiQualifiedId *UiQualifiedId; }; - struct DiagnosticMessage { - enum Kind { Warning, Error }; - - DiagnosticMessage() - : kind(Error) {} - - DiagnosticMessage(Kind kind, const AST::SourceLocation &loc, const QString &message) - : kind(kind), loc(loc), message(message) {} - - bool isWarning() const - { return kind == Warning; } - - bool isError() const - { return kind == Error; } - - Kind kind; - AST::SourceLocation loc; - QString message; - }; - public: Parser(); ~Parser(); diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 6f29d17..10518d7 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -645,7 +645,7 @@ bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url) if (! parser.parse(&engine) || !_errors.isEmpty()) { // Extract errors from the parser - foreach (const Parser::DiagnosticMessage &m, parser.diagnosticMessages()) { + foreach (const DiagnosticMessage &m, parser.diagnosticMessages()) { if (m.isWarning()) continue; -- cgit v0.12 From e3ea232cdb9116914df533b423f25ffd7384a78b Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 14 May 2009 12:29:45 +0200 Subject: Some (internal) API cleanup. --- src/declarative/qml/parser/javascript.g | 10 ++-- src/declarative/qml/parser/javascriptengine_p.cpp | 1 + src/declarative/qml/parser/javascriptlexer.cpp | 64 +++++++++++------------ src/declarative/qml/parser/javascriptparser.cpp | 5 +- src/declarative/qml/parser/javascriptparser_p.h | 5 +- src/declarative/qml/qmlscriptparser.cpp | 7 ++- 6 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 53db3d9..14ab6b3 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -266,10 +266,10 @@ public: }; public: - Parser(); + Parser(Engine *engine); ~Parser(); - bool parse(Engine *driver); + bool parse(); AST::UiProgram *ast() { return program; } @@ -306,6 +306,7 @@ protected: { return location_stack [tos + index - 1]; } protected: + Engine *driver; int tos; int stack_size; Value *sym_stack; @@ -373,7 +374,8 @@ inline static bool automatic(Engine *driver, int token) } -Parser::Parser(): +Parser::Parser(Engine *engine): + driver(engine), tos(0), stack_size(0), sym_stack(0), @@ -403,7 +405,7 @@ static inline AST::SourceLocation location(Lexer *lexer) return loc; } -bool Parser::parse(Engine *driver) +bool Parser::parse() { Lexer *lexer = driver->lexer(); bool hadErrors = false; diff --git a/src/declarative/qml/parser/javascriptengine_p.cpp b/src/declarative/qml/parser/javascriptengine_p.cpp index 679202c..5debfd3 100644 --- a/src/declarative/qml/parser/javascriptengine_p.cpp +++ b/src/declarative/qml/parser/javascriptengine_p.cpp @@ -72,6 +72,7 @@ QString Ecma::RegExp::flagsToString(int flags) NodePool::NodePool(const QString &fileName, Engine *engine) : m_fileName(fileName), m_engine(engine) { + m_engine->setNodePool(this); } NodePool::~NodePool() diff --git a/src/declarative/qml/parser/javascriptlexer.cpp b/src/declarative/qml/parser/javascriptlexer.cpp index a0081c7..7455b87 100644 --- a/src/declarative/qml/parser/javascriptlexer.cpp +++ b/src/declarative/qml/parser/javascriptlexer.cpp @@ -44,13 +44,6 @@ #endif #include "javascriptengine_p.h" - - - - - - - #include "javascriptlexer_p.h" #include "javascriptgrammar_p.h" @@ -76,7 +69,9 @@ namespace JavaScript { extern double integerFromString(const char *buf, int size, int radix); } -JavaScript::Lexer::Lexer(Engine *eng) +using namespace JavaScript; + +Lexer::Lexer(Engine *eng) : driver(eng), yylineno(0), done(false), @@ -101,6 +96,7 @@ JavaScript::Lexer::Lexer(Engine *eng) parenthesesCount(0), prohibitAutomaticSemicolon(false) { + driver->setLexer(this); // allocate space for read buffers buffer8 = new char[size8]; buffer16 = new QChar[size16]; @@ -109,13 +105,13 @@ JavaScript::Lexer::Lexer(Engine *eng) } -JavaScript::Lexer::~Lexer() +Lexer::~Lexer() { delete [] buffer8; delete [] buffer16; } -void JavaScript::Lexer::setCode(const QString &c, int lineno) +void Lexer::setCode(const QString &c, int lineno) { errmsg = QString(); yylineno = lineno; @@ -135,7 +131,7 @@ void JavaScript::Lexer::setCode(const QString &c, int lineno) next3 = (length > 3) ? code[3].unicode() : 0; } -void JavaScript::Lexer::shift(uint p) +void Lexer::shift(uint p) { while (p--) { ++pos; @@ -147,13 +143,13 @@ void JavaScript::Lexer::shift(uint p) } } -void JavaScript::Lexer::setDone(State s) +void Lexer::setDone(State s) { state = s; done = true; } -int JavaScript::Lexer::findReservedWord(const QChar *c, int size) const +int Lexer::findReservedWord(const QChar *c, int size) const { switch (size) { case 2: { @@ -454,7 +450,7 @@ int JavaScript::Lexer::findReservedWord(const QChar *c, int size) const return -1; } -int JavaScript::Lexer::lex() +int Lexer::lex() { int token = 0; state = Start; @@ -772,10 +768,10 @@ int JavaScript::Lexer::lex() if (state == Number) { dval = qstrtod(buffer8, 0, 0); } else if (state == Hex) { // scan hex numbers - dval = JavaScript::integerFromString(buffer8, pos8, 16); + dval = integerFromString(buffer8, pos8, 16); state = Number; } else if (state == Octal) { // scan octal number - dval = JavaScript::integerFromString(buffer8, pos8, 8); + dval = integerFromString(buffer8, pos8, 8); state = Number; } @@ -843,18 +839,18 @@ int JavaScript::Lexer::lex() } } -bool JavaScript::Lexer::isWhiteSpace() const +bool Lexer::isWhiteSpace() const { return (current == ' ' || current == '\t' || current == 0x0b || current == 0x0c); } -bool JavaScript::Lexer::isLineTerminator() const +bool Lexer::isLineTerminator() const { return (current == '\n' || current == '\r'); } -bool JavaScript::Lexer::isIdentLetter(ushort c) +bool Lexer::isIdentLetter(ushort c) { /* TODO: allow other legitimate unicode chars */ return ((c >= 'a' && c <= 'z') @@ -863,24 +859,24 @@ bool JavaScript::Lexer::isIdentLetter(ushort c) || c == '_'); } -bool JavaScript::Lexer::isDecimalDigit(ushort c) +bool Lexer::isDecimalDigit(ushort c) { return (c >= '0' && c <= '9'); } -bool JavaScript::Lexer::isHexDigit(ushort c) const +bool Lexer::isHexDigit(ushort c) const { return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')); } -bool JavaScript::Lexer::isOctalDigit(ushort c) const +bool Lexer::isOctalDigit(ushort c) const { return (c >= '0' && c <= '7'); } -int JavaScript::Lexer::matchPunctuator(ushort c1, ushort c2, +int Lexer::matchPunctuator(ushort c1, ushort c2, ushort c3, ushort c4) { if (c1 == '>' && c2 == '>' && c3 == '>' && c4 == '=') { @@ -987,7 +983,7 @@ int JavaScript::Lexer::matchPunctuator(ushort c1, ushort c2, } } -ushort JavaScript::Lexer::singleEscape(ushort c) const +ushort Lexer::singleEscape(ushort c) const { switch(c) { case 'b': @@ -1013,13 +1009,13 @@ ushort JavaScript::Lexer::singleEscape(ushort c) const } } -ushort JavaScript::Lexer::convertOctal(ushort c1, ushort c2, +ushort Lexer::convertOctal(ushort c1, ushort c2, ushort c3) const { return ((c1 - '0') * 64 + (c2 - '0') * 8 + c3 - '0'); } -unsigned char JavaScript::Lexer::convertHex(ushort c) +unsigned char Lexer::convertHex(ushort c) { if (c >= '0' && c <= '9') return (c - '0'); @@ -1029,19 +1025,19 @@ unsigned char JavaScript::Lexer::convertHex(ushort c) return (c - 'A' + 10); } -unsigned char JavaScript::Lexer::convertHex(ushort c1, ushort c2) +unsigned char Lexer::convertHex(ushort c1, ushort c2) { return ((convertHex(c1) << 4) + convertHex(c2)); } -QChar JavaScript::Lexer::convertUnicode(ushort c1, ushort c2, +QChar Lexer::convertUnicode(ushort c1, ushort c2, ushort c3, ushort c4) { return QChar((convertHex(c3) << 4) + convertHex(c4), (convertHex(c1) << 4) + convertHex(c2)); } -void JavaScript::Lexer::record8(ushort c) +void Lexer::record8(ushort c) { Q_ASSERT(c <= 0xff); @@ -1057,7 +1053,7 @@ void JavaScript::Lexer::record8(ushort c) buffer8[pos8++] = (char) c; } -void JavaScript::Lexer::record16(QChar c) +void Lexer::record16(QChar c) { // enlarge buffer if full if (pos16 >= size16 - 1) { @@ -1071,14 +1067,14 @@ void JavaScript::Lexer::record16(QChar c) buffer16[pos16++] = c; } -void JavaScript::Lexer::recordStartPos() +void Lexer::recordStartPos() { startpos = pos; startlineno = yylineno; startcolumn = yycolumn; } -bool JavaScript::Lexer::scanRegExp(RegExpBodyPrefix prefix) +bool Lexer::scanRegExp(RegExpBodyPrefix prefix) { pos16 = 0; bool lastWasEscape = false; @@ -1110,7 +1106,7 @@ bool JavaScript::Lexer::scanRegExp(RegExpBodyPrefix prefix) flags = 0; while (isIdentLetter(current)) { - int flag = JavaScript::Ecma::RegExp::flagFromChar(current); + int flag = Ecma::RegExp::flagFromChar(current); if (flag == 0) { errmsg = QString::fromLatin1("Invalid regular expression flag '%0'") .arg(QChar(current)); @@ -1124,7 +1120,7 @@ bool JavaScript::Lexer::scanRegExp(RegExpBodyPrefix prefix) return true; } -void JavaScript::Lexer::syncProhibitAutomaticSemicolon() +void Lexer::syncProhibitAutomaticSemicolon() { if (parenthesesState == BalancedParentheses) { // we have seen something like "if (foo)", which means we should diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 3c853cb..49a4181 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -83,7 +83,8 @@ inline static bool automatic(Engine *driver, int token) } -Parser::Parser(): +Parser::Parser(Engine *engine): + driver(engine), tos(0), stack_size(0), sym_stack(0), @@ -113,7 +114,7 @@ static inline AST::SourceLocation location(Lexer *lexer) return loc; } -bool Parser::parse(Engine *driver) +bool Parser::parse() { Lexer *lexer = driver->lexer(); bool hadErrors = false; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index 6980cc8..a9f8593 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -121,10 +121,10 @@ public: }; public: - Parser(); + Parser(Engine *engine); ~Parser(); - bool parse(Engine *driver); + bool parse(); AST::UiProgram *ast() { return program; } @@ -161,6 +161,7 @@ protected: { return location_stack [tos + index - 1]; } protected: + Engine *driver; int tos; int stack_size; Value *sym_stack; diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 10518d7..9d6b018 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -632,17 +632,16 @@ bool QmlScriptParser::parse(const QByteArray &data, const QUrl &url) QTextStream stream(data, QIODevice::ReadOnly); const QString code = stream.readAll(); - Parser parser; Engine engine; NodePool nodePool(fileName, &engine); - engine.setNodePool(&nodePool); Lexer lexer(&engine); lexer.setCode(code, /*line = */ 1); - engine.setLexer(&lexer); - if (! parser.parse(&engine) || !_errors.isEmpty()) { + Parser parser(&engine); + + if (! parser.parse() || !_errors.isEmpty()) { // Extract errors from the parser foreach (const DiagnosticMessage &m, parser.diagnosticMessages()) { -- cgit v0.12 From c041a09b0243d7b2dfbb02bafec6ea29520ef578 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 14 May 2009 14:14:22 +0200 Subject: There's no need to record the current AST in the QML/JS engine. --- src/declarative/qml/parser/javascriptengine_p.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/declarative/qml/parser/javascriptengine_p.h b/src/declarative/qml/parser/javascriptengine_p.h index 966349b..933487f 100644 --- a/src/declarative/qml/parser/javascriptengine_p.h +++ b/src/declarative/qml/parser/javascriptengine_p.h @@ -115,12 +115,11 @@ class Engine { Lexer *_lexer; NodePool *_nodePool; - AST::Node *_ast; QSet _literals; public: Engine() - : _lexer(0), _nodePool(0), _ast(0) + : _lexer(0), _nodePool(0) { } QSet literals() const @@ -143,16 +142,6 @@ public: void setNodePool(NodePool *nodePool) { _nodePool = nodePool; } - - AST::Node *ast() const - { return _ast; } - - AST::Node *changeAbstractSyntaxTree(AST::Node *node) - { - AST::Node *previousAST = _ast; - _ast = node; - return previousAST; - } }; } // end of namespace JavaScript -- cgit v0.12 From ce4e9004d23f4cb5bb03292436db81934c85921f Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 14 May 2009 14:25:27 +0200 Subject: Introduced UiStatement in the QML grammar. UiStatement is a small subset of the JavaScript statements. We don't really want our users to use control flow statements in the left hand side of a binding (e.g. Item { x: return 42 }). --- src/declarative/qml/parser/javascript.g | 13 +- src/declarative/qml/parser/javascriptgrammar.cpp | 1194 +++++++++++----------- src/declarative/qml/parser/javascriptgrammar_p.h | 14 +- src/declarative/qml/parser/javascriptparser.cpp | 406 ++++---- src/declarative/qml/parser/javascriptparser_p.h | 4 +- 5 files changed, 827 insertions(+), 804 deletions(-) diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 14ab6b3..af4fb74 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -624,9 +624,16 @@ case $rule_number: { } break; ./ -UiObjectMember: UiQualifiedId T_COLON UiMultilineStringStatement ; -/. case $rule_number: ./ -UiObjectMember: UiQualifiedId T_COLON Statement ; + +UiStatement: Block ; +UiStatement: EmptyStatement ; +UiStatement: ExpressionStatement ; +UiStatement: DebuggerStatement ; +UiStatement: UiMultilineStringStatement ; +UiStatement: IfStatement ; --- ### do we really want if statement in a binding? + + +UiObjectMember: UiQualifiedId T_COLON UiStatement ; /. case $rule_number: { AST::UiScriptBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index abe3f1c..2d50da8 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -57,360 +57,330 @@ const char *const JavaScriptGrammar::spell [] = { const int JavaScriptGrammar::lhs [] = { 91, 92, 92, 95, 95, 96, 96, 94, 93, 98, 98, 100, 100, 101, 101, 99, 97, 99, 99, 103, - 104, 104, 99, 99, 106, 106, 106, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, 102, 102, - 110, 110, 110, 102, 102, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 113, 113, 117, 117, 112, 112, 115, 115, 118, 118, - 118, 118, 118, 118, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 120, 120, 121, 121, 121, - 121, 121, 124, 124, 125, 125, 125, 125, 123, 123, - 126, 126, 127, 127, 128, 128, 128, 129, 129, 129, - 129, 129, 129, 129, 129, 129, 129, 130, 130, 130, - 130, 131, 131, 131, 132, 132, 132, 132, 133, 133, - 133, 133, 133, 133, 133, 134, 134, 134, 134, 134, - 134, 135, 135, 135, 135, 135, 136, 136, 136, 136, - 136, 137, 137, 138, 138, 139, 139, 140, 140, 141, - 141, 142, 142, 143, 143, 144, 144, 145, 145, 146, - 146, 147, 147, 148, 148, 116, 116, 149, 149, 150, - 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, - 150, 107, 107, 151, 151, 152, 152, 153, 153, 105, - 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, - 105, 105, 105, 105, 154, 169, 169, 168, 168, 109, - 109, 170, 170, 171, 171, 173, 173, 172, 174, 177, - 175, 175, 178, 176, 176, 155, 156, 156, 157, 157, - 158, 158, 158, 158, 158, 158, 158, 159, 159, 159, - 159, 160, 160, 160, 160, 161, 161, 162, 164, 179, - 179, 182, 182, 180, 180, 183, 181, 163, 163, 163, - 165, 165, 166, 166, 166, 184, 185, 167, 167, 108, - 122, 189, 189, 186, 186, 187, 187, 190, 191, 191, - 192, 192, 188, 188, 114, 114, 193}; + 104, 104, 105, 105, 105, 105, 105, 105, 99, 111, + 111, 111, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 102, 102, 115, 115, 115, 102, 102, + 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, + 116, 116, 116, 116, 116, 118, 118, 122, 122, 117, + 117, 120, 120, 123, 123, 123, 123, 123, 123, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 125, 125, 126, 126, 126, 126, 126, 129, 129, 130, + 130, 130, 130, 128, 128, 131, 131, 132, 132, 133, + 133, 133, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 135, 135, 135, 135, 136, 136, 136, 137, + 137, 137, 137, 138, 138, 138, 138, 138, 138, 138, + 139, 139, 139, 139, 139, 139, 140, 140, 140, 140, + 140, 141, 141, 141, 141, 141, 142, 142, 143, 143, + 144, 144, 145, 145, 146, 146, 147, 147, 148, 148, + 149, 149, 150, 150, 151, 151, 152, 152, 153, 153, + 121, 121, 154, 154, 155, 155, 155, 155, 155, 155, + 155, 155, 155, 155, 155, 155, 112, 112, 156, 156, + 157, 157, 158, 158, 159, 159, 159, 159, 159, 159, + 159, 159, 159, 159, 159, 159, 159, 159, 159, 106, + 170, 170, 169, 169, 114, 114, 171, 171, 172, 172, + 174, 174, 173, 175, 178, 176, 176, 179, 177, 177, + 107, 108, 108, 110, 110, 160, 160, 160, 160, 160, + 160, 160, 161, 161, 161, 161, 162, 162, 162, 162, + 163, 163, 164, 166, 180, 180, 183, 183, 181, 181, + 184, 182, 165, 165, 165, 167, 167, 168, 168, 168, + 185, 186, 109, 109, 113, 127, 190, 190, 187, 187, + 188, 188, 191, 192, 192, 193, 193, 189, 189, 119, + 119, 194}; const int JavaScriptGrammar:: rhs[] = { 2, 1, 1, 1, 2, 3, 3, 0, 1, 1, 2, 1, 3, 2, 3, 4, 2, 1, 5, 1, - 2, 2, 3, 3, 1, 1, 1, 2, 4, 4, - 5, 5, 6, 6, 7, 7, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 3, 5, 3, 4, 3, - 2, 4, 1, 2, 0, 1, 3, 5, 1, 1, + 2, 2, 1, 1, 1, 1, 1, 1, 3, 1, + 1, 1, 2, 4, 4, 5, 5, 6, 6, 7, + 7, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 3, 5, 3, 4, 3, 2, 4, 1, 2, 0, + 1, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, - 3, 5, 1, 2, 4, 4, 4, 3, 0, 1, - 1, 3, 1, 1, 1, 2, 2, 1, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 1, 3, 3, - 3, 1, 3, 3, 1, 3, 3, 3, 1, 3, - 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, - 3, 1, 3, 3, 3, 3, 1, 3, 3, 3, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 5, 1, 5, 1, 3, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 0, 1, 1, 3, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 2, 0, 1, 3, - 3, 1, 1, 1, 3, 1, 3, 2, 2, 2, - 0, 1, 2, 0, 1, 1, 2, 2, 7, 5, - 7, 7, 5, 9, 10, 7, 8, 2, 2, 3, - 3, 2, 2, 3, 3, 3, 3, 5, 5, 3, - 5, 1, 2, 0, 1, 4, 3, 3, 3, 3, - 3, 3, 3, 3, 4, 5, 2, 2, 2, 8, - 8, 1, 3, 0, 1, 0, 1, 1, 1, 2, - 1, 1, 0, 1, 0, 1, 2}; + 1, 1, 1, 1, 4, 3, 5, 1, 2, 4, + 4, 4, 3, 0, 1, 1, 3, 1, 1, 1, + 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 1, 3, 3, 3, 1, 3, 3, 1, + 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, + 1, 3, 3, 3, 3, 3, 1, 3, 3, 3, + 3, 1, 3, 3, 3, 3, 1, 3, 1, 3, + 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, + 1, 3, 1, 3, 1, 3, 1, 5, 1, 5, + 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 0, 1, + 1, 3, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 1, 2, 0, 1, 3, 3, 1, 1, 1, 3, + 1, 3, 2, 2, 2, 0, 1, 2, 0, 1, + 1, 2, 2, 7, 5, 7, 7, 5, 9, 10, + 7, 8, 2, 2, 3, 3, 2, 2, 3, 3, + 3, 3, 5, 5, 3, 5, 1, 2, 0, 1, + 4, 3, 3, 3, 3, 3, 3, 3, 3, 4, + 5, 2, 2, 2, 8, 8, 1, 3, 0, 1, + 0, 1, 1, 1, 2, 1, 1, 0, 1, 0, + 1, 2}; const int JavaScriptGrammar::action_default [] = { 8, 2, 0, 4, 3, 0, 0, 0, 6, 7, - 5, 0, 9, 1, 0, 17, 37, 44, 242, 0, - 0, 41, 42, 14, 39, 40, 43, 243, 18, 10, - 0, 0, 0, 38, 0, 27, 26, 25, 0, 0, - 31, 0, 32, 145, 212, 176, 184, 180, 124, 196, - 172, 0, 109, 47, 125, 188, 192, 113, 142, 123, - 128, 108, 162, 149, 0, 53, 54, 50, 313, 41, - 315, 65, 0, 0, 0, 0, 0, 48, 51, 0, - 0, 42, 43, 52, 46, 0, 49, 0, 0, 138, - 0, 0, 125, 144, 127, 126, 0, 0, 0, 140, - 141, 139, 143, 0, 173, 0, 0, 0, 0, 163, - 0, 0, 0, 0, 0, 0, 153, 0, 0, 0, - 147, 148, 146, 151, 155, 154, 152, 150, 165, 164, - 166, 0, 181, 0, 177, 0, 0, 119, 106, 118, - 107, 75, 76, 77, 102, 78, 103, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 104, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 105, 0, 0, 117, 213, 120, 0, 121, 0, - 122, 116, 35, 36, 0, 209, 202, 200, 207, 208, - 206, 205, 211, 204, 203, 201, 210, 197, 0, 185, - 0, 0, 189, 0, 0, 193, 0, 0, 119, 111, - 0, 110, 0, 115, 129, 0, 314, 304, 305, 0, - 302, 0, 303, 0, 306, 220, 227, 226, 234, 222, - 0, 223, 307, 0, 312, 224, 225, 230, 228, 309, - 308, 311, 231, 0, 0, 0, 0, 0, 313, 41, - 0, 315, 42, 214, 256, 43, 0, 0, 0, 0, - 0, 232, 233, 221, 229, 257, 258, 301, 310, 0, - 272, 273, 274, 275, 0, 268, 269, 270, 271, 298, - 299, 0, 0, 0, 0, 0, 261, 262, 218, 216, - 178, 186, 182, 198, 174, 219, 0, 125, 190, 194, - 167, 156, 0, 0, 175, 0, 0, 0, 0, 168, - 0, 0, 0, 0, 0, 160, 158, 161, 159, 157, - 170, 169, 171, 0, 183, 0, 179, 0, 217, 125, - 0, 199, 214, 215, 0, 214, 0, 0, 264, 0, - 0, 0, 266, 0, 187, 0, 0, 191, 0, 0, - 195, 254, 0, 246, 255, 249, 0, 253, 0, 214, - 247, 0, 214, 0, 0, 265, 0, 0, 0, 267, - 314, 304, 0, 0, 306, 0, 300, 0, 290, 0, - 0, 0, 260, 0, 259, 0, 316, 0, 74, 236, - 239, 0, 75, 242, 78, 103, 80, 81, 50, 85, - 86, 41, 87, 90, 48, 51, 42, 214, 43, 52, - 93, 46, 95, 49, 97, 98, 243, 100, 101, 105, - 0, 67, 0, 0, 69, 73, 71, 59, 70, 72, - 0, 68, 58, 237, 235, 113, 114, 119, 0, 112, - 0, 289, 0, 276, 277, 0, 288, 0, 0, 0, - 279, 284, 282, 285, 0, 0, 283, 284, 0, 280, - 0, 281, 238, 287, 0, 238, 286, 0, 291, 292, - 0, 238, 293, 294, 0, 0, 295, 0, 0, 0, - 296, 297, 131, 130, 0, 0, 0, 263, 0, 0, - 0, 278, 0, 66, 0, 63, 65, 56, 0, 62, - 57, 64, 61, 55, 0, 60, 135, 133, 137, 134, - 132, 136, 0, 0, 0, 29, 0, 30, 0, 33, - 34, 28, 15, 11, 0, 0, 24, 41, 65, 20, - 0, 23, 16, 0, 12, 0, 19, 13, 21, 22, - 45, 251, 244, 0, 252, 248, 0, 250, 240, 0, - 241, 245, 317}; + 5, 0, 9, 1, 0, 17, 42, 49, 247, 0, + 0, 46, 47, 14, 44, 45, 48, 248, 18, 10, + 0, 0, 0, 43, 0, 32, 31, 30, 0, 0, + 36, 0, 37, 150, 217, 181, 189, 185, 129, 201, + 177, 0, 114, 52, 130, 193, 197, 118, 147, 128, + 133, 113, 167, 154, 0, 58, 59, 55, 318, 46, + 320, 70, 0, 0, 0, 0, 0, 53, 56, 0, + 0, 47, 48, 57, 51, 0, 54, 0, 0, 143, + 0, 0, 130, 149, 132, 131, 0, 0, 0, 145, + 146, 144, 148, 0, 178, 0, 0, 0, 0, 168, + 0, 0, 0, 0, 0, 0, 158, 0, 0, 0, + 152, 153, 151, 156, 160, 159, 157, 155, 170, 169, + 171, 0, 186, 0, 182, 0, 0, 124, 111, 123, + 112, 80, 81, 82, 107, 83, 108, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 109, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 110, 0, 0, 122, 218, 125, 0, 126, 0, + 127, 121, 40, 41, 0, 214, 207, 205, 212, 213, + 211, 210, 216, 209, 208, 206, 215, 202, 0, 190, + 0, 0, 194, 0, 0, 198, 0, 0, 124, 116, + 0, 115, 0, 120, 134, 0, 319, 309, 310, 0, + 307, 0, 308, 0, 311, 225, 232, 231, 239, 227, + 0, 228, 312, 0, 317, 229, 230, 235, 233, 314, + 313, 316, 236, 0, 0, 0, 0, 0, 318, 46, + 0, 320, 47, 219, 261, 48, 0, 0, 0, 0, + 0, 237, 238, 226, 234, 262, 263, 306, 315, 0, + 277, 278, 279, 280, 0, 273, 274, 275, 276, 303, + 304, 0, 0, 0, 0, 0, 266, 267, 223, 221, + 183, 191, 187, 203, 179, 224, 0, 130, 195, 199, + 172, 161, 0, 0, 180, 0, 0, 0, 0, 173, + 0, 0, 0, 0, 0, 165, 163, 166, 164, 162, + 175, 174, 176, 0, 188, 0, 184, 0, 222, 130, + 0, 204, 219, 220, 0, 219, 0, 0, 269, 0, + 0, 0, 271, 0, 192, 0, 0, 196, 0, 0, + 200, 259, 0, 251, 260, 254, 0, 258, 0, 219, + 252, 0, 219, 0, 0, 270, 0, 0, 0, 272, + 319, 309, 0, 0, 311, 0, 305, 0, 295, 0, + 0, 0, 265, 0, 264, 0, 321, 0, 79, 241, + 244, 0, 80, 247, 83, 108, 85, 86, 55, 90, + 91, 46, 92, 95, 53, 56, 47, 219, 48, 57, + 98, 51, 100, 54, 102, 103, 248, 105, 106, 110, + 0, 72, 0, 0, 74, 78, 76, 64, 75, 77, + 0, 73, 63, 242, 240, 118, 119, 124, 0, 117, + 0, 294, 0, 281, 282, 0, 293, 0, 0, 0, + 284, 289, 287, 290, 0, 0, 288, 289, 0, 285, + 0, 286, 243, 292, 0, 243, 291, 0, 296, 297, + 0, 243, 298, 299, 0, 0, 300, 0, 0, 0, + 301, 302, 136, 135, 0, 0, 0, 268, 0, 0, + 0, 283, 0, 71, 0, 68, 70, 61, 0, 67, + 62, 69, 66, 60, 0, 65, 140, 138, 142, 139, + 137, 141, 0, 0, 0, 34, 0, 35, 0, 38, + 39, 33, 15, 11, 0, 0, 23, 26, 24, 25, + 28, 46, 70, 20, 0, 27, 29, 16, 0, 12, + 0, 19, 13, 21, 22, 50, 256, 249, 0, 257, + 253, 0, 255, 245, 0, 246, 250, 322}; const int JavaScriptGrammar::goto_default [] = { - 6, 5, 13, 1, 4, 3, 28, 30, 29, 533, - 15, 31, 530, 531, 389, 513, 230, 234, 263, 53, - 61, 494, 492, 387, 386, 44, 493, 385, 388, 139, - 57, 52, 177, 59, 48, 176, 54, 60, 89, 58, - 43, 63, 62, 300, 50, 294, 45, 290, 47, 292, - 46, 291, 55, 298, 56, 299, 49, 293, 289, 330, - 442, 295, 296, 225, 229, 231, 235, 236, 227, 226, - 238, 264, 237, 242, 261, 262, 228, 391, 390, 32, - 543, 542, 352, 353, 545, 355, 544, 354, 450, 454, - 457, 453, 452, 472, 473, 219, 233, 215, 218, 232, - 240, 239, 0}; + 6, 5, 13, 1, 4, 3, 28, 30, 29, 538, + 15, 31, 534, 535, 536, 225, 229, 231, 228, 235, + 513, 230, 234, 263, 53, 61, 494, 492, 387, 386, + 44, 493, 385, 388, 139, 57, 52, 177, 59, 48, + 176, 54, 60, 89, 58, 43, 63, 62, 300, 50, + 294, 45, 290, 47, 292, 46, 291, 55, 298, 56, + 299, 49, 293, 289, 330, 442, 295, 296, 389, 236, + 227, 226, 238, 264, 237, 242, 261, 262, 391, 390, + 32, 548, 547, 352, 353, 550, 355, 549, 354, 450, + 454, 457, 453, 452, 472, 473, 219, 233, 215, 218, + 232, 240, 239, 0}; const int JavaScriptGrammar::action_index [] = { - -23, -91, 10, -91, -19, 50, 77, 56, -91, -91, - -91, 67, -91, -91, 383, -91, -91, -91, -91, -4, - 213, 20, 186, -91, -91, -91, -18, -91, -91, -91, - 370, 129, 203, -91, 204, -91, -91, -91, -17, 192, - -91, 693, -91, 87, -91, 42, 9, -20, 191, -91, - 310, 140, -91, -91, 534, 17, 114, 160, 125, -91, - -91, -91, 344, 162, 693, -91, -91, -91, 157, -91, - 1191, 34, 693, 693, 693, 613, 693, -91, -91, 693, - 693, -91, -91, -91, -91, 693, -91, 693, 693, -91, - 693, 693, 119, 227, -91, -91, 693, 693, 693, -91, - -91, -91, 193, 693, 310, 693, 693, 693, 693, 446, - 693, 693, 693, 693, 693, 693, 237, 693, 693, 693, - 88, 106, 107, 237, 237, 166, 237, 237, 354, 372, - 334, 693, -11, 693, 19, 1104, 693, 693, -91, -91, + 60, -91, -21, -91, -47, 22, 43, 76, -91, -91, + -91, 20, -91, -91, 394, -91, -91, -91, -91, -31, + 199, 6, 185, -91, -91, -91, 11, -91, -91, -91, + 381, 157, 180, -91, 182, -91, -91, -91, 19, 183, + -91, 697, -91, 66, -91, 54, 32, -19, 174, -91, + 257, 211, -91, -91, 538, 63, 69, 248, 170, -91, + -91, -91, 345, 154, 697, -91, -91, -91, 158, -91, + 1275, 55, 697, 697, 697, 617, 697, -91, -91, 697, + 697, -91, -91, -91, -91, 697, -91, 697, 697, -91, + 697, 697, 100, 217, -91, -91, 697, 697, 697, -91, + -91, -91, 131, 697, 267, 697, 697, 697, 697, 355, + 697, 697, 697, 697, 697, 697, 188, 697, 697, 697, + 101, 118, 105, 314, 224, 210, 205, 153, 450, 365, + 450, 697, -8, 697, 172, 1188, 697, 697, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, -91, - -91, -91, 98, 693, -91, -91, 0, -43, -91, 693, - -91, -91, -91, -91, 693, -91, -91, -91, -91, -91, - -91, -91, -91, -91, -91, -91, -91, -91, 693, 6, - 693, 693, -2, 82, 693, -91, 1104, 693, 693, -91, - 96, -91, 8, -91, -91, 61, -91, 147, 80, 33, - -91, 154, -91, 63, 1452, -91, -91, -91, -91, -91, - 169, -91, -91, 23, -91, -91, -91, -91, -91, -91, - 1452, -91, -91, 285, 287, 68, 1365, 55, 112, 79, - 46, 1626, 66, 693, -91, 65, 47, 693, 52, 58, - 59, -91, -91, -91, -91, -91, -91, -91, -91, 64, - -91, -91, -91, -91, 73, -91, -91, -91, -91, -91, - -91, -5, 45, 693, 137, 81, -91, -91, 1017, -91, - 69, 28, 14, -91, 240, 76, 53, 476, 171, 120, - 308, 237, 180, 693, 264, 693, 693, 693, 693, 298, - 693, 693, 693, 693, 693, 230, 237, 237, 237, 237, - 288, 268, 378, 693, -68, 693, 12, 693, -91, 445, - 693, -91, 693, 7, -47, 693, -44, 1365, -91, 693, - 100, 1365, -91, 693, -25, 693, 693, 22, 15, 693, - -91, -8, 108, -13, -91, -91, 693, -91, 178, 693, - -91, -60, 693, -58, 1365, -91, 693, 99, 1365, -91, - -33, 199, -53, -27, 1452, -26, -91, 1365, -91, 693, - 95, 1365, 32, 1365, -91, 43, 41, 4, -91, -91, - 1365, 5, 232, 54, 275, 70, 693, 1365, 49, 27, - 252, 48, 30, 613, 40, 39, -91, 777, -91, 25, - -1, 26, 693, 24, -3, 693, 21, 693, 1, 2, - 693, -91, 1278, 37, -91, -91, -91, -91, -91, -91, - 693, -91, -91, -91, -91, 156, -91, 693, -21, -91, - 1365, -91, 60, -91, -91, 1365, -91, 693, 102, 3, - -91, 29, -91, 35, 101, 693, -91, 36, 38, -91, - -30, -91, 1365, -91, 94, 1365, -91, 176, -91, -91, - 143, 1365, 44, -91, 16, -6, -91, 207, -9, -29, - -91, -91, -91, -91, 693, 90, 1365, -91, 693, 91, - 1365, -91, 111, 13, 857, -91, 18, -91, 937, -91, - -91, -91, -91, -91, 105, -91, -91, -91, -91, -91, - -91, -91, -33, -24, 215, -91, 693, -91, 187, -91, - -91, -91, -91, -91, 1539, 174, -91, 133, 104, -91, - 62, -91, -91, 97, -91, 51, -91, -91, -91, -91, - -91, 57, -91, 173, -91, -91, 693, -91, -91, 151, - -91, -91, -91, + -91, -91, 103, 697, -91, -91, 42, -22, -91, 697, + -91, -91, -91, -91, 697, -91, -91, -91, -91, -91, + -91, -91, -91, -91, -91, -91, -91, -91, 697, 25, + 697, 697, -2, 82, 697, -91, 1188, 697, 697, -91, + 119, -91, 44, -91, -91, -9, -91, 132, 73, 50, + -91, 134, -91, 62, 1449, -91, -91, -91, -91, -91, + 122, -91, -91, 37, -91, -91, -91, -91, -91, -91, + 1449, -91, -91, 298, 300, 109, 1536, 41, 194, 75, + 47, 1623, 68, 697, -91, 65, 49, 697, 45, 40, + 38, -91, -91, -91, -91, -91, -91, -91, -91, 72, + -91, -91, -91, -91, 115, -91, -91, -91, -91, -91, + -91, 56, 58, 697, 95, 67, -91, -91, 1021, -91, + 86, 59, -12, -91, 259, 61, 39, 467, 77, 70, + 382, 314, 223, 697, 276, 697, 697, 697, 697, 274, + 697, 697, 697, 697, 697, 314, 314, 314, 168, 314, + 382, 291, 301, 697, -20, 697, 17, 697, -91, 538, + 697, -91, 697, 12, -37, 697, -39, 1536, -91, 697, + 106, 1536, -91, 697, -25, 697, 697, 15, 8, 697, + -91, 2, 113, -15, -91, -91, 697, -91, 225, 697, + -91, -36, 697, -38, 1536, -91, 697, 80, 1536, -91, + -7, 202, -23, 3, 1449, -42, -91, 1536, -91, 697, + 97, 1536, 14, 1536, -91, 21, 18, 36, -91, -91, + 1536, -24, 288, 7, 281, 74, 697, 1536, -5, -32, + 264, -4, -26, 617, 0, -1, -91, 781, -91, 5, + -27, 1, 697, 4, -28, 697, -6, 697, -3, 9, + 697, -91, 1362, 53, -91, -91, -91, -91, -91, -91, + 697, -91, -91, -91, -91, 171, -91, 697, 24, -91, + 1536, -91, 64, -91, -91, 1536, -91, 697, 91, 28, + -91, 51, -91, 52, 99, 697, -91, 27, 57, -91, + 31, -91, 1536, -91, 94, 1536, -91, 226, -91, -91, + 102, 1536, 48, -91, 35, 34, -91, 175, 33, 29, + -91, -91, -91, -91, 697, 90, 1536, -91, 697, 89, + 1536, -91, 88, 46, 941, -91, 26, -91, 861, -91, + -91, -91, -91, -91, 107, -91, -91, -91, -91, -91, + -91, -91, 10, 13, 155, -91, 697, -91, 177, -91, + -91, -91, -91, -91, 1101, 191, -91, -91, -91, -91, + -91, 16, 110, -91, 85, -91, -91, -91, 104, -91, + 23, -91, -91, -91, -91, -91, 30, -91, 160, -91, + -91, 697, -91, -91, 136, -91, -91, -91, - -103, -103, -103, -103, 15, 16, -103, -103, -103, -103, - -103, -103, -103, -103, 208, -103, -103, -103, -103, -103, - -1, -103, -103, -103, -103, -103, -103, -103, -103, -103, - 237, -103, 26, -103, 31, -103, -103, -103, -103, -103, - -103, 28, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -46, -103, -103, -103, -103, -103, - -103, -103, -103, -103, 98, -103, -103, -103, 7, -103, - -103, -103, -10, 118, 111, 67, 112, -103, -103, 119, - 123, -103, -103, -103, -103, 124, -103, 115, 97, -103, - 32, 106, -103, -103, -103, -103, 128, 171, 101, -103, - -103, -103, -103, 156, -103, 157, 159, 81, 131, -103, - 127, 136, 145, 139, 102, 91, -103, 59, 50, 72, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, 70, -103, 80, -103, 85, 61, 51, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, 54, -103, -103, -103, -103, -103, -24, - -103, -103, -103, -103, -23, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, 134, -103, - 138, 17, -103, -103, 23, -103, 255, -4, 73, -103, - -103, -103, -103, -103, -103, -103, -103, 11, -103, -103, - -103, 8, -103, -103, 9, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - 77, -103, -103, 10, 2, -103, 5, -103, -3, -103, - -103, -103, -103, 19, -103, -103, -103, 27, -31, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -5, -103, -103, -103, -103, 105, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, 34, 205, -103, 193, 169, 181, 201, -103, - 147, 66, 78, 79, 89, -103, -103, -103, -103, -103, - -103, -103, -103, 202, -103, 192, -103, 212, -103, -103, - 182, -103, 68, -103, -103, 62, -103, 56, -103, 33, - -103, 55, -103, 170, -103, 161, 162, -103, -103, 172, - -103, -103, -103, -103, -103, -103, 211, -103, 69, 71, - -103, -103, 64, -103, 60, -103, 41, -103, 42, -103, - -103, 74, -103, -103, 75, -103, -103, 38, -103, 35, - -103, 36, -103, 44, -103, -103, -103, -103, -103, -103, - 52, -103, 45, -103, 43, -103, 65, 46, -103, -103, - 40, -103, -103, 146, -103, -103, -103, 49, -103, -103, - -103, -103, 47, -103, -22, 149, -103, 153, -103, -103, - 30, -103, 48, -103, -103, -103, -103, -103, -103, -103, - 29, -103, -103, -103, -103, -103, -103, 133, -103, -103, - 53, -103, -103, -103, -103, 58, -103, 57, -103, -103, - -103, -103, -103, -56, -103, -6, -103, -82, -103, -103, - -103, -103, -77, -103, -103, -68, -103, -103, -103, -103, - -103, -103, -90, -103, -103, -58, -103, -11, -103, -60, - -103, -103, -103, -103, 21, -103, 25, -103, 22, -103, - 20, -103, -103, -103, 6, -103, 12, -103, 3, -103, - -103, -103, -103, -103, -103, -103, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, 24, -103, -103, -103, - -103, -103, -103, -103, 1, -2, -103, 4, 104, -103, - -103, -103, -103, -103, -103, 18, -103, -103, -103, -103, - -103, -103, -103, -103, -103, -103, 0, -103, -103, 63, - -103, -103, -103}; + -104, -104, -104, -104, 98, 6, -104, -104, -104, -104, + -104, -104, -104, -104, 212, -104, -104, -104, -104, -104, + 0, -104, -104, -104, -104, -104, -104, -104, -104, -104, + 320, -104, 3, -104, -3, -104, -104, -104, -104, -104, + -104, 11, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -43, -104, -104, -104, -104, -104, + -104, -104, -104, -104, 108, -104, -104, -104, -16, -104, + -104, -104, -11, 116, 103, 79, 92, -104, -104, 48, + 143, -104, -104, -104, -104, 112, -104, 99, 93, -104, + 161, 106, -104, -104, -104, -104, 81, 87, 96, -104, + -104, -104, -104, 77, -104, 147, 134, 148, 121, -104, + 124, 132, 136, 130, 75, 44, -104, 43, 35, 53, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, 55, -104, 64, -104, 73, 21, 23, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, 24, -104, -104, -104, -104, -104, 22, + -104, -104, -104, -104, -26, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, 119, -104, + 123, 19, -104, -104, 17, -104, 214, 9, 56, -104, + -104, -104, -104, -104, -104, -104, -104, 1, -104, -104, + -104, -4, -104, -104, -37, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + 52, -104, -104, 12, 10, -104, -35, -104, -2, -104, + -104, -104, -104, 5, -104, -104, -104, 7, 14, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -20, -104, -104, -104, -104, 97, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, 41, 191, -104, 203, 162, 185, 182, -104, + 117, 146, 120, 61, 63, -104, -104, -104, -104, -104, + -104, -104, -104, 170, -104, 168, -104, 176, -104, -104, + 166, -104, 58, -104, -104, 66, -104, 32, -104, 45, + -104, 33, -104, 224, -104, 160, 152, -104, -104, 158, + -104, -104, -104, -104, -104, -104, 150, -104, 88, 54, + -104, -104, 60, -104, 42, -104, 47, -104, 31, -104, + -104, 49, -104, -104, 59, -104, -104, -22, -104, 34, + -104, -27, -104, -28, -104, -104, -104, -104, -104, -104, + -30, -104, 38, -104, 40, -104, 70, -24, -104, -104, + 39, -104, -104, 57, -104, -104, -104, 36, -104, -104, + -104, -104, 37, -104, 28, 126, -104, 142, -104, -104, + 30, -104, 27, -104, -104, -104, -104, -104, -104, -104, + 26, -104, -104, -104, -104, -104, -104, 111, -104, -104, + 4, -104, -104, -104, -104, -7, -104, 46, -104, -104, + -104, -104, -104, -48, -104, -5, -104, -90, -104, -104, + -104, -104, -73, -104, -104, -75, -104, -104, -104, -104, + -104, -104, -84, -104, -104, -6, -104, -18, -104, -1, + -104, -104, -104, -104, -19, -104, -53, -104, 16, -104, + -55, -104, -104, -104, 18, -104, 25, -104, 20, -104, + -104, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -104, -104, -104, -104, -104, 2, -104, -104, -104, + -104, -104, -104, -104, 237, 15, -104, -104, -104, -104, + -104, 8, 13, -104, -104, -104, -104, -104, -104, -104, + 29, -104, -104, -104, -104, -104, -104, -104, -104, -104, + -104, -23, -104, -104, 50, -104, -104, -104}; const int JavaScriptGrammar::action_info [] = { - 198, 362, 364, 371, 471, 514, 374, 373, 179, 356, - 325, 521, 39, 303, 335, 173, 337, 181, 366, 198, - 103, 501, 349, 323, 343, 461, 495, 471, -99, 376, - 471, -96, -72, -94, 455, 447, 451, 484, 488, 439, - 455, 455, 495, 103, 430, 462, -73, -91, 383, 422, - 420, 479, 477, 14, 131, -69, -83, 131, 133, 432, - 434, -102, 34, 288, 475, 2, 379, 133, 213, 2, - 303, 282, 445, 440, 546, 7, 323, 552, 267, 11, - 11, 283, 379, 447, 327, 471, 377, 0, 221, 204, - 0, 288, 325, 223, 484, 488, 224, 217, 173, 173, - 14, 465, 173, 173, 173, 535, 173, 173, 173, 0, - 173, 458, 495, 173, 332, 0, 358, 9, 8, 496, - 0, 444, 443, 539, 538, 273, 272, 90, 90, 280, - 279, 280, 279, 11, 278, 277, 524, 96, 91, 91, - 377, 69, 287, 286, 525, 173, 90, 90, 173, 474, - 486, 490, 211, 536, 174, 381, 459, 91, 91, 368, - 341, 94, 449, 475, 200, 505, 14, 497, 201, 359, - 345, 206, 95, 343, 346, 206, 69, 173, 81, 82, - 69, 549, 97, 69, 173, 0, 69, 117, 98, 118, - 207, 117, 437, 118, 207, 173, 208, 285, 0, 41, - 119, 183, 182, 69, 119, 96, 135, 69, 0, 69, - 0, 0, 0, 81, 82, 35, 0, 81, 82, 0, - 81, 82, 516, 81, 82, 136, 0, 137, 69, 0, - 266, 265, 69, 35, 550, 548, 69, 469, 468, 96, - 81, 82, 69, 0, 81, 82, 81, 82, 520, 519, - 97, 0, 0, 42, 40, 117, 98, 118, 305, 306, - 37, 69, 117, 0, 118, 81, 82, 0, 119, 81, - 82, 36, 0, 81, 82, 119, 517, 515, 37, 81, - 82, 69, 305, 306, 97, 307, 308, 0, -313, 36, - 98, 310, 311, 271, 270, 0, 0, 0, 81, 82, - 312, 0, 0, 313, 69, 314, 0, 0, 0, 307, - 308, 310, 311, 0, 69, 0, 69, 0, 81, 82, - 312, 310, 311, 313, 0, 314, 0, 0, 105, 106, - 312, 310, 311, 313, 0, 314, 276, 275, 0, 0, - 312, 81, 82, 313, 0, 314, 271, 270, 276, 275, - 0, 81, 82, 81, 82, 107, 108, 110, 111, 0, - 0, 0, 0, 0, 0, 112, 113, 110, 111, 114, - 0, 115, 0, 0, 0, 112, 113, 110, 111, 114, - 19, 115, 0, 0, 0, 112, 113, 0, 0, 114, - 0, 115, 20, 19, 0, 110, 111, 0, 0, 21, - 0, 310, 311, 112, 113, 20, 0, 114, 0, 115, - 312, 0, 21, 313, 0, 314, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 522, 0, 0, 0, 25, - 0, 0, 0, 0, 0, 0, 22, 26, 23, 0, - 0, 0, 25, 0, 27, 0, 0, 0, 185, 22, - 26, 0, 0, 18, 0, 24, 0, 27, 186, 0, - 0, 0, 187, 0, 0, 0, 18, 0, 24, 110, - 111, 188, 0, 189, 0, 0, 0, 112, 113, 185, - 0, 114, 0, 115, 190, 0, 191, 94, 0, 186, - 0, 0, 0, 187, 192, 0, 0, 193, 95, 0, - 0, 0, 188, 194, 189, 0, 0, 339, 0, 195, - 0, 0, 0, 0, 0, 190, 0, 191, 94, 0, - 0, 0, 0, 0, 196, 192, 0, 0, 193, 95, - 0, 0, 0, 0, 194, 0, 0, 185, 0, 0, - 195, 0, 0, 0, 0, 0, 0, 186, 0, 0, - 0, 187, 0, 0, 0, 196, 0, 0, 0, 0, - 188, 0, 189, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 190, 0, 191, 94, 0, 0, 0, - 0, 0, 0, 192, 0, 0, 193, 95, 0, 0, - 0, 0, 194, 0, 0, 0, 0, 0, 195, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 196, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 65, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, - 0, 0, 69, 0, 0, 0, 70, 71, 0, 72, - 0, 0, 0, 0, 0, 0, 75, 0, 0, 0, - 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 83, 81, - 82, 0, 84, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 77, 86, 67, 0, 0, 0, 0, - 0, 0, 0, 0, 64, 65, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, - 0, 0, 69, 0, 0, 0, 70, 71, 0, 72, - 0, 0, 0, 73, 0, 74, 75, 76, 0, 0, - 78, 0, 0, 0, 79, 0, 80, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 83, 81, - 82, 0, 84, 0, 85, 0, 87, 0, 88, 0, - 0, 0, 0, 77, 86, 67, 0, 0, 0, 0, - 0, 0, 0, 0, -92, 0, 0, 0, 64, 65, - 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, - 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, - 70, 71, 0, 72, 0, 0, 0, 73, 0, 74, - 75, 76, 0, 0, 78, 0, 0, 0, 79, 0, - 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 83, 81, 82, 0, 84, 0, 85, 0, - 87, 0, 88, 0, 0, 0, 0, 77, 86, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, + 198, -104, -88, -74, 288, 471, -78, -96, -99, 447, + 379, -101, -77, 376, -107, 349, 366, 343, 303, 356, + 173, 337, 364, 323, 335, 362, 422, 217, 420, 371, + 383, 434, 455, 484, 495, 34, 374, 373, 181, 14, + 521, 2, 514, 557, 7, 488, 371, 551, 39, 14, + 179, 11, 11, 14, 501, 103, 455, 455, 325, 133, + 430, 451, 471, 495, 462, 198, 325, 471, 475, 327, + 133, 477, 445, 131, 488, 440, 484, 288, 471, 343, + 131, 221, 377, 379, 439, 447, 461, 303, 173, 204, + 0, 432, 267, 479, 283, 224, 496, 173, 173, 173, + 332, 465, 173, 173, 213, 173, 90, 323, 474, 458, + 223, 173, 540, 0, 173, 173, 0, 91, 495, 200, + 345, 358, 475, 201, 346, 444, 443, 173, 287, 286, + 173, 0, 282, 273, 272, 280, 279, 9, 8, 11, + 368, 90, 94, 96, 497, 90, 544, 543, 2, 490, + 486, 449, 91, 95, 459, 285, 91, 381, 90, 174, + 541, 69, 516, 69, 524, 69, 341, 505, 554, 91, + 280, 279, 525, 103, 359, 211, 278, 277, 117, 117, + 118, 118, 96, 266, 265, 173, 206, 69, 97, 135, + 41, 119, 119, 117, 98, 118, 0, 0, 81, 82, + 81, 82, 81, 82, 69, 207, 119, 437, 136, 69, + 137, 35, 0, 117, 35, 118, 517, 515, 0, 173, + 69, 555, 553, 69, 81, 82, 119, 97, 69, 96, + 117, 69, 118, 98, 173, 117, 0, 118, 520, 519, + 0, 81, 82, 119, 42, 40, 81, 82, 119, 117, + 0, 118, 69, 0, 69, 0, 37, 81, 82, 37, + 81, 82, 119, 206, 0, 81, 82, 36, 81, 82, + 36, 0, 183, 182, 97, 105, 106, 305, 306, 0, + 98, 0, 207, 0, 208, 105, 106, 469, 468, 81, + 82, 81, 82, 69, 305, 306, 0, 310, 311, 0, + -318, 0, 107, 108, 307, 308, 312, 0, 0, 313, + 69, 314, 107, 108, 310, 311, 0, 69, 0, 0, + 0, 307, 308, 312, 310, 311, 313, 69, 314, 69, + 81, 82, 0, 312, 0, 0, 313, 0, 314, 117, + 0, 118, 276, 275, 0, 0, 0, 81, 82, 271, + 270, 0, 119, 0, 81, 82, 0, 0, 0, 271, + 270, 276, 275, 0, 81, 82, 81, 82, 110, 111, + 0, 0, 0, 0, 0, 0, 112, 113, 110, 111, + 114, 0, 115, 0, 0, 0, 112, 113, 110, 111, + 114, 19, 115, 0, 0, 0, 112, 113, 0, 0, + 114, 0, 115, 20, 19, 310, 311, 0, 0, 0, + 21, 0, 0, 0, 312, 0, 20, 313, 0, 314, + 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 522, 0, 0, 0, + 25, 0, 0, 0, 0, 0, 0, 22, 26, 23, + 0, 0, 0, 25, 0, 27, 0, 0, 0, 0, + 22, 26, 0, 0, 18, 0, 24, 0, 27, 0, + 185, 0, 0, 110, 111, 0, 0, 18, 0, 24, + 186, 112, 113, 0, 187, 114, 0, 115, 0, 0, + 0, 0, 0, 188, 0, 189, 0, 0, 339, 0, + 0, 0, 0, 0, 0, 0, 190, 0, 191, 94, + 0, 0, 0, 0, 0, 0, 192, 0, 0, 193, + 95, 0, 0, 0, 0, 194, 0, 0, 0, 0, + 0, 195, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 185, 0, 0, 0, 0, 196, 0, 0, 0, + 0, 186, 0, 0, 0, 187, 0, 0, 0, 0, + 0, 0, 0, 0, 188, 0, 189, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 190, 0, 191, + 94, 0, 0, 0, 0, 0, 0, 192, 0, 0, + 193, 95, 0, 0, 0, 0, 194, 0, 0, 0, + 0, 0, 195, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 196, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, - 70, 71, 0, 72, 0, 0, 0, 73, 0, 74, - 75, 76, 0, 0, 78, 0, 0, 0, 79, 0, - 80, 0, 0, 503, 0, 0, 0, 0, 0, 0, - 0, 0, 83, 81, 82, 0, 84, 0, 85, 0, - 87, 0, 88, 0, 0, 0, 0, 77, 86, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, - 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, - 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, - 70, 71, 0, 72, 0, 0, 0, 73, 0, 74, - 75, 76, 0, 0, 78, 0, 0, 0, 79, 0, - 80, 0, 0, 500, 0, 0, 0, 0, 0, 0, - 0, 0, 83, 81, 82, 0, 84, 0, 85, 0, - 87, 0, 88, 0, 0, 0, 0, 77, 86, 67, + 70, 71, 0, 72, 0, 0, 0, 0, 0, 0, + 75, 0, 0, 0, 78, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 83, 81, 82, 0, 84, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 77, 86, 67, 0, 0, 0, 0, 0, 0, 0, 0, 64, 65, 66, 0, 0, 0, 0, 0, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 69, 0, 0, 0, @@ -418,210 +388,217 @@ const int JavaScriptGrammar::action_info [] = { 75, 76, 0, 0, 78, 0, 0, 0, 79, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 81, 82, 0, 84, 0, 85, 0, - 87, 302, 88, 0, 0, 0, 0, 77, 86, 67, - 0, 0, 0, 0, 0, 0, 0, 0, 141, 142, - 143, 0, 0, 145, 147, 148, 0, 0, 149, 0, - 150, 0, 0, 0, 152, 153, 154, 0, 0, 0, - 0, 0, 0, 69, 155, 156, 157, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 158, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 161, 0, 0, 0, 0, 0, 0, - 81, 82, 162, 163, 164, 0, 166, 167, 168, 169, - 170, 171, 0, 0, 159, 165, 151, 144, 146, 160, - 0, 0, 0, 0, 0, 141, 142, 143, 0, 0, - 145, 147, 148, 0, 0, 149, 0, 150, 0, 0, - 0, 152, 153, 154, 0, 0, 0, 0, 0, 0, - 424, 155, 156, 157, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 158, 0, 0, 0, 425, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 161, 0, 0, 0, 0, 0, 429, 426, 428, 162, - 163, 164, 0, 166, 167, 168, 169, 170, 171, 0, - 0, 159, 165, 151, 144, 146, 160, 0, 0, 0, + 87, 0, 88, 0, 0, 0, 0, 77, 86, 67, + 0, 0, 0, 0, 0, 0, 0, 0, -97, 0, + 0, 0, 64, 65, 66, 0, 0, 0, 0, 0, + 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 70, 71, 0, 72, 0, 0, + 0, 73, 0, 74, 75, 76, 0, 0, 78, 0, + 0, 0, 79, 0, 80, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 83, 81, 82, 0, + 84, 0, 85, 0, 87, 0, 88, 0, 0, 0, + 0, 77, 86, 67, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 65, 66, 0, 0, 0, 0, 0, + 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 70, 71, 0, 72, 0, 0, + 0, 73, 0, 74, 75, 76, 0, 0, 78, 0, + 0, 0, 79, 0, 80, 0, 0, 500, 0, 0, + 0, 0, 0, 0, 0, 0, 83, 81, 82, 0, + 84, 0, 85, 0, 87, 0, 88, 0, 0, 0, + 0, 77, 86, 67, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 65, 66, 0, 0, 0, 0, 0, + 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 70, 71, 0, 72, 0, 0, + 0, 73, 0, 74, 75, 76, 0, 0, 78, 0, + 0, 0, 79, 0, 80, 0, 0, 503, 0, 0, + 0, 0, 0, 0, 0, 0, 83, 81, 82, 0, + 84, 0, 85, 0, 87, 0, 88, 0, 0, 0, + 0, 77, 86, 67, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 65, 66, 0, 0, 0, 0, 0, + 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, + 69, 0, 0, 0, 70, 71, 0, 72, 0, 0, + 0, 73, 0, 74, 75, 76, 0, 0, 78, 0, + 0, 0, 79, 0, 80, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 83, 81, 82, 0, + 84, 0, 85, 0, 87, 302, 88, 0, 0, 0, + 0, 77, 86, 67, 0, 0, 0, 0, 0, 0, + 0, 0, 64, 65, 66, 0, 0, 0, 0, 0, + 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, + 531, 250, 0, 0, 251, 532, 0, 72, 0, 0, + 0, 73, 0, 74, 75, 76, 0, 0, 78, 0, + 0, 0, 79, 0, 80, 0, 0, 0, 0, 0, + 0, 0, 254, 0, 0, 0, 83, 81, 82, 0, + 84, 0, 85, 0, 87, 0, 88, 0, 0, 0, + 0, 77, 86, 67, 0, 245, 0, 533, 0, 0, 0, 0, 141, 142, 143, 0, 0, 145, 147, 148, 0, 0, 149, 0, 150, 0, 0, 0, 152, 153, - 154, 0, 0, 0, 0, 0, 0, 424, 155, 156, + 154, 0, 0, 0, 0, 0, 0, 69, 155, 156, 157, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 158, 0, 0, 0, 425, 0, 0, 0, 0, - 0, 0, 0, 427, 0, 0, 0, 161, 0, 0, - 0, 0, 0, 429, 426, 428, 162, 163, 164, 0, + 0, 158, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 161, 0, 0, + 0, 0, 0, 0, 81, 82, 162, 163, 164, 0, 166, 167, 168, 169, 170, 171, 0, 0, 159, 165, - 151, 144, 146, 160, 0, 0, 0, 0, 0, 243, - 0, 0, 0, 0, 244, 0, 64, 65, 66, 246, - 0, 0, 0, 0, 0, 0, 247, 68, 0, 0, - 0, 0, 0, 0, 249, 250, 0, 0, 251, 71, - 0, 72, 0, 0, 0, 73, 0, 74, 75, 76, - 0, 0, 78, 0, 0, 0, 79, 0, 80, 0, - 0, 0, 0, 0, 253, 0, 254, 0, 0, 0, - 83, 252, 255, 256, 84, 257, 85, 258, 87, 27, - 88, 259, 260, 0, 0, 77, 86, 67, 18, 245, - 0, 0, 0, 0, 0, 0, 243, 0, 0, 0, - 0, 244, 0, 64, 65, 66, 246, 0, 0, 0, - 0, 0, 0, 247, 248, 0, 0, 0, 0, 0, - 0, 249, 250, 0, 0, 251, 71, 0, 72, 0, - 0, 0, 73, 0, 74, 75, 76, 0, 0, 78, - 0, 0, 0, 79, 0, 80, 0, 0, 0, 0, - 0, 253, 0, 254, 0, 0, 0, 83, 252, 255, - 256, 84, 257, 85, 258, 87, 27, 88, 259, 260, - 0, 0, 77, 86, 67, 18, 245, 0, 0, 0, + 151, 144, 146, 160, 0, 0, 0, 0, 0, 141, + 142, 143, 0, 0, 145, 147, 148, 0, 0, 149, + 0, 150, 0, 0, 0, 152, 153, 154, 0, 0, + 0, 0, 0, 0, 424, 155, 156, 157, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 158, 0, + 0, 0, 425, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 161, 0, 0, 0, 0, 0, + 429, 426, 428, 162, 163, 164, 0, 166, 167, 168, + 169, 170, 171, 0, 0, 159, 165, 151, 144, 146, + 160, 0, 0, 0, 0, 0, 141, 142, 143, 0, + 0, 145, 147, 148, 0, 0, 149, 0, 150, 0, + 0, 0, 152, 153, 154, 0, 0, 0, 0, 0, + 0, 424, 155, 156, 157, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 158, 0, 0, 0, 425, + 0, 0, 0, 0, 0, 0, 0, 427, 0, 0, + 0, 161, 0, 0, 0, 0, 0, 429, 426, 428, + 162, 163, 164, 0, 166, 167, 168, 169, 170, 171, + 0, 0, 159, 165, 151, 144, 146, 160, 0, 0, 0, 0, 0, 243, 0, 0, 0, 0, 244, 0, 64, 65, 66, 246, 0, 0, 0, 0, 0, 0, - 247, 68, 0, 0, 0, 0, 0, 0, 527, 250, - 0, 0, 251, 528, 0, 72, 0, 0, 0, 73, + 247, 248, 0, 0, 0, 0, 0, 0, 249, 250, + 0, 0, 251, 71, 0, 72, 0, 0, 0, 73, 0, 74, 75, 76, 0, 0, 78, 0, 0, 0, 79, 0, 80, 0, 0, 0, 0, 0, 253, 0, 254, 0, 0, 0, 83, 252, 255, 256, 84, 257, 85, 258, 87, 27, 88, 259, 260, 0, 0, 77, - 86, 67, 18, 245, 0, 529, 0, 0, 0, 0, - 392, 142, 143, 0, 0, 394, 147, 396, 65, 66, - 397, 0, 150, 0, 0, 0, 152, 399, 400, 0, - 0, 0, 0, 0, 0, 401, 402, 156, 157, 251, - 71, 0, 72, 0, 0, 0, 73, 0, 74, 403, - 76, 0, 0, 405, 0, 0, 0, 79, 0, 80, - 0, -238, 0, 0, 0, 407, 0, 254, 0, 0, - 0, 409, 406, 408, 410, 411, 412, 85, 414, 415, - 416, 417, 418, 419, 0, 0, 404, 413, 398, 393, - 395, 160, 0, 0, 0, 0, 0, + 86, 67, 18, 245, 0, 0, 0, 0, 0, 0, + 243, 0, 0, 0, 0, 244, 0, 64, 65, 66, + 246, 0, 0, 0, 0, 0, 0, 247, 68, 0, + 0, 0, 0, 0, 0, 249, 250, 0, 0, 251, + 71, 0, 72, 0, 0, 0, 73, 0, 74, 75, + 76, 0, 0, 78, 0, 0, 0, 79, 0, 80, + 0, 0, 0, 0, 0, 253, 0, 254, 0, 0, + 0, 83, 252, 255, 256, 84, 257, 85, 258, 87, + 27, 88, 259, 260, 0, 0, 77, 86, 67, 18, + 245, 0, 0, 0, 0, 0, 0, 392, 142, 143, + 0, 0, 394, 147, 396, 65, 66, 397, 0, 150, + 0, 0, 0, 152, 399, 400, 0, 0, 0, 0, + 0, 0, 401, 402, 156, 157, 251, 71, 0, 72, + 0, 0, 0, 73, 0, 74, 403, 76, 0, 0, + 405, 0, 0, 0, 79, 0, 80, 0, -243, 0, + 0, 0, 407, 0, 254, 0, 0, 0, 409, 406, + 408, 410, 411, 412, 85, 414, 415, 416, 417, 418, + 419, 0, 0, 404, 413, 398, 393, 395, 160, 0, + 0, 0, 0, 0, - 463, 180, 197, 480, 476, 481, 504, 460, 478, 466, - 464, 284, 210, 184, 532, 526, 370, 540, 512, 281, - 10, 274, 12, 241, 537, 547, 216, 222, 499, 269, - 220, 502, 470, 498, 491, 333, 456, 485, 489, 487, - 518, 470, 203, 467, 51, 541, 38, 0, 205, 340, - 382, 380, 378, 351, 431, 421, 369, 367, 384, 216, - 281, 0, 274, 467, 269, 333, 433, 441, 92, 342, - 338, 93, 446, 448, 365, 423, 178, 172, 333, 175, - 333, 0, 541, 0, 333, 0, 92, 333, 351, 241, - 121, 241, 0, 220, 0, 92, 0, 435, 178, 120, - 436, 92, 92, 214, 138, 212, 92, 316, 92, 0, - 534, 0, 122, 140, 92, 92, 92, 92, 132, 317, - 318, 0, 336, 129, 363, 92, 134, 92, 334, 0, - 319, 361, 127, 92, 92, 483, 214, 92, 92, 101, - 0, 297, 92, 126, 551, 102, 301, 92, 92, 507, - 508, 92, 360, 482, 92, 92, 506, 509, 178, 92, - 92, 510, 511, 92, 92, 438, 99, 92, 116, 372, - 92, 375, 92, 130, 92, 92, 435, 123, 268, 436, - 125, 92, 0, 92, 199, 92, 124, 482, 315, 92, - 202, 483, 92, 92, 0, 92, 0, 92, 329, 109, - 104, 128, 301, 301, 0, 92, 92, 92, 329, 100, - 301, 301, 320, 301, 347, 0, 0, 92, 329, 0, - 348, 344, 301, 301, 321, 16, 33, 17, 92, 92, - 350, 0, 0, 301, 301, 0, 309, 92, 92, 326, - 331, 92, 301, 301, 322, 523, 301, 329, 329, 0, - 304, 324, 301, 301, 16, 33, 17, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 357, - 328, 0, 0, 0, 138, 0, 0, 0, 0, 0, - 0, 0, 0, 140, 209, 0, 0, 0, 0, 0, + 460, 284, 485, 466, 197, 463, 478, 552, 216, 481, + 504, 476, 12, 491, 480, 487, 464, 38, 537, 539, + 222, 184, 370, 518, 512, 220, 333, 546, 467, 470, + 210, 241, 51, 281, 274, 542, 269, 489, 433, 545, + 384, 382, 172, 470, 281, 456, 378, 205, 502, 203, + 499, 498, 180, 178, 175, 380, 431, 333, 467, 423, + 421, 446, 269, 216, 274, 351, 340, 448, 367, 0, + 0, 0, 441, 220, 546, 333, 92, 0, 0, 333, + 121, 333, 0, 0, 92, 92, 178, 333, 120, 92, + 127, 509, 435, 212, 92, 436, 92, 138, 122, 369, + 338, 342, 92, 10, 92, 92, 140, 318, 132, 319, + 365, 92, 351, 214, 435, 134, 92, 436, 92, 361, + 241, 126, 92, 334, 99, 363, 104, 241, 92, 0, + 100, 336, 556, 92, 92, 508, 483, 92, 297, 101, + 92, 178, 482, 301, 92, 372, 507, 92, 438, 92, + 102, 214, 0, 92, 268, 511, 375, 92, 92, 506, + 92, 92, 92, 315, 92, 92, 317, 92, 130, 482, + 116, 92, 360, 92, 199, 92, 125, 92, 123, 0, + 202, 128, 124, 92, 92, 483, 510, 92, 92, 92, + 0, 329, 316, 329, 109, 129, 301, 0, 301, 329, + 0, 92, 92, 92, 301, 93, 301, 329, 301, 92, + 320, 92, 301, 357, 301, 348, 301, 329, 347, 0, + 326, 350, 301, 92, 324, 0, 92, 0, 301, 331, + 322, 301, 92, 321, 16, 33, 17, 301, 138, 328, + 0, 304, 0, 0, 92, 0, 0, 140, 209, 301, + 0, 309, 526, 528, 529, 527, 530, 0, 0, 0, + 0, 0, 0, 0, 0, 92, 0, 0, 0, 0, + 301, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 344, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 523, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 16, 33, 17, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0}; + 0, 0, 0, 0}; const int JavaScriptGrammar::action_check [] = { - 2, 61, 60, 36, 33, 29, 33, 60, 8, 17, - 78, 29, 29, 1, 61, 8, 60, 60, 31, 2, - 1, 8, 7, 48, 2, 55, 8, 33, 7, 55, - 33, 7, 7, 7, 5, 36, 33, 36, 36, 60, - 5, 5, 8, 1, 7, 7, 7, 7, 16, 8, - 7, 60, 36, 33, 48, 7, 7, 48, 78, 55, - 55, 7, 66, 36, 20, 88, 36, 78, 60, 88, - 1, 76, 7, 7, 17, 65, 48, 0, 55, 29, - 29, 36, 36, 36, 8, 33, 7, -1, 8, 7, - -1, 36, 78, 60, 36, 36, 33, 36, 8, 8, - 33, 7, 8, 8, 8, 8, 8, 8, 8, -1, - 8, 10, 8, 8, 61, -1, 8, 61, 62, 8, - -1, 61, 62, 61, 62, 61, 62, 40, 40, 61, - 62, 61, 62, 29, 61, 62, 7, 12, 51, 51, - 7, 29, 61, 62, 15, 8, 40, 40, 8, 6, - 60, 60, 56, 56, 56, 60, 55, 51, 51, 60, - 60, 42, 60, 20, 50, 60, 33, 56, 54, 61, - 50, 15, 53, 2, 54, 15, 29, 8, 66, 67, - 29, 8, 57, 29, 8, -1, 29, 25, 63, 27, - 34, 25, 36, 27, 34, 8, 36, 60, -1, 7, - 38, 61, 62, 29, 38, 12, 15, 29, -1, 29, - -1, -1, -1, 66, 67, 29, -1, 66, 67, -1, - 66, 67, 7, 66, 67, 34, -1, 36, 29, -1, - 61, 62, 29, 29, 61, 62, 29, 61, 62, 12, - 66, 67, 29, -1, 66, 67, 66, 67, 61, 62, - 57, -1, -1, 61, 62, 25, 63, 27, 18, 19, - 74, 29, 25, -1, 27, 66, 67, -1, 38, 66, - 67, 85, -1, 66, 67, 38, 61, 62, 74, 66, - 67, 29, 18, 19, 57, 45, 46, -1, 36, 85, - 63, 23, 24, 61, 62, -1, -1, -1, 66, 67, - 32, -1, -1, 35, 29, 37, -1, -1, -1, 45, - 46, 23, 24, -1, 29, -1, 29, -1, 66, 67, - 32, 23, 24, 35, -1, 37, -1, -1, 18, 19, - 32, 23, 24, 35, -1, 37, 61, 62, -1, -1, - 32, 66, 67, 35, -1, 37, 61, 62, 61, 62, - -1, 66, 67, 66, 67, 45, 46, 23, 24, -1, - -1, -1, -1, -1, -1, 31, 32, 23, 24, 35, - -1, 37, -1, -1, -1, 31, 32, 23, 24, 35, - 10, 37, -1, -1, -1, 31, 32, -1, -1, 35, - -1, 37, 22, 10, -1, 23, 24, -1, -1, 29, - -1, 23, 24, 31, 32, 22, -1, 35, -1, 37, - 32, -1, 29, 35, -1, 37, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 55, -1, -1, -1, 59, - -1, -1, -1, -1, -1, -1, 66, 67, 55, -1, - -1, -1, 59, -1, 74, -1, -1, -1, 3, 66, - 67, -1, -1, 83, -1, 85, -1, 74, 13, -1, - -1, -1, 17, -1, -1, -1, 83, -1, 85, 23, - 24, 26, -1, 28, -1, -1, -1, 31, 32, 3, - -1, 35, -1, 37, 39, -1, 41, 42, -1, 13, - -1, -1, -1, 17, 49, -1, -1, 52, 53, -1, - -1, -1, 26, 58, 28, -1, -1, 31, -1, 64, - -1, -1, -1, -1, -1, 39, -1, 41, 42, -1, - -1, -1, -1, -1, 79, 49, -1, -1, 52, 53, - -1, -1, -1, -1, 58, -1, -1, 3, -1, -1, - 64, -1, -1, -1, -1, -1, -1, 13, -1, -1, - -1, 17, -1, -1, -1, 79, -1, -1, -1, -1, - 26, -1, 28, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 39, -1, 41, 42, -1, -1, -1, - -1, -1, -1, 49, -1, -1, 52, 53, -1, -1, - -1, -1, 58, -1, -1, -1, -1, -1, 64, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 79, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 12, 13, -1, -1, -1, - -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, - -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, - -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, - 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, - 67, -1, 69, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 80, 81, 82, -1, -1, -1, -1, - -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, - -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, - -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, - -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, - 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, - 67, -1, 69, -1, 71, -1, 73, -1, 75, -1, - -1, -1, -1, 80, 81, 82, -1, -1, -1, -1, - -1, -1, -1, -1, 7, -1, -1, -1, 11, 12, - 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, - -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, - 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, - 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, - 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 65, 66, 67, -1, 69, -1, 71, -1, - 73, -1, 75, -1, -1, -1, -1, 80, 81, 82, - -1, -1, -1, -1, -1, -1, -1, -1, 11, 12, + 2, 7, 7, 7, 36, 33, 7, 7, 7, 36, + 36, 7, 7, 55, 7, 7, 31, 2, 1, 17, + 8, 60, 60, 48, 61, 61, 8, 36, 7, 36, + 16, 55, 5, 36, 8, 66, 33, 60, 60, 33, + 29, 88, 29, 0, 65, 36, 36, 17, 29, 33, + 8, 29, 29, 33, 8, 1, 5, 5, 78, 78, + 7, 33, 33, 8, 7, 2, 78, 33, 20, 8, + 78, 36, 7, 48, 36, 7, 36, 36, 33, 2, + 48, 8, 7, 36, 60, 36, 55, 1, 8, 7, + -1, 55, 55, 60, 36, 33, 8, 8, 8, 8, + 61, 7, 8, 8, 60, 8, 40, 48, 6, 10, + 60, 8, 8, -1, 8, 8, -1, 51, 8, 50, + 50, 8, 20, 54, 54, 61, 62, 8, 61, 62, + 8, -1, 76, 61, 62, 61, 62, 61, 62, 29, + 60, 40, 42, 12, 56, 40, 61, 62, 88, 60, + 60, 60, 51, 53, 55, 60, 51, 60, 40, 56, + 56, 29, 7, 29, 7, 29, 60, 60, 8, 51, + 61, 62, 15, 1, 61, 56, 61, 62, 25, 25, + 27, 27, 12, 61, 62, 8, 15, 29, 57, 15, + 7, 38, 38, 25, 63, 27, -1, -1, 66, 67, + 66, 67, 66, 67, 29, 34, 38, 36, 34, 29, + 36, 29, -1, 25, 29, 27, 61, 62, -1, 8, + 29, 61, 62, 29, 66, 67, 38, 57, 29, 12, + 25, 29, 27, 63, 8, 25, -1, 27, 61, 62, + -1, 66, 67, 38, 61, 62, 66, 67, 38, 25, + -1, 27, 29, -1, 29, -1, 74, 66, 67, 74, + 66, 67, 38, 15, -1, 66, 67, 85, 66, 67, + 85, -1, 61, 62, 57, 18, 19, 18, 19, -1, + 63, -1, 34, -1, 36, 18, 19, 61, 62, 66, + 67, 66, 67, 29, 18, 19, -1, 23, 24, -1, + 36, -1, 45, 46, 45, 46, 32, -1, -1, 35, + 29, 37, 45, 46, 23, 24, -1, 29, -1, -1, + -1, 45, 46, 32, 23, 24, 35, 29, 37, 29, + 66, 67, -1, 32, -1, -1, 35, -1, 37, 25, + -1, 27, 61, 62, -1, -1, -1, 66, 67, 61, + 62, -1, 38, -1, 66, 67, -1, -1, -1, 61, + 62, 61, 62, -1, 66, 67, 66, 67, 23, 24, + -1, -1, -1, -1, -1, -1, 31, 32, 23, 24, + 35, -1, 37, -1, -1, -1, 31, 32, 23, 24, + 35, 10, 37, -1, -1, -1, 31, 32, -1, -1, + 35, -1, 37, 22, 10, 23, 24, -1, -1, -1, + 29, -1, -1, -1, 32, -1, 22, 35, -1, 37, + -1, -1, -1, 29, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 55, -1, -1, -1, + 59, -1, -1, -1, -1, -1, -1, 66, 67, 55, + -1, -1, -1, 59, -1, 74, -1, -1, -1, -1, + 66, 67, -1, -1, 83, -1, 85, -1, 74, -1, + 3, -1, -1, 23, 24, -1, -1, 83, -1, 85, + 13, 31, 32, -1, 17, 35, -1, 37, -1, -1, + -1, -1, -1, 26, -1, 28, -1, -1, 31, -1, + -1, -1, -1, -1, -1, -1, 39, -1, 41, 42, + -1, -1, -1, -1, -1, -1, 49, -1, -1, 52, + 53, -1, -1, -1, -1, 58, -1, -1, -1, -1, + -1, 64, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 3, -1, -1, -1, -1, 79, -1, -1, -1, + -1, 13, -1, -1, -1, 17, -1, -1, -1, -1, + -1, -1, -1, -1, 26, -1, 28, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 39, -1, 41, + 42, -1, -1, -1, -1, -1, -1, 49, -1, -1, + 52, 53, -1, -1, -1, -1, 58, -1, -1, -1, + -1, -1, 64, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 79, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, - 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, - 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, - 53, -1, -1, 56, -1, -1, -1, -1, -1, -1, - -1, -1, 65, 66, 67, -1, 69, -1, 71, -1, - 73, -1, 75, -1, -1, -1, -1, 80, 81, 82, - -1, -1, -1, -1, -1, -1, -1, -1, 11, 12, - 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, - -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, - 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, - 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, - 53, -1, -1, 56, -1, -1, -1, -1, -1, -1, - -1, -1, 65, 66, 67, -1, 69, -1, 71, -1, - 73, -1, 75, -1, -1, -1, -1, 80, 81, 82, + 33, 34, -1, 36, -1, -1, -1, -1, -1, -1, + 43, -1, -1, -1, 47, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 65, 66, 67, -1, 69, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 80, 81, 82, -1, -1, -1, -1, -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, @@ -629,51 +606,74 @@ const int JavaScriptGrammar::action_check [] = { 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, -1, 69, -1, 71, -1, - 73, 74, 75, -1, -1, -1, -1, 80, 81, 82, - -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, - 6, -1, -1, 9, 10, 11, -1, -1, 14, -1, - 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, - -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 59, -1, -1, -1, -1, -1, -1, - 66, 67, 68, 69, 70, -1, 72, 73, 74, 75, - 76, 77, -1, -1, 80, 81, 82, 83, 84, 85, - -1, -1, -1, -1, -1, 4, 5, 6, -1, -1, - 9, 10, 11, -1, -1, 14, -1, 16, -1, -1, - -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, - 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, -1, -1, -1, 47, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 59, -1, -1, -1, -1, -1, 65, 66, 67, 68, - 69, 70, -1, 72, 73, 74, 75, 76, 77, -1, - -1, 80, 81, 82, 83, 84, 85, -1, -1, -1, + 73, -1, 75, -1, -1, -1, -1, 80, 81, 82, + -1, -1, -1, -1, -1, -1, -1, -1, 7, -1, + -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, + -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, + 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, + -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, + -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 65, 66, 67, -1, + 69, -1, 71, -1, 73, -1, 75, -1, -1, -1, + -1, 80, 81, 82, -1, -1, -1, -1, -1, -1, + -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, + -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, + 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, + -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, + -1, -1, 51, -1, 53, -1, -1, 56, -1, -1, + -1, -1, -1, -1, -1, -1, 65, 66, 67, -1, + 69, -1, 71, -1, 73, -1, 75, -1, -1, -1, + -1, 80, 81, 82, -1, -1, -1, -1, -1, -1, + -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, + -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, + 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, + -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, + -1, -1, 51, -1, 53, -1, -1, 56, -1, -1, + -1, -1, -1, -1, -1, -1, 65, 66, 67, -1, + 69, -1, 71, -1, 73, -1, 75, -1, -1, -1, + -1, 80, 81, 82, -1, -1, -1, -1, -1, -1, + -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, + -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, + 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, + -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, + -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 65, 66, 67, -1, + 69, -1, 71, -1, 73, 74, 75, -1, -1, -1, + -1, 80, 81, 82, -1, -1, -1, -1, -1, -1, + -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, + -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, + 29, 30, -1, -1, 33, 34, -1, 36, -1, -1, + -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, + -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, + -1, -1, 61, -1, -1, -1, 65, 66, 67, -1, + 69, -1, 71, -1, 73, -1, 75, -1, -1, -1, + -1, 80, 81, 82, -1, 84, -1, 86, -1, -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, -1, -1, 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 43, -1, -1, -1, 47, -1, -1, -1, -1, - -1, -1, -1, 55, -1, -1, -1, 59, -1, -1, - -1, -1, -1, 65, 66, 67, 68, 69, 70, -1, + -1, 43, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, + -1, -1, -1, -1, 66, 67, 68, 69, 70, -1, 72, 73, 74, 75, 76, 77, -1, -1, 80, 81, 82, 83, 84, 85, -1, -1, -1, -1, -1, 4, - -1, -1, -1, -1, 9, -1, 11, 12, 13, 14, - -1, -1, -1, -1, -1, -1, 21, 22, -1, -1, - -1, -1, -1, -1, 29, 30, -1, -1, 33, 34, - -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, - -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, - -1, -1, -1, -1, 59, -1, 61, -1, -1, -1, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 5, 6, -1, -1, 9, 10, 11, -1, -1, 14, + -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, + -1, -1, -1, -1, 29, 30, 31, 32, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, + -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 59, -1, -1, -1, -1, -1, + 65, 66, 67, 68, 69, 70, -1, 72, 73, 74, 75, 76, 77, -1, -1, 80, 81, 82, 83, 84, - -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, - -1, 9, -1, 11, 12, 13, 14, -1, -1, -1, - -1, -1, -1, 21, 22, -1, -1, -1, -1, -1, - -1, 29, 30, -1, -1, 33, 34, -1, 36, -1, - -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, - -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, - -1, 59, -1, 61, -1, -1, -1, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - -1, -1, 80, 81, 82, 83, 84, -1, -1, -1, + 85, -1, -1, -1, -1, -1, 4, 5, 6, -1, + -1, 9, 10, 11, -1, -1, 14, -1, 16, -1, + -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, + -1, 29, 30, 31, 32, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 43, -1, -1, -1, 47, + -1, -1, -1, -1, -1, -1, -1, 55, -1, -1, + -1, 59, -1, -1, -1, -1, -1, 65, 66, 67, + 68, 69, 70, -1, 72, 73, 74, 75, 76, 77, + -1, -1, 80, 81, 82, 83, 84, 85, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, 9, -1, 11, 12, 13, 14, -1, -1, -1, -1, -1, -1, 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, @@ -682,51 +682,67 @@ const int JavaScriptGrammar::action_check [] = { 51, -1, 53, -1, -1, -1, -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, 80, - 81, 82, 83, 84, -1, 86, -1, -1, -1, -1, - 4, 5, 6, -1, -1, 9, 10, 11, 12, 13, - 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, - -1, -1, -1, -1, -1, 29, 30, 31, 32, 33, + 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, + 4, -1, -1, -1, -1, 9, -1, 11, 12, 13, + 14, -1, -1, -1, -1, -1, -1, 21, 22, -1, + -1, -1, -1, -1, -1, 29, 30, -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, - -1, 55, -1, -1, -1, 59, -1, 61, -1, -1, + -1, -1, -1, -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, -1, -1, 80, 81, 82, 83, - 84, 85, -1, -1, -1, -1, -1, + 84, -1, -1, -1, -1, -1, -1, 4, 5, 6, + -1, -1, 9, 10, 11, 12, 13, 14, -1, 16, + -1, -1, -1, 20, 21, 22, -1, -1, -1, -1, + -1, -1, 29, 30, 31, 32, 33, 34, -1, 36, + -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, + 47, -1, -1, -1, 51, -1, 53, -1, 55, -1, + -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, -1, -1, 80, 81, 82, 83, 84, 85, -1, + -1, -1, -1, -1, - 77, 25, 25, 63, 94, 63, 16, 89, 19, 77, - 16, 16, 16, 59, 10, 14, 19, 19, 19, 14, - 5, 19, 6, 14, 6, 25, 19, 19, 25, 19, - 19, 25, 63, 21, 14, 16, 92, 16, 16, 14, - 16, 63, 25, 16, 16, 19, 15, -1, 25, 16, - 14, 16, 14, 19, 25, 25, 14, 16, 14, 19, - 14, -1, 19, 16, 19, 16, 14, 14, 36, 14, - 14, 39, 14, 16, 14, 27, 25, 16, 16, 25, - 16, -1, 19, -1, 16, -1, 36, 16, 19, 14, - 40, 14, -1, 19, -1, 36, -1, 30, 25, 40, - 33, 36, 36, 38, 19, 32, 36, 41, 36, -1, - 6, -1, 40, 28, 36, 36, 36, 36, 48, 41, - 41, -1, 60, 42, 60, 36, 46, 36, 60, -1, - 41, 60, 41, 36, 36, 38, 38, 36, 36, 38, - -1, 36, 36, 41, 81, 39, 41, 36, 36, 38, - 38, 36, 83, 38, 36, 36, 38, 38, 25, 36, - 36, 38, 38, 36, 36, 32, 38, 36, 41, 95, - 36, 96, 36, 42, 36, 36, 30, 41, 101, 33, - 41, 36, -1, 36, 50, 36, 41, 38, 41, 36, - 52, 38, 36, 36, -1, 36, -1, 36, 36, 42, - 44, 42, 41, 41, -1, 36, 36, 36, 36, 38, - 41, 41, 43, 41, 53, -1, -1, 36, 36, -1, - 58, 51, 41, 41, 43, 17, 18, 19, 36, 36, - 58, -1, -1, 41, 41, -1, 43, 36, 36, 47, - 58, 36, 41, 41, 43, 8, 41, 36, 36, -1, - 45, 49, 41, 41, 17, 18, 19, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 58, - 58, -1, -1, -1, 19, -1, -1, -1, -1, -1, - -1, -1, -1, 28, 29, -1, -1, -1, -1, -1, + 90, 21, 21, 78, 30, 78, 24, 30, 24, 15, + 21, 95, 6, 68, 15, 68, 21, 20, 10, 6, + 24, 64, 24, 21, 24, 24, 21, 24, 21, 15, + 21, 68, 21, 68, 24, 6, 24, 21, 68, 24, + 68, 68, 21, 15, 68, 93, 68, 30, 30, 30, + 30, 26, 30, 30, 30, 21, 30, 21, 21, 32, + 30, 68, 24, 24, 24, 24, 21, 21, 21, -1, + -1, -1, 68, 24, 24, 21, 41, -1, -1, 21, + 45, 21, -1, -1, 41, 41, 30, 21, 45, 41, + 46, 43, 35, 37, 41, 38, 41, 24, 45, 68, + 68, 68, 41, 5, 41, 41, 33, 46, 53, 46, + 68, 41, 24, 43, 35, 51, 41, 38, 41, 65, + 68, 46, 41, 65, 43, 65, 49, 68, 41, -1, + 43, 65, 82, 41, 41, 43, 43, 41, 41, 43, + 41, 30, 43, 46, 41, 96, 43, 41, 37, 41, + 44, 43, -1, 41, 102, 43, 97, 41, 41, 43, + 41, 41, 41, 46, 41, 41, 46, 41, 47, 43, + 46, 41, 84, 41, 55, 41, 46, 41, 46, -1, + 57, 47, 46, 41, 41, 43, 43, 41, 41, 41, + -1, 41, 46, 41, 47, 47, 46, -1, 46, 41, + -1, 41, 41, 41, 46, 44, 46, 41, 46, 41, + 48, 41, 46, 63, 46, 63, 46, 41, 58, -1, + 52, 63, 46, 41, 54, -1, 41, -1, 46, 63, + 48, 46, 41, 48, 22, 23, 24, 46, 24, 63, + -1, 50, -1, -1, 41, -1, -1, 33, 34, 46, + -1, 48, 15, 16, 17, 18, 19, -1, -1, -1, + -1, -1, -1, -1, -1, 41, -1, -1, -1, -1, + 46, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 56, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 22, 23, 24, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1}; + -1, -1, -1, -1}; diff --git a/src/declarative/qml/parser/javascriptgrammar_p.h b/src/declarative/qml/parser/javascriptgrammar_p.h index 70c9766..2e78a77 100644 --- a/src/declarative/qml/parser/javascriptgrammar_p.h +++ b/src/declarative/qml/parser/javascriptgrammar_p.h @@ -150,15 +150,15 @@ public: T_XOR = 78, T_XOR_EQ = 79, - ACCEPT_STATE = 552, - RULE_COUNT = 317, - STATE_COUNT = 553, + ACCEPT_STATE = 557, + RULE_COUNT = 322, + STATE_COUNT = 558, TERMINAL_COUNT = 91, - NON_TERMINAL_COUNT = 103, + NON_TERMINAL_COUNT = 104, - GOTO_INDEX_OFFSET = 553, - GOTO_INFO_OFFSET = 1717, - GOTO_CHECK_OFFSET = 1717 + GOTO_INDEX_OFFSET = 558, + GOTO_INFO_OFFSET = 1714, + GOTO_CHECK_OFFSET = 1714 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 49a4181..4369771 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -268,22 +268,22 @@ case 21: { node->semicolonToken = loc(2); sym(1).Node = node; } break; - case 22: -case 23: { + +case 28: { AST::UiScriptBinding *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId->finish(), sym(3).Statement); node->colonToken = loc(2); sym(1).Node = node; } break; -case 24: +case 29: -case 25: { +case 30: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); break; } -case 27: { +case 32: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), (NameId *)0, sym(2).sval); node->type = AST::UiPublicMember::Signal; node->propertyToken = loc(1); @@ -292,7 +292,7 @@ case 27: { sym(1).Node = node; } break; -case 29: { +case 34: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval); node->propertyToken = loc(1); node->typeToken = loc(2); @@ -301,7 +301,7 @@ case 29: { sym(1).Node = node; } break; -case 31: { +case 36: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(4).sval); node->isDefaultMember = true; node->defaultToken = loc(1); @@ -312,7 +312,7 @@ case 31: { sym(1).Node = node; } break; -case 33: { +case 38: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression); node->propertyToken = loc(1); @@ -323,7 +323,7 @@ case 33: { sym(1).Node = node; } break; -case 35: { +case 40: { AST::UiPublicMember *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(4).sval, sym(6).Expression); node->isDefaultMember = true; @@ -336,88 +336,88 @@ case 35: { sym(1).Node = node; } break; -case 36: { +case 41: { sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Node); } break; -case 37: { +case 42: { sym(1).Node = makeAstNode(driver->nodePool(), sym(1).Node); } break; -case 38: -case 39: +case 43: +case 44: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 41: { +case 46: { QString s = QLatin1String(JavaScriptGrammar::spell[T_PROPERTY]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 42: { +case 47: { QString s = QLatin1String(JavaScriptGrammar::spell[T_SIGNAL]); sym(1).sval = driver->intern(s.constData(), s.length()); break; } -case 43: { +case 48: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 44: { +case 49: { AST::UiQualifiedId *node = makeAstNode (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 45: { +case 50: { AST::ThisExpression *node = makeAstNode (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 46: { +case 51: { AST::IdentifierExpression *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 47: { +case 52: { AST::NullExpression *node = makeAstNode (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 48: { +case 53: { AST::TrueLiteral *node = makeAstNode (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 49: { +case 54: { AST::FalseLiteral *node = makeAstNode (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 50: { +case 55: { AST::NumericLiteral *node = makeAstNode (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 51: { +case 56: { AST::StringLiteral *node = makeAstNode (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 52: { +case 57: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -428,7 +428,7 @@ case 52: { sym(1).Node = node; } break; -case 53: { +case 58: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -439,21 +439,21 @@ case 53: { sym(1).Node = node; } break; -case 54: { +case 59: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).Elision); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 55: { +case 60: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish ()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 56: { +case 61: { AST::ArrayLiteral *node = makeAstNode (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); node->lbracketToken = loc(1); node->commaToken = loc(3); @@ -461,7 +461,7 @@ case 56: { sym(1).Node = node; } break; -case 57: { +case 62: { AST::ObjectLiteral *node = 0; if (sym(2).Node) node = makeAstNode (driver->nodePool(), @@ -473,7 +473,7 @@ case 57: { sym(1).Node = node; } break; -case 58: { +case 63: { AST::ObjectLiteral *node = makeAstNode (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); node->lbraceToken = loc(1); @@ -481,51 +481,51 @@ case 58: { sym(1).Node = node; } break; -case 59: { +case 64: { AST::NestedExpression *node = makeAstNode(driver->nodePool(), sym(2).Expression); node->lparenToken = loc(1); node->rparenToken = loc(3); sym(1).Node = node; } break; -case 60: { +case 65: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Elision, sym(2).Expression); } break; -case 61: { +case 66: { AST::ElementList *node = makeAstNode (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 62: { +case 67: { AST::Elision *node = makeAstNode (driver->nodePool()); node->commaToken = loc(1); sym(1).Node = node; } break; -case 63: { +case 68: { AST::Elision *node = makeAstNode (driver->nodePool(), sym(1).Elision); node->commaToken = loc(2); sym(1).Node = node; } break; -case 64: { +case 69: { sym(1).Node = 0; } break; -case 65: { +case 70: { sym(1).Elision = sym(1).Elision->finish (); } break; -case 66: { +case 71: { AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); node->colonToken = loc(2); sym(1).Node = node; } break; -case 67: { +case 72: { AST::PropertyNameAndValueList *node = makeAstNode (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); node->commaToken = loc(2); @@ -533,46 +533,36 @@ case 67: { sym(1).Node = node; } break; -case 68: { +case 73: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 69: -case 70: { +case 74: +case 75: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount())); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 71: { +case 76: { AST::StringLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 72: { +case 77: { AST::NumericLiteralPropertyName *node = makeAstNode (driver->nodePool(), sym(1).dval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 73: { +case 78: { AST::IdentifierPropertyName *node = makeAstNode (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 74: - -case 75: - -case 76: - -case 77: - -case 78: - case 79: case 80: @@ -624,25 +614,35 @@ case 102: case 103: case 104: + +case 105: + +case 106: + +case 107: + +case 108: + +case 109: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 109: { +case 114: { AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 110: { +case 115: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 111: { +case 116: { AST::NewMemberExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -650,384 +650,384 @@ case 111: { sym(1).Node = node; } break; -case 113: { +case 118: { AST::NewExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 114: { +case 119: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 115: { +case 120: { AST::CallExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 116: { +case 121: { AST::ArrayMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 117: { +case 122: { AST::FieldMemberExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 118: { +case 123: { sym(1).Node = 0; } break; -case 119: { +case 124: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 120: { +case 125: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Expression); } break; -case 121: { +case 126: { AST::ArgumentList *node = makeAstNode (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 125: { +case 130: { AST::PostIncrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->incrementToken = loc(2); sym(1).Node = node; } break; -case 126: { +case 131: { AST::PostDecrementExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->decrementToken = loc(2); sym(1).Node = node; } break; -case 128: { +case 133: { AST::DeleteExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->deleteToken = loc(1); sym(1).Node = node; } break; -case 129: { +case 134: { AST::VoidExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->voidToken = loc(1); sym(1).Node = node; } break; -case 130: { +case 135: { AST::TypeOfExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->typeofToken = loc(1); sym(1).Node = node; } break; -case 131: { +case 136: { AST::PreIncrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->incrementToken = loc(1); sym(1).Node = node; } break; -case 132: { +case 137: { AST::PreDecrementExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->decrementToken = loc(1); sym(1).Node = node; } break; -case 133: { +case 138: { AST::UnaryPlusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->plusToken = loc(1); sym(1).Node = node; } break; -case 134: { +case 139: { AST::UnaryMinusExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->minusToken = loc(1); sym(1).Node = node; } break; -case 135: { +case 140: { AST::TildeExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->tildeToken = loc(1); sym(1).Node = node; } break; -case 136: { +case 141: { AST::NotExpression *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->notToken = loc(1); sym(1).Node = node; } break; -case 138: { +case 143: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 139: { +case 144: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 140: { +case 145: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 142: { +case 147: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 143: { +case 148: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 145: { +case 150: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 146: { +case 151: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 147: { +case 152: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 149: { +case 154: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 150: { +case 155: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 151: { +case 156: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 152: { +case 157: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 153: { +case 158: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 154: { +case 159: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 156: { +case 161: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 157: { +case 162: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 158: { +case 163: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 159: { +case 164: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 160: { +case 165: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 162: { +case 167: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 163: { +case 168: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 164: { +case 169: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 165: { +case 170: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 167: { +case 172: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 168: { +case 173: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 169: { +case 174: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 170: { +case 175: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 172: { +case 177: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 174: { +case 179: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 176: { +case 181: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 178: { +case 183: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 180: { +case 185: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 182: { +case 187: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 184: { +case 189: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 186: { +case 191: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 188: { +case 193: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 190: { +case 195: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 192: { +case 197: { AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1035,7 +1035,7 @@ case 192: { sym(1).Node = node; } break; -case 194: { +case 199: { AST::ConditionalExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -1043,112 +1043,112 @@ case 194: { sym(1).Node = node; } break; -case 196: { +case 201: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 198: { +case 203: { AST::BinaryExpression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 199: { +case 204: { sym(1).ival = QSOperator::Assign; } break; -case 200: { +case 205: { sym(1).ival = QSOperator::InplaceMul; } break; -case 201: { +case 206: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 202: { +case 207: { sym(1).ival = QSOperator::InplaceMod; } break; -case 203: { +case 208: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 204: { +case 209: { sym(1).ival = QSOperator::InplaceSub; } break; -case 205: { +case 210: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 206: { +case 211: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 207: { +case 212: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 208: { +case 213: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 209: { +case 214: { sym(1).ival = QSOperator::InplaceXor; } break; -case 210: { +case 215: { sym(1).ival = QSOperator::InplaceOr; } break; -case 212: { +case 217: { AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 213: { +case 218: { sym(1).Node = 0; } break; -case 216: { +case 221: { AST::Expression *node = makeAstNode (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 217: { +case 222: { sym(1).Node = 0; } break; -case 234: { +case 239: { AST::Block *node = makeAstNode (driver->nodePool(), sym(2).StatementList); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 235: { +case 240: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 236: { +case 241: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 237: { +case 242: { sym(1).Node = 0; } break; -case 238: { +case 243: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 240: { +case 245: { AST::VariableStatement *node = makeAstNode (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); @@ -1156,76 +1156,76 @@ case 240: { sym(1).Node = node; } break; -case 241: { +case 246: { sym(1).ival = T_CONST; } break; -case 242: { +case 247: { sym(1).ival = T_VAR; } break; -case 243: { +case 248: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 244: { +case 249: { AST::VariableDeclarationList *node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); node->commaToken = loc(2); sym(1).Node = node; } break; -case 245: { +case 250: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 246: { +case 251: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 247: { +case 252: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 248: { +case 253: { AST::VariableDeclaration *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 249: { +case 254: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 250: { +case 255: { sym(1).Node = 0; } break; -case 252: { +case 257: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 253: { +case 258: { sym(1).Node = 0; } break; -case 255: { +case 260: { AST::EmptyStatement *node = makeAstNode (driver->nodePool()); node->semicolonToken = loc(1); sym(1).Node = node; } break; -case 257: { +case 262: { AST::ExpressionStatement *node = makeAstNode (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 258: { +case 263: { AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1234,7 +1234,7 @@ case 258: { sym(1).Node = node; } break; -case 259: { +case 264: { AST::IfStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1242,7 +1242,7 @@ case 259: { sym(1).Node = node; } break; -case 261: { +case 266: { AST::DoWhileStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(5).Expression); node->doToken = loc(1); node->whileToken = loc(3); @@ -1252,7 +1252,7 @@ case 261: { sym(1).Node = node; } break; -case 262: { +case 267: { AST::WhileStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->whileToken = loc(1); node->lparenToken = loc(2); @@ -1260,7 +1260,7 @@ case 262: { sym(1).Node = node; } break; -case 263: { +case 268: { AST::ForStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); node->forToken = loc(1); @@ -1271,7 +1271,7 @@ case 263: { sym(1).Node = node; } break; -case 264: { +case 269: { AST::LocalForStatement *node = makeAstNode (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); @@ -1284,7 +1284,7 @@ case 264: { sym(1).Node = node; } break; -case 265: { +case 270: { AST:: ForEachStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); node->forToken = loc(1); @@ -1294,7 +1294,7 @@ case 265: { sym(1).Node = node; } break; -case 266: { +case 271: { AST::LocalForEachStatement *node = makeAstNode (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); node->forToken = loc(1); @@ -1305,14 +1305,14 @@ case 266: { sym(1).Node = node; } break; -case 268: { +case 273: { AST::ContinueStatement *node = makeAstNode (driver->nodePool()); node->continueToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 270: { +case 275: { AST::ContinueStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); node->continueToken = loc(1); node->identifierToken = loc(2); @@ -1320,14 +1320,14 @@ case 270: { sym(1).Node = node; } break; -case 272: { +case 277: { AST::BreakStatement *node = makeAstNode (driver->nodePool()); node->breakToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 274: { +case 279: { AST::BreakStatement *node = makeAstNode (driver->nodePool(), sym(2).sval); node->breakToken = loc(1); node->identifierToken = loc(2); @@ -1335,14 +1335,14 @@ case 274: { sym(1).Node = node; } break; -case 276: { +case 281: { AST::ReturnStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->returnToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 277: { +case 282: { AST::WithStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->withToken = loc(1); node->lparenToken = loc(2); @@ -1350,7 +1350,7 @@ case 277: { sym(1).Node = node; } break; -case 278: { +case 283: { AST::SwitchStatement *node = makeAstNode (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); node->switchToken = loc(1); node->lparenToken = loc(2); @@ -1358,90 +1358,90 @@ case 278: { sym(1).Node = node; } break; -case 279: { +case 284: { AST::CaseBlock *node = makeAstNode (driver->nodePool(), sym(2).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 280: { +case 285: { AST::CaseBlock *node = makeAstNode (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(5); sym(1).Node = node; } break; -case 281: { +case 286: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClause); } break; -case 282: { +case 287: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 283: { +case 288: { sym(1).Node = 0; } break; -case 284: { +case 289: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 285: { +case 290: { AST::CaseClause *node = makeAstNode (driver->nodePool(), sym(2).Expression, sym(4).StatementList); node->caseToken = loc(1); node->colonToken = loc(3); sym(1).Node = node; } break; -case 286: { +case 291: { AST::DefaultClause *node = makeAstNode (driver->nodePool(), sym(3).StatementList); node->defaultToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 287: -case 288: { +case 292: +case 293: { AST::LabelledStatement *node = makeAstNode (driver->nodePool(), driver->intern(lexer->characterBuffer(), lexer->characterCount()), sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 289: { +case 294: { AST::LabelledStatement *node = makeAstNode (driver->nodePool(), sym(1).sval, sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 291: { +case 296: { AST::ThrowStatement *node = makeAstNode (driver->nodePool(), sym(2).Expression); node->throwToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 292: { +case 297: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch); node->tryToken = loc(1); sym(1).Node = node; } break; -case 293: { +case 298: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 294: { +case 299: { AST::TryStatement *node = makeAstNode (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 295: { +case 300: { AST::Catch *node = makeAstNode (driver->nodePool(), sym(3).sval, sym(5).Block); node->catchToken = loc(1); node->lparenToken = loc(2); @@ -1450,20 +1450,20 @@ case 295: { sym(1).Node = node; } break; -case 296: { +case 301: { AST::Finally *node = makeAstNode (driver->nodePool(), sym(2).Block); node->finallyToken = loc(1); sym(1).Node = node; } break; -case 298: { +case 303: { AST::DebuggerStatement *node = makeAstNode (driver->nodePool()); node->debuggerToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 299: { +case 304: { AST::FunctionDeclaration *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1474,7 +1474,7 @@ case 299: { sym(1).Node = node; } break; -case 300: { +case 305: { AST::FunctionExpression *node = makeAstNode (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1486,56 +1486,56 @@ case 300: { sym(1).Node = node; } break; -case 301: { +case 306: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 302: { +case 307: { AST::FormalParameterList *node = makeAstNode (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 303: { +case 308: { sym(1).Node = 0; } break; -case 304: { +case 309: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 305: { +case 310: { sym(1).Node = 0; } break; -case 307: { +case 312: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 308: { +case 313: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElement); } break; -case 309: { +case 314: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 310: { +case 315: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).Statement); } break; -case 311: { +case 316: { sym(1).Node = makeAstNode (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 312: { +case 317: { sym(1).sval = 0; } break; -case 314: { +case 319: { sym(1).Node = 0; } break; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index a9f8593..aa29ff3 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -194,9 +194,9 @@ protected: -#define J_SCRIPT_REGEXPLITERAL_RULE1 52 +#define J_SCRIPT_REGEXPLITERAL_RULE1 57 -#define J_SCRIPT_REGEXPLITERAL_RULE2 53 +#define J_SCRIPT_REGEXPLITERAL_RULE2 58 QT_END_NAMESPACE -- cgit v0.12 From a896219edac2db3321e5c012bcdb830c698efc1e Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 14 May 2009 16:05:27 +0200 Subject: Compile with gcc 4.2. --- src/declarative/qml/parser/javascriptengine_p.cpp | 35 +++++++++- src/declarative/qml/parser/javascriptengine_p.h | 82 +++++++++++------------ 2 files changed, 71 insertions(+), 46 deletions(-) diff --git a/src/declarative/qml/parser/javascriptengine_p.cpp b/src/declarative/qml/parser/javascriptengine_p.cpp index 5debfd3..d893a90 100644 --- a/src/declarative/qml/parser/javascriptengine_p.cpp +++ b/src/declarative/qml/parser/javascriptengine_p.cpp @@ -34,11 +34,11 @@ QT_BEGIN_NAMESPACE +namespace JavaScript { + uint qHash(const JavaScript::NameId &id) { return qHash(id.asString()); } -namespace JavaScript { - QString numberToString(double value) { return QString::number(value); } @@ -155,6 +155,37 @@ double integerFromString(const QString &str, int radix) return integerFromString(ba.constData(), ba.size(), radix); } + +Engine::Engine() + : _lexer(0), _nodePool(0) +{ } + +Engine::~Engine() +{ } + +QSet Engine::literals() const +{ return _literals; } + +NameId *Engine::intern(const QChar *u, int s) +{ return const_cast(&*_literals.insert(NameId(u, s))); } + +QString Engine::toString(NameId *id) +{ return id->asString(); } + +Lexer *Engine::lexer() const +{ return _lexer; } + +void Engine::setLexer(Lexer *lexer) +{ _lexer = lexer; } + +NodePool *Engine::nodePool() const +{ return _nodePool; } + +void Engine::setNodePool(NodePool *nodePool) +{ _nodePool = nodePool; } + + + } // end of namespace JavaScript QT_END_NAMESPACE diff --git a/src/declarative/qml/parser/javascriptengine_p.h b/src/declarative/qml/parser/javascriptengine_p.h index 933487f..3bd924a 100644 --- a/src/declarative/qml/parser/javascriptengine_p.h +++ b/src/declarative/qml/parser/javascriptengine_p.h @@ -38,11 +38,38 @@ QT_BEGIN_NAMESPACE namespace JavaScript { -class NameId; -} +class NameId +{ + QString _text; + +public: + NameId(const QChar *u, int s) + : _text(u, s) + { } + + const QString asString() const + { return _text; } + + bool operator == (const NameId &other) const + { return _text == other._text; } + + bool operator != (const NameId &other) const + { return _text != other._text; } + + bool operator < (const NameId &other) const + { return _text < other._text; } +}; uint qHash(const JavaScript::NameId &id); +} // end of namespace JavaScript + +#if defined(Q_CC_MSVC) && _MSC_VER <= 1300 +//this ensures that code outside JavaScript can use the hash function +//it also a workaround for some compilers +inline uint qHash(const JavaScript::NameId &nameId) { return JavaScript::qHash(nameId); } +#endif + namespace JavaScript { class Lexer; @@ -66,29 +93,6 @@ public: } // end of namespace Ecma - -class NameId -{ - QString _text; - -public: - NameId(const QChar *u, int s) - : _text(u, s) - { } - - const QString asString() const - { return _text; } - - bool operator == (const NameId &other) const - { return _text == other._text; } - - bool operator != (const NameId &other) const - { return _text != other._text; } - - bool operator < (const NameId &other) const - { return _text < other._text; } -}; - class DiagnosticMessage { public: @@ -118,30 +122,20 @@ class Engine QSet _literals; public: - Engine() - : _lexer(0), _nodePool(0) - { } - - QSet literals() const - { return _literals; } - - NameId *intern(const QChar *u, int s) - { return const_cast(&*_literals.insert(NameId(u, s))); } + Engine(); + ~Engine(); - static QString toString(NameId *id) - { return id->asString(); } + QSet literals() const; - Lexer *lexer() const - { return _lexer; } + NameId *intern(const QChar *u, int s); - void setLexer(Lexer *lexer) - { _lexer = lexer; } + static QString toString(NameId *id); - NodePool *nodePool() const - { return _nodePool; } + Lexer *lexer() const; + void setLexer(Lexer *lexer); - void setNodePool(NodePool *nodePool) - { _nodePool = nodePool; } + NodePool *nodePool() const; + void setNodePool(NodePool *nodePool); }; } // end of namespace JavaScript -- cgit v0.12 From e03075954936444feda8670330e94b87d82deb79 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 15 May 2009 10:30:03 +1000 Subject: Fix SetProperties not always setting properties correctly. QmlMetaProperty no longer holds on to a QMetaProperty, as it may become invalidated for a dynamic object built using QmlOpenMetaObject. Reviewed-by: Aaron Kennedy --- src/declarative/qml/qmlmetaproperty.cpp | 108 +++++++++++++++++--------------- src/declarative/qml/qmlmetaproperty.h | 2 +- src/declarative/qml/qmlmetaproperty_p.h | 3 +- 3 files changed, 60 insertions(+), 53 deletions(-) diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index 59d6b38..e3e9ff5 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -100,9 +100,16 @@ QmlMetaProperty::~QmlMetaProperty() delete d; d = 0; } -// ### not thread safe -static QHash qmlCacheDefProp; +struct CachedPropertyData { + CachedPropertyData(const QString &n, int pt, int ci) + : name(n), propType(pt), coreIdx(ci) {} + QString name; + int propType; + int coreIdx; +}; +// ### not thread safe +static QHash qmlCacheDefProp; /*! Creates a QmlMetaProperty for the default property of \a obj. If there is no @@ -131,23 +138,22 @@ void QmlMetaProperty::initDefault(QObject *obj) return; d->object = obj; - QHash::ConstIterator iter = + QHash::ConstIterator iter = qmlCacheDefProp.find(obj->metaObject()); if (iter != qmlCacheDefProp.end()) { - d->prop = *iter; - d->propType = iter->propertyType; - d->coreIdx = iter->propertyType; + d->name = iter->name; + d->propType = iter->propType; + d->coreIdx = iter->coreIdx; } else { QMetaPropertyEx p(QmlMetaType::defaultProperty(obj)); - d->prop = p; + d->name = QLatin1String(p.name()); d->propType = p.propertyType; - d->coreIdx = d->prop.propertyIndex(); + d->coreIdx = p.propertyIndex(); if (!QObjectPrivate::get(obj)->metaObject) - qmlCacheDefProp.insert(obj->metaObject(), d->prop); + qmlCacheDefProp.insert(obj->metaObject(), CachedPropertyData(d->name, d->propType, d->coreIdx)); } - if (d->prop.name() != 0) { + if (!d->name.isEmpty()) { d->type = Property | Default; - d->name = QLatin1String(d->prop.name()); } } @@ -166,15 +172,14 @@ QmlMetaProperty::QmlMetaProperty(QObject *obj, int idx, PropertyCategory cat, Qm d->type = Property; d->category = cat; QMetaPropertyEx p(obj->metaObject()->property(idx)); - d->prop = p; d->propType = p.propertyType; d->coreIdx = idx; - if (d->prop.name() != 0) - d->name = QLatin1String(d->prop.name()); + if (p.name() != 0) + d->name = QLatin1String(p.name()); } // ### Not thread safe!!!! -static QHash > qmlCacheProps; +static QHash > qmlCacheProps; /*! Creates a QmlMetaProperty for the property \a name of \a obj. */ @@ -225,21 +230,21 @@ void QmlMetaProperty::initProperty(QObject *obj, const QString &name) } // Property - QHash &props = qmlCacheProps[obj->metaObject()]; - QHash::ConstIterator iter = props.find(name); + QHash &props = qmlCacheProps[obj->metaObject()]; + QHash::ConstIterator iter = props.find(name); if (iter != props.end()) { - d->prop = *iter; - d->propType = iter->propertyType; - d->coreIdx = iter->propertyIndex(); + d->name = iter->name; + d->propType = iter->propType; + d->coreIdx = iter->coreIdx; } else { QMetaPropertyEx p = QmlMetaType::property(obj, name.toLatin1().constData()); - d->prop = p; + d->name = QLatin1String(p.name()); d->propType = p.propertyType; d->coreIdx = p.propertyIndex(); if (!QObjectPrivate::get(obj)->metaObject) - props.insert(name, p); + props.insert(name, CachedPropertyData(d->name, d->propType, d->coreIdx)); } - if (d->prop.name() != 0) + if (!d->name.isEmpty()) d->type = Property; if (d->type == Invalid) { @@ -352,8 +357,8 @@ QmlMetaProperty::propertyCategory(const QMetaProperty &prop) */ const char *QmlMetaProperty::propertyTypeName() const { - if (d->prop.name()) { - return d->prop.typeName(); + if (!d->name.isEmpty()) { + return d->object->metaObject()->property(d->coreIdx).typeName(); } else { return 0; } @@ -365,7 +370,7 @@ const char *QmlMetaProperty::propertyTypeName() const */ bool QmlMetaProperty::operator==(const QmlMetaProperty &other) const { - return d->prop.name() == other.d->prop.name() && + return d->name == other.d->name && d->signal.signature() == other.d->signal.signature() && d->type == other.d->type && d->object == other.d->object; @@ -384,7 +389,7 @@ int QmlMetaPropertyPrivate::propertyType() const { int rv = QVariant::Invalid; - if (prop.name()) { + if (!name.isEmpty()) { if (propType == (int)QVariant::LastType) rv = qMetaTypeId(); else @@ -434,7 +439,6 @@ QObject *QmlMetaProperty::object() const QmlMetaProperty &QmlMetaProperty::operator=(const QmlMetaProperty &other) { d->name = other.d->name; - d->prop = other.d->prop; d->propType = other.d->propType; d->type = other.d->type; d->signal = other.d->signal; @@ -452,8 +456,8 @@ bool QmlMetaProperty::isWritable() const { if (propertyCategory() == List || propertyCategory() == QmlList) return true; - else if (d->prop.name() != 0) - return d->prop.isWritable(); + else if (!d->name.isEmpty()) + return d->object->metaObject()->property(d->coreIdx).isWritable(); else if (type() & SignalProperty) return true; else @@ -465,8 +469,8 @@ bool QmlMetaProperty::isWritable() const */ bool QmlMetaProperty::isDesignable() const { - if (d->prop.name() != 0) - return d->prop.isDesignable(); + if (!d->name.isEmpty()) + return d->object->metaObject()->property(d->coreIdx).isDesignable(); else return false; } @@ -510,9 +514,9 @@ QString QmlMetaProperty::name() const Returns the \l{QMetaProperty} {Qt property} associated with this QML property. */ -const QMetaProperty &QmlMetaProperty::property() const +QMetaProperty QmlMetaProperty::property() const { - return d->prop; + return d->object->metaObject()->property(d->coreIdx); } /*! @@ -602,7 +606,7 @@ QVariant QmlMetaProperty::read() const if (type() & Attached) return QVariant::fromValue(d->attachedObject()); else - return d->prop.read(object()); + return d->object->metaObject()->property(d->coreIdx).read(object()); } return QVariant(); } @@ -636,6 +640,7 @@ void QmlMetaPropertyPrivate::writeSignalProperty(const QVariant &value) void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) { + QMetaProperty prop = object->metaObject()->property(coreIdx); if (prop.isEnumType()) { QVariant v = value; if (value.type() == QVariant::Double) { //enum values come through the script engine as doubles @@ -805,13 +810,14 @@ void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) */ void QmlMetaProperty::write(const QVariant &value) const { + QMetaProperty prop = d->object->metaObject()->property(d->coreIdx); if (type() & SignalProperty) { d->writeSignalProperty(value); - } else if (d->prop.name()) { + } else if (prop.name()) { - if (d->prop.isEnumType()) { + if (prop.isEnumType()) { QVariant v = value; if (value.type() == QVariant::Double) { //enum values come through the script engine as doubles double integral; @@ -819,7 +825,7 @@ void QmlMetaProperty::write(const QVariant &value) const if (qFuzzyCompare(fractional, (double)0.0)) v.convert(QVariant::Int); } - d->prop.write(object(), v); + prop.write(object(), v); } else { if (!value.isValid()) return; @@ -836,13 +842,13 @@ void QmlMetaProperty::write(const QVariant &value) const } else if (qMetaTypeId() == t) { - d->prop.write(object(), value); + prop.write(object(), value); } else if (propertyCategory() == Object) { QObject *o = QmlMetaType::toQObject(value); if (o) - d->prop.write(object(), QmlMetaType::fromObject(o, propertyType())); + prop.write(object(), QmlMetaType::fromObject(o, propertyType())); } else if (propertyCategory() == List) { @@ -850,7 +856,7 @@ void QmlMetaProperty::write(const QVariant &value) const if (value.userType() == qMetaTypeId >()) { const QList &list = qvariant_cast >(value); - QVariant listVar = d->prop.read(object()); + QVariant listVar = prop.read(object()); QmlMetaType::clear(listVar); for (int ii = 0; ii < list.count(); ++ii) { QVariant v = QmlMetaType::fromObject(list.at(ii), listType); @@ -859,14 +865,14 @@ void QmlMetaProperty::write(const QVariant &value) const } else if (vt == listType || value.userType() == listType) { - QVariant listVar = d->prop.read(object()); + QVariant listVar = prop.read(object()); if (!QmlMetaType::append(listVar, value)) { qWarning() << "QmlMetaProperty: Unable to assign object to list"; } } } else if (propertyCategory() == QmlList) { // XXX - optimize! - QVariant list = d->prop.read(object()); + QVariant list = prop.read(object()); QmlPrivate::ListInterface *li = *(QmlPrivate::ListInterface **)list.constData(); @@ -969,7 +975,7 @@ void QmlMetaProperty::write(const QVariant &value) const default: break; } - d->prop.write(object(), value); + prop.write(object(), value); } } @@ -982,7 +988,7 @@ void QmlMetaProperty::write(const QVariant &value) const bool QmlMetaProperty::hasChangedNotifier() const { if (type() & Property && !(type() & Attached)) { - return d->prop.hasNotifySignal(); + return d->object->metaObject()->property(d->coreIdx).hasNotifySignal(); } return false; } @@ -1012,8 +1018,9 @@ bool QmlMetaProperty::connectNotifier(QObject *dest, int method) const if (!(type() & Property) || type() & Attached) return false; - if (d->prop.hasNotifySignal()) { - return QMetaObject::connect(d->object, d->prop.notifySignalIndex(), dest, method, Qt::DirectConnection); + QMetaProperty prop = d->object->metaObject()->property(d->coreIdx); + if (prop.hasNotifySignal()) { + return QMetaObject::connect(d->object, prop.notifySignalIndex(), dest, method, Qt::DirectConnection); } else { return false; } @@ -1032,8 +1039,9 @@ bool QmlMetaProperty::connectNotifier(QObject *dest, const char *slot) const if (!(type() & Property) || type() & Attached) return false; - if (d->prop.hasNotifySignal()) { - QByteArray signal(QByteArray("2") + d->prop.notifySignal().signature()); + QMetaProperty prop = d->object->metaObject()->property(d->coreIdx); + if (prop.hasNotifySignal()) { + QByteArray signal(QByteArray("2") + prop.notifySignal().signature()); return QObject::connect(d->object, signal.constData(), dest, slot); } else { return false; @@ -1098,7 +1106,7 @@ void QmlMetaProperty::restore(quint32 id, QObject *obj) d->attachedFunc = id; } else if (d->type & Property) { QMetaPropertyEx p(obj->metaObject()->property(id)); - d->prop = p; + d->name = QLatin1String(p.name()); d->propType = p.propertyType; d->coreIdx = id; } else if (d->type & SignalProperty || d->type & Signal) { diff --git a/src/declarative/qml/qmlmetaproperty.h b/src/declarative/qml/qmlmetaproperty.h index 68b06e5..4e59cf7 100644 --- a/src/declarative/qml/qmlmetaproperty.h +++ b/src/declarative/qml/qmlmetaproperty.h @@ -121,7 +121,7 @@ public: bool operator==(const QmlMetaProperty &) const; - const QMetaProperty &property() const; + QMetaProperty property() const; QmlBindableValue *binding(); static int findSignal(const QObject *, const char *); diff --git a/src/declarative/qml/qmlmetaproperty_p.h b/src/declarative/qml/qmlmetaproperty_p.h index 1ea38e9..738bfec 100644 --- a/src/declarative/qml/qmlmetaproperty_p.h +++ b/src/declarative/qml/qmlmetaproperty_p.h @@ -54,7 +54,7 @@ public: QmlMetaPropertyPrivate(const QmlMetaPropertyPrivate &other) : name(other.name), signal(other.signal), context(other.context), coreIdx(other.coreIdx), type(other.type), attachedFunc(other.attachedFunc), - object(other.object), prop(other.prop), propType(other.propType), + object(other.object), propType(other.propType), category(other.category) {} QString name; @@ -64,7 +64,6 @@ public: uint type; int attachedFunc; QObject *object; - QMetaProperty prop; int propType; mutable QmlMetaProperty::PropertyCategory category; -- cgit v0.12 From e7104992c731749335466b6ff771ee886af79f1d Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 15 May 2009 10:35:53 +1000 Subject: Fix finishPlaying behavior for repeating animations. Make sure we stop at the end of the current loop. --- src/declarative/util/qmlanimation.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index dd4e1eb..24bcac98 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -243,8 +243,12 @@ void QmlAbstractAnimation::setRunning(bool r) d->startOnCompletion = true; emit started(); } else { - if (!d->finishPlaying) + if (d->finishPlaying) { + if (d->repeat) + qtAnimation()->setLoopCount(qtAnimation()->currentLoop()+1); + } else qtAnimation()->stop(); + emit completed(); } @@ -512,7 +516,11 @@ void QmlAbstractAnimation::transition(QmlStateActions &actions, void QmlAbstractAnimation::timelineComplete() { + Q_D(QmlAbstractAnimation); setRunning(false); + if (d->finishPlaying && d->repeat) { + qtAnimation()->setLoopCount(-1); + } } /*! -- cgit v0.12 From 299ce6f43dc8c2f2953f6be551985edc485ea4f9 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 15 May 2009 10:37:09 +1000 Subject: Make test compile. --- tests/auto/declarative/qmlparser/testtypes.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/declarative/qmlparser/testtypes.h b/tests/auto/declarative/qmlparser/testtypes.h index 0dc91b2..c1f85b9 100644 --- a/tests/auto/declarative/qmlparser/testtypes.h +++ b/tests/auto/declarative/qmlparser/testtypes.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include -- cgit v0.12