Skip to content

Commit 17175b2

Browse files
committed
parser: Move QML runtime elements to qmlstructure.js
Code moved to qmlstructure.js wasn't inherited from UglifyJS, so the copyrights are updated accordingly. To see which exact code was based on UglifyJS, see the https://github.com/qmlweb/qmlweb-parser repository, which contains the parser rebased on the original UglifyJS version. PR-URL: qmlweb/qmlweb#215 Reviewed-By: Michael Martin Moro <[email protected]>
1 parent 9db467e commit 17175b2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/parser.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,8 @@
5353
*
5454
* Exports:
5555
*
56-
* - QMLBinding(src, tree) to pass qml bindings along.
57-
*
5856
* - parseQML(src) -- parses QML source and returns it as output tree expected
5957
* by the QML engine
60-
*
61-
* - qmlweb_parse(src) -- parses QML or JS source and returns tree a la uglifyjs parser.
62-
* Currently used for debugging purposes.
6358
*/
6459

6560
// Object cloning for debug prints.
@@ -276,7 +271,7 @@ function QMLParseError(message, line, col, pos, comment) {
276271
this.pos = pos;
277272
this.comment = comment ? comment : "";
278273
this.message = message + " (line: " + line + ", col: " + col + ", pos: " + pos + ")" + "\n" + comment + "\n"
279-
this.file = nowParsingFile;
274+
this.file = qmlweb_parse.nowParsingFile;
280275
try {
281276
({})();
282277
} catch(ex) {
@@ -696,6 +691,7 @@ function NodeWithToken(str, start, end) {
696691

697692
NodeWithToken.prototype.toString = function() { return this.name; };
698693

694+
qmlweb_parse.nowParsingFile = ''; // TODO: make a parameter of qmlweb_parse
699695
qmlweb_parse.QMLDocument = 1;
700696
qmlweb_parse.JSResource = 2;
701697
function qmlweb_parse($TEXT, document_type, exigent_mode, embed_tokens) {
@@ -1562,3 +1558,7 @@ function HOP(obj, prop) {
15621558
};
15631559

15641560
var warn = function() {};
1561+
1562+
if (typeof global != "undefined") {
1563+
global.qmlweb_parse = qmlweb_parse;
1564+
}

0 commit comments

Comments
 (0)