summaryrefslogtreecommitdiffstats
path: root/src/script/parser
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2009-07-10 14:23:10 (GMT)
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2009-07-13 08:10:06 (GMT)
commitf3355474c05a29c05deb3de989387213de2485f0 (patch)
tree5b03cb547487db6799a82860c0672507c6f42c2b /src/script/parser
parent0579f4be2e79bb95c963a7e2368b6ee797c25e90 (diff)
downloadQt-f3355474c05a29c05deb3de989387213de2485f0.zip
Qt-f3355474c05a29c05deb3de989387213de2485f0.tar.gz
Qt-f3355474c05a29c05deb3de989387213de2485f0.tar.bz2
fix autotest canEvaluate.
Diffstat (limited to 'src/script/parser')
-rw-r--r--src/script/parser/parser.pri15
-rw-r--r--src/script/parser/qscriptlexer.cpp12
2 files changed, 19 insertions, 8 deletions
diff --git a/src/script/parser/parser.pri b/src/script/parser/parser.pri
index 7f2e30a..4839ed2 100644
--- a/src/script/parser/parser.pri
+++ b/src/script/parser/parser.pri
@@ -2,15 +2,18 @@ SOURCES += \
$$PWD/qscriptast.cpp \
$$PWD/qscriptastvisitor.cpp \
$$PWD/qscriptgrammar.cpp \
-# $$PWD/qscriptlexer.cpp \
-# $$PWD/qscriptparser.cpp \
-# $$PWD/qscriptsyntaxchecker.cpp
+ $$PWD/qscriptsyntaxchecker.cpp \
+ $$PWD/qscriptlexer.cpp \
+ #$$PWD/qscriptparser.cpp
HEADERS += \
$$PWD/qscriptastfwd_p.h \
$$PWD/qscriptast_p.h \
$$PWD/qscriptastvisitor_p.h \
$$PWD/qscriptgrammar_p.h \
-# $$PWD/qscriptlexer_p.h \
-# $$PWD/qscriptparser_p.h \
-# $$PWD/qscriptsyntaxchecker_p.h
+ $$PWD/qscriptsyntaxchecker_p.h \
+ $$PWD/qscriptlexer_p.h \
+ #$$PWD/qscriptparser_p.h
+
+INCLUDEPATH += \
+ $$PWD
diff --git a/src/script/parser/qscriptlexer.cpp b/src/script/parser/qscriptlexer.cpp
index 5a0da36..04a3ac3 100644
--- a/src/script/parser/qscriptlexer.cpp
+++ b/src/script/parser/qscriptlexer.cpp
@@ -1074,8 +1074,16 @@ bool QScript::Lexer::scanRegExp(RegExpBodyPrefix prefix)
flags = 0;
while (isIdentLetter(current)) {
- Q_ASSERT_X(false, Q_FUNC_INFO, "not implemented");
- int flag = 0; // QScript::Ecma::RegExp::flagFromChar(current);
+ // current version was remade from this line:
+ //int flag = QScript::Ecma::RegExp::flagFromChar(current);
+ //code was "inlined" because it was only one call to this function
+ int flag;
+ switch (current) {
+ case 'g': flag = 0x01; break;
+ case 'm': flag = 0x02; break;
+ case 'i': flag = 0x04; break;
+ default: flag = 0;
+ }
if (flag == 0) {
errmsg = QString::fromLatin1("Invalid regular expression flag '%0'")
.arg(QChar(current));