summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2016-01-15 16:26:50 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2016-01-16 10:32:23 +0000
commitd3311375a1a9dc9e8222e65411bd9d8fc6137be2 (patch)
tree18d1b728aeba2da377b2aa678e09aeba518dc582
parentfd1cd937085ff5a4f40db78c41b8f5bdff694f9d (diff)
Fix up commit 9d7b27f5bf44a46707e6d50ebf51ecf73f91dd1b
That commit changed qqmljsgrammar.cpp, which turns out to be a generated file. Therefore it's important to also make the modification to the original grammar file, to ensure that future re-generations of the file contain the new code. Change-Id: Id913b29e4a70bfa0c2786073c46dcc206c28b6ee Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
-rw-r--r--src/qml/parser/qqmljs.g19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g
index 71b6978983..96b2b24298 100644
--- a/src/qml/parser/qqmljs.g
+++ b/src/qml/parser/qqmljs.g
@@ -506,7 +506,24 @@ bool Parser::parse(int startToken)
token_buffer[0].token = startToken;
first_token = &token_buffer[0];
- last_token = &token_buffer[1];
+ if (startToken == T_FEED_JS_PROGRAM && !lexer->qmlMode()) {
+ Directives ignoreDirectives;
+ Directives *directives = driver->directives();
+ if (!directives)
+ directives = &ignoreDirectives;
+ DiagnosticMessage error;
+ if (!lexer->scanDirectives(directives, &error)) {
+ diagnostic_messages.append(error);
+ return false;
+ }
+ token_buffer[1].token = lexer->tokenKind();
+ token_buffer[1].dval = lexer->tokenValue();
+ token_buffer[1].loc = location(lexer);
+ token_buffer[1].spell = lexer->tokenSpell();
+ last_token = &token_buffer[2];
+ } else {
+ last_token = &token_buffer[1];
+ }
tos = -1;
program = 0;