From: Roberto Raggi Date: Mon, 5 Dec 2011 13:42:09 +0000 (+0100) Subject: Adjust the source location of the last accepted token. X-Git-Tag: qt-v5.0.0-alpha1~920 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4bc66eb9389974ca1dda2595414175e69af418bc;p=profile%2Fivi%2Fqtdeclarative.git Adjust the source location of the last accepted token. This is necessary to get automatic semicolons inserted at the correct location. Change-Id: Ie3f806ed20704310cd6155f2dac6d0388a4a9f78 Reviewed-by: Aaron Kennedy --- diff --git a/src/declarative/qml/parser/qdeclarativejs.g b/src/declarative/qml/parser/qdeclarativejs.g index da8ce4c..8a8342b 100644 --- a/src/declarative/qml/parser/qdeclarativejs.g +++ b/src/declarative/qml/parser/qdeclarativejs.g @@ -1112,6 +1112,7 @@ case $rule_number: { } loc(1).length = lexer->tokenLength(); + yylloc = loc(1); // adjust the location of the current token AST::RegExpLiteral *node = new (pool) AST::RegExpLiteral( driver->newStringRef(lexer->regExpPattern()), lexer->regExpFlags()); @@ -1133,6 +1134,7 @@ case $rule_number: { } loc(1).length = lexer->tokenLength(); + yylloc = loc(1); // adjust the location of the current token AST::RegExpLiteral *node = new (pool) AST::RegExpLiteral( driver->newStringRef(lexer->regExpPattern()), lexer->regExpFlags()); diff --git a/src/declarative/qml/parser/qdeclarativejsparser.cpp b/src/declarative/qml/parser/qdeclarativejsparser.cpp index b1384d3..4db8a10 100644 --- a/src/declarative/qml/parser/qdeclarativejsparser.cpp +++ b/src/declarative/qml/parser/qdeclarativejsparser.cpp @@ -577,6 +577,7 @@ case 79: { } loc(1).length = lexer->tokenLength(); + yylloc = loc(1); // adjust the location of the current token AST::RegExpLiteral *node = new (pool) AST::RegExpLiteral( driver->newStringRef(lexer->regExpPattern()), lexer->regExpFlags()); @@ -592,6 +593,7 @@ case 80: { } loc(1).length = lexer->tokenLength(); + yylloc = loc(1); // adjust the location of the current token AST::RegExpLiteral *node = new (pool) AST::RegExpLiteral( driver->newStringRef(lexer->regExpPattern()), lexer->regExpFlags());