From 9c57108a595684e20030a8bebb11ae3d9f980f5f Mon Sep 17 00:00:00 2001 From: nick Date: Wed, 16 Aug 2023 07:37:55 +0300 Subject: [PATCH 1/2] tbel: add break to for, foreach --- pom.xml | 2 +- ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index df8c6ed8d6..de4baadb8a 100755 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 3.8.1 3.21.9 1.42.1 - 1.0.7 + 1.0.8 1.18.18 1.2.4 1.2.5 diff --git a/ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js b/ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js index d1d47d0c75..9aeaa1e568 100644 --- a/ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js +++ b/ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js @@ -4656,6 +4656,7 @@ var JSHINT = (function() { case "else": case "finally": case "for": + case "foreach": case "if": case "in": case "instanceof": @@ -8135,7 +8136,7 @@ var JSHINT = (function() { state.funct["(breakage)"] += 1; state.funct["(loopage)"] += 1; - state.funct["(breakage)"] -= 1; + // state.funct["(breakage)"] -= 1; state.funct["(loopage)"] -= 1; } else { nolinebreak(state.tokens.curr); @@ -9755,7 +9756,7 @@ Lexer.prototype = { scanKeyword: function() { var result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input); var keywords = [ - "if", "in", "do", "var", "for", "new", + "if", "in", "do", "var", "for", "foreach", "new", "try", "let", "this", "else", "case", "void", "with", "enum", "while", "break", "catch", "throw", "const", "yield", "class", From a836b4eba4358a5294e85681ef960acbd3b2f8eb Mon Sep 17 00:00:00 2001 From: nick Date: Wed, 16 Aug 2023 18:08:02 +0300 Subject: [PATCH 2/2] tbel: add break to for, foreach, while, do, doUntil --- .../app/shared/models/ace/tbel/worker-tbel.js | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js b/ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js index 9aeaa1e568..ec4133da2a 100644 --- a/ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js +++ b/ui-ngx/src/app/shared/models/ace/tbel/worker-tbel.js @@ -4661,6 +4661,7 @@ var JSHINT = (function() { case "in": case "instanceof": case "return": + case "until": case "switch": case "throw": case "try": @@ -5388,6 +5389,7 @@ var JSHINT = (function() { } switch (state.funct["(verb)"]) { case "break": + case "until": case "continue": case "return": case "throw": @@ -7692,6 +7694,20 @@ var JSHINT = (function() { return this; }).labelled = true; + blockstmt("until", function(context) { + var t = state.tokens.next; + state.funct["(breakage)"] += 1; + state.funct["(loopage)"] += 1; + increaseComplexityCount(); + advance("("); + checkCondAssignment(expression(context, 0)); + advance(")", t); + block(context, true, true); + state.funct["(breakage)"] -= 1; + state.funct["(loopage)"] -= 1; + return this; + }).labelled = true; + blockstmt("with", function(context) { var t = state.tokens.next; if (state.isStrict()) { @@ -7841,7 +7857,12 @@ var JSHINT = (function() { increaseComplexityCount(); this.first = block(context, true, true); - advance("while"); + var s = state.tokens.next; + if (s.value !== "while") { + advance("until"); + } else { + advance("while"); + } var t = state.tokens.next; advance("("); checkCondAssignment(expression(context, 0)); @@ -9758,7 +9779,7 @@ Lexer.prototype = { var keywords = [ "if", "in", "do", "var", "for", "foreach", "new", "try", "let", "this", "else", "case", - "void", "with", "enum", "while", "break", + "void", "with", "enum", "while", "until", "break", "catch", "throw", "const", "yield", "class", "super", "return", "typeof", "delete", "switch", "export", "import", "default",