aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/parser/qdeclarativejslexer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-1166/+0
| | | | | | | | | | | | | 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>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: If39bd256b0fa85eba17ea30f8ab87ea27d758908 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improve parsing of escape characters and regexp literals.Roberto Raggi2011-12-061-0/+5
| | | | | | | | | | | | | | | | | | | | | That is, in QML/JS you can escape characters in identifiers, e.g. var c\u0061se = 25 declares a variable called `case' with value 25. In such cases qmlmin needs to preserve the escape sequence in the declaration. Also, fix possible errors when pasting keywords after regexp literals. The minifier needs to preserve the whitespace character after the regexp delimiter, e.g. /x/instanceof blah without the white space after the regexp, the `i' of `instanceof' is parsed as a regexp flag. Change-Id: I5f426ac62949e34d092d4fdb0a41243de8ff2236 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Fix parsing of unary expressions.Roberto Raggi2011-11-141-2/+3
| | | | | | | | | | | | | | | | | | | | Prohibit the lexer to synthesize a semicolon token after the colon-sign of a binding declaration. The parser internally was rewriting the following bindings Component.onCompleted: ++foo as Component.onCompleted: ; ++foo Task-number: QTBUG-21310 Change-Id: I0558d17fd81b5abac81fb990502d49767ea40730 Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com> Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Fix processing of unary T_MINUS_MINUS tokens after semicolon insertion.Roberto Raggi2011-09-211-1/+1
| | | | | | | | | | There was a typo in the code, instead of pushing a T_MINUS_MINUS token the lexer synthesized a T_PLUS_PLUS. Change-Id: I62dcf263ac363196231fe8f02e98f280899ef85a Reviewed-on: http://codereview.qt-project.org/5293 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
* Move JS RegExp flag definitions to header fileKent Hansen2011-09-191-11/+5
| | | | | | | | | | This way they can be used by tools that use the lexer (e.g. qml minifier). Change-Id: I226d1712089b01defd3b45ccb99db596955bff8b Reviewed-on: http://codereview.qt-project.org/4762 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix typo when recognizing escape charactersRoberto Raggi2011-09-191-1/+1
| | | | | | | Change-Id: Id97d5c12d271794fb9c7c752fd6535af90883eb4 Reviewed-on: http://codereview.qt-project.org/4770 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Add the method tokenKind() to the QML/JS lexer.Roberto Raggi2011-09-191-0/+5
| | | | | | | | | The method returns the last token recognized by the lexer. Change-Id: I9464e96c1276852737ddc8330d08d57326b48888 Reviewed-on: http://codereview.qt-project.org/5015 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Add support for QML/JS pragma directives.Roberto Raggi2011-09-191-0/+96
| | | | | | | | | | | | | The lexer can now recognize the following pragma directives: .pragma library .import <URI> <Version> as <Identifier> .import <file.js> as <Identifier> Change-Id: I2c44140818f356419640266a46b5e172474819ee Reviewed-on: http://codereview.qt-project.org/4897 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Fix automatic semicolon insertion.Roberto Raggi2011-09-191-0/+18
| | | | | | | | | | The parser should insert a T_SEMICOLON token when it reaches an error state and the lookahead token is following a closing brace. Change-Id: Ib849e7fbfe50c2a3e679ae0794f5780cc0b94de5 Reviewed-on: http://codereview.qt-project.org/4896 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Fix the implementation of Lexer::tokenText().Roberto Raggi2011-09-191-7/+10
| | | | | | | | | | Lexer::tokenText() should return the contents of the string literal without the quotes. Change-Id: I968ca2e5142d8c55c75990c24380d2faa9b313a3 Reviewed-on: http://codereview.qt-project.org/4440 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Introduced a QML scanning mode.Roberto Raggi2011-09-191-2/+4
| | | | | | | | | | In QML mode, the lexer will recognize the extra QML keywords, e.g. readonly, as, on, and so on. Change-Id: I148ff857e201f99d41e0265bcfc480a94a1085a0 Reviewed-on: http://codereview.qt-project.org/4518 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Get rid of QDeclarativeUtilsKent Hansen2011-09-191-19/+18
| | | | | | | | | | | All the QChar methods needed by QtDeclarative have now been optimized to achieve at least as good performance as the QDeclarativeUtils versions. Change-Id: I5b8dd58f9b597f716b53563d07d39d894c5dd666 Reviewed-on: http://codereview.qt-project.org/5059 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Collect the source locations of the single and multiline comments.Roberto Raggi2011-08-301-0/+10
| | | | | | | Change-Id: I7a8f2eec7a45f7a9a1212680f477cc5edd2aaad5 Reviewed-on: http://codereview.qt.nokia.com/3796 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Fix parsing of numeric literals.Roberto Raggi2011-08-301-1/+1
| | | | | | | | | Store the value in a double. Change-Id: I17b90d2917a2710d434a92b5f6b297f755156c31 Reviewed-on: http://codereview.qt.nokia.com/3788 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Fix the computation of the start token position.Roberto Raggi2011-08-301-3/+5
| | | | | | | | Rewind the buffer pointer only when necessary. Change-Id: Idd78edc068b1c55d79c5674facd9c55270e536a8 Reviewed-on: http://codereview.qt.nokia.com/3787 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Recompute the token length after the scan of a regexp.Roberto Raggi2011-08-301-0/+2
| | | | | | | Change-Id: I9042f261b374bee1a3f9cb8d2dc40e381a66732b Reviewed-on: http://codereview.qt.nokia.com/3781 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Fix possible crash when using the QML lexer without an engine.Roberto Raggi2011-08-301-8/+10
| | | | | | | Change-Id: Ia7d820cf1a63eaf42041ab78e1f111d31358e4dd Reviewed-on: http://codereview.qt.nokia.com/3779 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Remove deprecated QChar to ushort conversions.Roberto Raggi2011-08-301-5/+5
| | | | | | | Change-Id: I2411d2221e70685d1a1518e2f5eb2e693261e00d Reviewed-on: http://codereview.qt.nokia.com/3775 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Special case integers and strings in lexerAaron Kennedy2011-08-301-1/+37
| | | | | | | | | Reduces the amount of copying for integer numbers and uses a raw QStringRef for unescaped strings. Change-Id: I2ad29f4c67be72495e3209081761b9a1bb503f26 Reviewed-on: http://codereview.qt.nokia.com/3773 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Removed QDeclarativeJS::NodePoolRoberto Raggi2011-08-301-1/+2
| | | | | | | Change-Id: I69d39ef005900803f6c620ea8f1ca00d054dc8d2 Reviewed-on: http://codereview.qt.nokia.com/3757 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Some lexer improvement, mostly by avoiding QChar::isWhatever()Martin Jones2011-08-301-47/+53
| | | | | | | Change-Id: I330a45a2f611a594d9b0e9bb24ebef028654a8d8 Reviewed-on: http://codereview.qt.nokia.com/3756 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Improved parsing of numeric literalsRoberto Raggi2011-08-301-16/+83
| | | | | | | Change-Id: Id02b5b0b0ab590b7ea5d20098472459e1fd986a6 Reviewed-on: http://codereview.qt.nokia.com/3755 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Improve performance of the QML front-endAaron Kennedy2011-08-301-1071/+730
| | | | | | | | | | | Introduced a new lexer and a more efficient representation of the AST. Instead of creating unique name ids, we simply use QStringRef(s). Change-Id: I403472fa2bb74d2c87dd6314065306499677a3bf Authored-by: Roberto Raggi Reviewed-on: http://codereview.qt.nokia.com/3750 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Merge branch 'qtquick2'Martin Jones2011-05-311-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/declarative/flickr/common/Progress.qml demos/declarative/flickr/common/RssModel.qml demos/declarative/flickr/common/ScrollBar.qml demos/declarative/flickr/common/Slider.qml demos/declarative/flickr/mobile/Button.qml demos/declarative/flickr/mobile/GridDelegate.qml demos/declarative/flickr/mobile/ImageDetails.qml demos/declarative/flickr/mobile/ListDelegate.qml demos/declarative/flickr/mobile/TitleBar.qml demos/declarative/flickr/mobile/ToolBar.qml demos/declarative/webbrowser/content/Button.qml demos/declarative/webbrowser/content/FlickableWebView.qml demos/declarative/webbrowser/content/Header.qml demos/declarative/webbrowser/content/ScrollBar.qml demos/declarative/webbrowser/content/UrlInput.qml demos/declarative/webbrowser/webbrowser.qml doc/src/snippets/declarative/mousearea/mousearea-snippet.qml examples/declarative/modelviews/webview/newwindows/qml/alerts.html examples/declarative/modelviews/webview/newwindows/qml/content/Mapping/map.html examples/declarative/modelviews/webview/newwindows/qml/content/pics/cancel.png examples/declarative/modelviews/webview/newwindows/qml/content/pics/ok.png examples/declarative/modelviews/webview/newwindows/qml/newwindows.html src/declarative/graphicsitems/qdeclarativetextinput.cpp src/declarative/qml/qdeclarativecompiledbindings.cpp src/declarative/qml/qdeclarativecompiledbindings_p.h src/declarative/qml/qdeclarativedom.cpp src/declarative/qml/qdeclarativedom_p.h src/declarative/qml/qdeclarativedom_p_p.h src/declarative/qml/qdeclarativeengine.cpp src/declarative/qml/qdeclarativetypeloader.cpp src/imports/particles/particles.cpp tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp tests/auto/declarative/qmlvisual/qdeclarativeflickable/data/flickable-horizontal.4.png tests/auto/declarative/qmlvisual/qdeclarativepathview/data/test-pathview.6.png tests/auto/declarative/qmlvisual/qdeclarativepositioners/data/usingRepeater.0.png tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.0.png tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.1.png tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.2.png tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.3.png tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.4.png tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.5.png tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.6.png tests/auto/declarative/qmlvisual/qdeclarativespringanimation/data/follow.7.png tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-MAC/multilineAlign.0.png tests/auto/declarative/qmlvisual/qdeclarativetext/align/data-X11/multilineAlign.0.png tests/auto/declarative/qmlvisual/qdeclarativetext/baseline/data-X11/parentanchor.0.png tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.0.png tests/auto/declarative/qmlvisual/qdeclarativetext/data-MAC/qtbug_14865.1.png tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.0.png tests/auto/declarative/qmlvisual/qdeclarativetext/data-X11/qtbug_14865.1.png tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide.1.png tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.0.png tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/elide2.1.png tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.1.png tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.2.png tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.3.png tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.4.png tests/auto/declarative/qmlvisual/qdeclarativetext/elide/data-X11/multilength.5.png tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext2.0.png tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-MAC/plaintext3.0.png tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext.0.png tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/plaintext2.0.png tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext.0.png tests/auto/declarative/qmlvisual/qdeclarativetext/font/data-X11/richtext2.0.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.0.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.1.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.10.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.11.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.2.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.3.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.4.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.5.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.6.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.7.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.8.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/usingMultilineEdit.9.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.0.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.1.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.2.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.3.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.4.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.5.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-MAC/wrap.6.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.0.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.1.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.2.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.3.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/qt-669.4.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.10.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.11.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.12.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.7.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/usingMultilineEdit.9.png tests/auto/declarative/qmlvisual/qdeclarativetextedit/data-X11/wrap.7.png tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.0.png tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.1.png tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-MAC/echoMode.2.png tests/auto/declarative/qmlvisual/qdeclarativetextinput/data-X11/usingLineEdit.11.png tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp Change-Id: I40df8a9403a58a6c03a0f1734f16a5cbed6c85ff
| * Fix wrong usages of #include directives in the QML/JS parser.Roberto Raggi2011-05-091-4/+4
| | | | | | | | Reviewed-by: Aaron Kennedy
* | Update licenseheader text in source files for qtdeclarative Qt moduleJyri Tahtela2011-05-241-17/+17
|/ | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+1258
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12