Pārlūkot izejas kodu

HUE-1999 [beeswax] Update multi query separation algorithm

Updated according to the py counterpart
Updated code style
Enrico Berti 11 gadi atpakaļ
vecāks
revīzija
42812d9
1 mainītis faili ar 7 papildinājumiem un 9 dzēšanām
  1. 7 9
      apps/beeswax/src/beeswax/templates/execute.mako

+ 7 - 9
apps/beeswax/src/beeswax/templates/execute.mako

@@ -1308,26 +1308,24 @@ $(document).ready(function () {
   function splitStatements(hql) {
     var statements = [];
     var current = "";
-    var prev = "";
-    var between_quotes = null;
+    var betweenQuotes = null;
     for (var i = 0, len = hql.length; i < len; i++) {
       var c = hql[i];
       current += c;
-      if ($.inArray(c, ['"', "'"]) > -1 && prev != "\\") {
-        if (between_quotes == c) {
-          between_quotes = null;
+      if ($.inArray(c, ['"', "'"]) > -1) {
+        if (betweenQuotes == c) {
+          betweenQuotes = null;
         }
-        else if (between_quotes == null) {
-          between_quotes = c;
+        else if (betweenQuotes == null) {
+          betweenQuotes = c;
         }
       }
       else if (c == ";") {
-        if (between_quotes == null) {
+        if (betweenQuotes == null) {
           statements.push(current);
           current = "";
         }
       }
-      prev = c;
     }
 
     if (current != "" && current != ";") {