QmlJS: Update to latest QmlJS parser from Qt 5.

Using qtdeclarative revision c9b7582a2e7ad9fcd03dd999c3b7a16b72803238

Change-Id: I9c942fa04c3fab5ef57b38e13471d0a4e2e8a2bf
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Christian Kamm
2012-07-31 10:12:26 +02:00
parent 26bd1860d1
commit a14ed0793c
20 changed files with 422 additions and 360 deletions

View File

@@ -28,8 +28,8 @@
**
**************************************************************************/
#include <QtDebug>
#include <QCoreApplication>
#include <QtCore/QtDebug>
#include <QtCore/QCoreApplication>
#include <string.h>
@@ -59,10 +59,10 @@ void Parser::reallocateStack()
else
stack_size <<= 1;
sym_stack = reinterpret_cast<Value*> (qRealloc(sym_stack, stack_size * sizeof(Value)));
state_stack = reinterpret_cast<int*> (qRealloc(state_stack, stack_size * sizeof(int)));
location_stack = reinterpret_cast<AST::SourceLocation*> (qRealloc(location_stack, stack_size * sizeof(AST::SourceLocation)));
string_stack = reinterpret_cast<QStringRef*> (qRealloc(string_stack, stack_size * sizeof(QStringRef)));
sym_stack = reinterpret_cast<Value*> (realloc(sym_stack, stack_size * sizeof(Value)));
state_stack = reinterpret_cast<int*> (realloc(state_stack, stack_size * sizeof(int)));
location_stack = reinterpret_cast<AST::SourceLocation*> (realloc(location_stack, stack_size * sizeof(AST::SourceLocation)));
string_stack = reinterpret_cast<QStringRef*> (realloc(string_stack, stack_size * sizeof(QStringRef)));
}
Parser::Parser(Engine *engine):
@@ -74,6 +74,7 @@ Parser::Parser(Engine *engine):
state_stack(0),
location_stack(0),
string_stack(0),
program(0),
first_token(0),
last_token(0)
{
@@ -82,10 +83,10 @@ Parser::Parser(Engine *engine):
Parser::~Parser()
{
if (stack_size) {
qFree(sym_stack);
qFree(state_stack);
qFree(location_stack);
qFree(string_stack);
free(sym_stack);
free(state_stack);
free(location_stack);
free(string_stack);
}
}