aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/parser
Commit message (Collapse)AuthorAgeFilesLines
* Move the parser folder from src/qml/qml to src/qmlLars Knoll2013-08-0818-13711/+0
| | | | | Change-Id: I5e5684f5b98b00f791ade99c4cb6bc2ed880ad6a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix automatic semicolon insertion. Again.Erik Verbruggen2013-07-021-1/+2
| | | | | | | | | | After a do-token, no automatic semicolon can be inserted, because that would result in an empty statement. The issue was that the correct state was set when a do-token was found, but the state updating logic would immediately reset it back, resulting in a semicolon insertion. Change-Id: If867510dfaa182d0fe8b73a5bb1cab299c4faecc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into ↵Simon Hausmann2013-06-242-0/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wip/v4 Conflicts: src/imports/qtquick2/plugins.qmltypes src/qml/debugger/qv8debugservice.cpp src/qml/qml/qml.pri src/qml/qml/qqmlcompiler.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlcontext.cpp src/qml/qml/qqmldata_p.h src/qml/qml/qqmlengine_p.h src/qml/qml/qqmljavascriptexpression.cpp src/qml/qml/qqmlxmlhttprequest.cpp src/qml/qml/v4/qv4bindings.cpp src/qml/qml/v4/qv4irbuilder.cpp src/qml/qml/v4/qv4jsonobject_p.h src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/qml/qml/v8/qv8bindings.cpp src/qml/qml/v8/qv8contextwrapper.cpp src/qml/qml/v8/qv8listwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper_p.h src/qml/qml/v8/qv8sequencewrapper_p_p.h src/qml/qml/v8/qv8typewrapper.cpp src/qml/qml/v8/qv8valuetypewrapper.cpp src/qml/types/qqmldelegatemodel.cpp src/quick/items/context2d/qquickcanvasitem.cpp src/quick/items/context2d/qquickcontext2d.cpp sync.profile tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/benchmarks/qml/animation/animation.pro tools/qmlprofiler/qmlprofiler.pro Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
| * Deprecate the with statement in QMLSimon Hausmann2013-05-312-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | It is generally considered deprecated in JavaScript and its use disables a whole range of optimizations that we would like to apply in the future. Therefore this patch will issue a warning if the with statement is detected. This change is also documented, along with the plan on enabling strict mode in the future. Change-Id: Ie60f0536e0bdd6ecc537d8e34efbd8868bcad743 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Various fixes to RegExpLars Knoll2013-05-041-1/+1
|/ | | | | | | | | | | Duplicated pattern flags in regexp literals should lead to a parse error Make sure RegExpObjects created from a QRegExp have proper type and vtable Fix RegExp constructor when invoked with an empty pattern Fixes two qjsengine autotests. Change-Id: Idbb7dde73f20cb81dea4a07cf0f2cb030aee321b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix export macros for the QML parser export.Thiago Macieira2013-04-031-1/+3
| | | | | | | | | These classes are in the QtQml library. They shouldn't be defined to export (even if it's autotest export) when compiling other libraries, notably QtQuick. Change-Id: Id76d2b2f2c60355240edabb7875db3e97fb0da17 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Fix multi-line string content.Erik Verbruggen2013-03-201-12/+1
| | | | | | | | | | | | ECMA5.1, paragraph 7.8.4, item 9 under semantics: The SV of LineContinuation :: \ LineTerminatorSequence is the empty character sequence. So, do not add any line-terminator inside a multi-line string. Escaped characters like \r and \n are added of course. Change-Id: I8c58b7971b1d1bc90adc795ea278541758246e01 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix hexadecimal escape sequence validation in strings.Erik Verbruggen2013-03-192-22/+39
| | | | | | | | | Give an error message when the sequence does not conform to the grammar. Although the specification does not explicitly state that this is an error, this is the behaviour of both JSC and V8. Change-Id: I34d189f07628bc6cc40b13bfbb8d09bee7810ced Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* don't use CamelCase includesOswald Buddenhagen2013-03-138-26/+28
| | | | | | | | they are not available during bootstrap. Change-Id: I5e941f22cd2b9fa622730ba0bf8389394f6a30a5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Merge branch 'stable' into devGunnar Sletta2013-01-1717-19/+19
|\ | | | | | | | | | | | | | | Conflicts: src/qml/doc/qtqml.qdocconf src/quick/doc/qtquick.qdocconf Change-Id: I087fa14720995a5e53c43567dc4a3c29eb9992a9
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-1017-19/+19
| | | | | | | | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* | Make numeric-literal parsing even more robust.Erik Verbruggen2013-01-161-3/+6
| | | | | | | | | | | | | | | | The numeric value could overflow a unsigned 64-bit integer, so instead just buffer the string and have libc's strtod handle all the conversion. Change-Id: I220e490ddc22363460b0df65a91b47336e747310 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix automatic semicolon insertion before ++/-- operators.Erik Verbruggen2013-01-111-3/+1
| | | | | | | | | | | | | | | | Also move the tilde token from isBinop to the lex method, because it is not a binop, but should still be delimited. Change-Id: I532260f4f3ebdde2d38128b41d11bce5a113d1f1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Make numeric-literal parsing more robust.Erik Verbruggen2013-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | For cases where large non-fp numeric literals might end up triggering coversion or rounding errors when stored as doubles when lexing. This is a corner case, but it does trigger a case or two in the ECMA5 test suite (test262). Change-Id: Ie6d355e28379aba9a339c4e345b5d2a0c32d5fdd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix semicolon insertion before pre-incr/decr operators.Erik Verbruggen2013-01-081-0/+54
| | | | | | | | | | | | | | | | Do not insert a semicolon if the previous token was a binop or a question mark. Change-Id: Id2ee1d3cb57fa3fe20bfc0078d06f9e2619d88f1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix unicode escape sequence validation in strings.Erik Verbruggen2013-01-081-2/+5
| | | | | | | | | | | | | | | | | | Give an error message when the sequence does not conform to the grammar. Note that both \u and \x (without any numbers following it) are not valid escape sequences in ECMA5.1. Change-Id: I14348984c680b0ce86e05faad5630afc1e98cd02 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Merge "Merge branch 'stable' into dev" into refs/staging/devFrederik Gladhorn2013-01-071-25/+25
|\ \
| * | Merge branch 'stable' into devFrederik Gladhorn2013-01-041-25/+25
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/parser/qqmljskeywords_p.h sync.profile tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I9bc6659e1bab924009167bec567354d40a77a8cb
| | * Fix warnings in QtQml due to ?: with enums of different typesThiago Macieira2012-12-231-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | The compiler was complaining a lot about: qml/parser/qqmljskeywords_p.h:400:57: error: enumeral mismatch in conditional expression: 'QQmlJS::Lexer::<anonymous enum>' vs 'QQmlJSGrammar::VariousConstants' [-Werror=enum-compare] Change-Id: Ib6acd3fbae048c33626321bf5e7ee8b50bb6b48e Reviewed-by: Alan Alpert <aalpert@rim.com>
* | | Fix: disallow incomplete hex numbers "0x" and "0X".Erik Verbruggen2013-01-073-2/+10
|/ / | | | | | | | | | | | | See also ECMA 5.1, 7.8.3, rule HexIntegerLiteral. Change-Id: I356dc7cfbc88890bb7f35c8bc4219a37633177f8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Add the getter/setter type to PropertyGetterSetterLars Knoll2013-01-041-2/+8
| | | | | | | | | | | | | | | | Required to differentiatate between getters and setters. Change-Id: I48b2fb911192a8cc5840ff11e31b885f62ac6179 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Added parsing for getter/setter definitions in property assignments.Erik Verbruggen2012-12-1711-1185/+1350
| | | | | | | | | | | | | | Specified in ecma 5.1, 11.1.5. Change-Id: I93d12593534ed8a987922c8aa329124940e77c6f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Don't assume QChar::null() is the end of inputLars Knoll2012-12-111-7/+7
| | | | | | | | | | | | | | | | | | | | The lexer currently assumes a null QChar implies the end of our input stream. Change it to take the full string into account. null QChar's inside comments or strings are now accepted, everywhere else they will cause a parse error. Change-Id: I60c40a32d5afe94c6c56d8a8092fc32726b98420 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | super is always a reserved keywordLars Knoll2012-12-111-1/+1
| | | | | | | | | | | | | | | | According to 7.6.1.2 of the EcmaScript 5.1 spec, super is always a reserved keyword. Change-Id: Idc300326c036eb9f0a12aa8eec8427023b7652b2 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Bail out on stray newlines in strings in JS modeLars Knoll2012-12-111-1/+7
| | | | | | | | | | | | | | | | Still allow newlines in QML mode to keep compatibility for existing code. Change-Id: I11dbd5a73ea8958f5ddc199b77a919969f8a5214 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Don't bail out on 0 chars in commentsLars Knoll2012-12-112-2/+4
| | | | | | | | | | | | | | Gets a few more parser tests in the test suite to pass. Change-Id: Id9ac5211f64aafdd621f6187ad7061ff967bc947 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Parse identifiers according to specLars Knoll2012-12-111-31/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If a unicode escape sequence decodes to a char that is not allowed in the identifier we need to throw a parse error. So decode before checking whether the char is valid. Also fix the set of accepted unicode characters for the start and in the middle of an identifier to what the spec demands. Change-Id: I35075b0587ef4e4edb745750cec6d5c764631c0d Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Throw a parse error on octal numbers and escape sequencesLars Knoll2012-12-111-5/+19
|/ | | | | | | | | | | | | This is compliant with EcmaScript 5.1, where octal numbers and escape sequences are an optional and deprecated part of the syntax. Allow leading 0's in qml mode, but interpret the result as decimal. This is also to keep compatibility with existing code. Change-Id: Ic3450ec3dd17966846751ee688a90c65939ba78f Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Fix escape sequences in lexer: the capital X is not an EscapeCharacter.Erik Verbruggen2012-11-281-1/+0
| | | | | | | | | | The ECMA test suite has a test to check that none of the characters in the English capital alphabet are escapable (S7.8.4_A4.2_T1). Or, put differently, paragraph 7.8.4 states that only the lower-case x is escapable and usable for a HexEscapeSequence. Change-Id: Ie9f73726889ee9e0165c75c9b2e006a9f2b3dbda Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Enable the lexer to run in JS strict/non-strict mode as well as QML modeErik Verbruggen2012-11-273-39/+37
| | | | | | | | | | | | | | If the lexer is running in JS mode (non-qmlMode), then allow for FutureReservedWords as identifiers. Proper strict mode handling of them should be implemented in the semantic phase. QML mode is not affected, so it will reject most FutureReservedWords, and a number of other keywords. See also ECMA-262, version 5.1, paragraph 7.6.1.2. Change-Id: Ide73a041f2dfda2de3b719d6437d517f469eb450 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fixed line terminators to handle LS/PS and CR+LF correctly.Erik Verbruggen2012-11-272-24/+51
| | | | | Change-Id: Ie1cd4d662c80630155e922dce38ea01d8ee2504a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Accept missing semicolon after do-while statement.Erik Verbruggen2012-11-266-865/+945
| | | | | | | | | Although not valid according to ECMA 5.1, both JSC and V8 accept a missing semicolon after a do-while loop. (Both JSC and V8 do not do this through automatic semicolon insertion, but handle it as a special case.) Change-Id: Iff2b07b894564740d2dcbf9b1d46bc279d30b9e3 Reviewed-by: Alan Alpert <aalpert@rim.com>
* Complete QmlJSVisitor for UiParameterListThomas Hartmann2012-10-084-1/+11
| | | | | | | | QmlJS::Visitor was missing the visit for UiParameterList. Change-Id: I3c2cb76b934059ebcef53c1a0faad3f239b33359 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Christian Kamm <kamm@incasoftware.de>
* Fix in QmlJS parser for UiParameterListThomas Hartmann2012-10-012-0/+3
| | | | | | | | | | | | The propertyTypeToken was not initilized in this case. Not having the source location of this token leads to bugs in the tooling. e. g.: QTCREATORBUG-7931 I also added the initializer for program keeping the parser and the grammar in sync. Change-Id: Id7bfb4b6dd1b9689e701a858b6c769d3addab5dc Reviewed-by: Christian Kamm <kamm@incasoftware.de>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2317-435/+435
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Initialize data members in QML engineMartin Jones2012-05-291-0/+1
| | | | | | | | Found by static analysis. None look suspicious, but worthwhile cleaning up. Change-Id: Icb5046eb9e57493a9c68b3509ca0c7f546480b73 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Optimize QML parserMartin Jones2012-05-242-127/+113
| | | | | | | | Inlining and faster number parsing. Reduces parsing of large project from 20.5mil instr to 19mil instr. Change-Id: I83aff3eaf03fd19b07f5e84ec6f9d17b7f0cb931 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Initial bundle supportAaron Kennedy2012-05-041-2/+2
| | | | | Change-Id: I095249f64ecf4ef1e3fbfb164e3d50edffab61e8 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* qMalloc, qFree, qRealloc, qMemCopy, qMemSet are deprecatedOlivier Goffart2012-04-231-4/+4
| | | | | | | | Use the stdlib version directly instead Change-Id: Ifc600f6c418b395c4ada9e5beb207ad3985575e3 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-2418-0/+13266
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>