From 89b9a8ac7250e2fa0d6fb386a1ca6a7032b087a7 Mon Sep 17 00:00:00 2001 From: nightwing Date: Mon, 20 Apr 2015 18:25:32 +0400 Subject: [PATCH] address review comments --- lib/ace/edit_session/bracket_match.js | 4 ++-- tool/lib.js | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/ace/edit_session/bracket_match.js b/lib/ace/edit_session/bracket_match.js index b1638e81..62a8499c 100644 --- a/lib/ace/edit_session/bracket_match.js +++ b/lib/ace/edit_session/bracket_match.js @@ -117,7 +117,7 @@ function BracketMatch() { typeRe = new RegExp( "(\\.?" + token.type.replace(".", "\\.").replace("rparen", ".paren") - .replace(/\b(?:end)\b/, "(?:start|begin)") + .replace(/\b(?:end)\b/, "(?:start|begin|end)") + ")+" ); } @@ -174,7 +174,7 @@ function BracketMatch() { typeRe = new RegExp( "(\\.?" + token.type.replace(".", "\\.").replace("lparen", ".paren") - .replace(/\b(?:start|begin)\b/, "end") + .replace(/\b(?:start|begin)\b/, "(?:start|begin|end)") + ")+" ); } diff --git a/tool/lib.js b/tool/lib.js index 53f38a75..8809595c 100644 --- a/tool/lib.js +++ b/tool/lib.js @@ -12,11 +12,13 @@ exports.parsePlist = function(xmlOrJSON, callback) { plist.parseString(xmlOrJSON, function(_, result) { json = result[0]; }); - } else try { - xmlOrJSON = xmlOrJSON.replace(/^\s*\/\/.*/gm, ""); - json = JSON.parse(xmlOrJSON) - } catch(e) { - json = cson.parse(xmlOrJSON); + } else { + try { + xmlOrJSON = xmlOrJSON.replace(/^\s*\/\/.*/gm, ""); + json = JSON.parse(xmlOrJSON) + } catch(e) { + json = cson.parse(xmlOrJSON); + } } callback && callback(json); return json;