From e130dc3fbbb8e5abc514d65310d6b867f9167b7a Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 17 Jan 2013 14:45:16 +0100 Subject: [PATCH] =?UTF-8?q?[loose=20parser]=20Use=20=E2=9C=96=20rather=20t?= =?UTF-8?q?han=20question=20mark=20for=20placeholders?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way, attempts to re-parse the pretty-printed code won't be confused by the question marks. --- acorn_loose.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index 70f2397457..ed0c30b2c0 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -13,7 +13,7 @@ // - Label consistency (no conflicts, break only to existing labels) // is not enforced. // -// - Bogus Identifier nodes with a name of `"?"` are inserted whenever +// - Bogus Identifier nodes with a name of `"✖"` are inserted whenever // the parser got too confused to return anything meaningful. // // [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API @@ -82,7 +82,7 @@ throw e; } resetTo(pos); - if (replace) return {start: pos, end: pos, type: tt.name, value: "?"}; + if (replace) return {start: pos, end: pos, type: tt.name, value: "✖"}; } } } @@ -157,10 +157,10 @@ var dummy = new node_t(0); dummy.type = "Identifier"; dummy.end = 0; - dummy.name = "?"; + dummy.name = "✖"; return dummy; } - function isDummy(node) { return node.name == "?"; } + function isDummy(node) { return node.name == "✖"; } function eat(type) { if (token.type === type) {