|
53 | 53 | *
|
54 | 54 | * Exports:
|
55 | 55 | *
|
56 |
| - * - QMLBinding(src, tree) to pass qml bindings along. |
57 |
| - * |
58 | 56 | * - parseQML(src) -- parses QML source and returns it as output tree expected
|
59 | 57 | * 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. |
63 | 58 | */
|
64 | 59 |
|
65 | 60 | // Object cloning for debug prints.
|
@@ -276,7 +271,7 @@ function QMLParseError(message, line, col, pos, comment) {
|
276 | 271 | this.pos = pos;
|
277 | 272 | this.comment = comment ? comment : "";
|
278 | 273 | this.message = message + " (line: " + line + ", col: " + col + ", pos: " + pos + ")" + "\n" + comment + "\n"
|
279 |
| - this.file = nowParsingFile; |
| 274 | + this.file = qmlweb_parse.nowParsingFile; |
280 | 275 | try {
|
281 | 276 | ({})();
|
282 | 277 | } catch(ex) {
|
@@ -696,6 +691,7 @@ function NodeWithToken(str, start, end) {
|
696 | 691 |
|
697 | 692 | NodeWithToken.prototype.toString = function() { return this.name; };
|
698 | 693 |
|
| 694 | +qmlweb_parse.nowParsingFile = ''; // TODO: make a parameter of qmlweb_parse |
699 | 695 | qmlweb_parse.QMLDocument = 1;
|
700 | 696 | qmlweb_parse.JSResource = 2;
|
701 | 697 | function qmlweb_parse($TEXT, document_type, exigent_mode, embed_tokens) {
|
@@ -1562,3 +1558,7 @@ function HOP(obj, prop) {
|
1562 | 1558 | };
|
1563 | 1559 |
|
1564 | 1560 | var warn = function() {};
|
| 1561 | + |
| 1562 | +if (typeof global != "undefined") { |
| 1563 | + global.qmlweb_parse = qmlweb_parse; |
| 1564 | +} |
0 commit comments