1 | svoid gazelle_splitMultiRule_v2(S ruleID) { |
2 | PairS p = dm_textAndCommentForRule(ruleID); |
3 | if (p == null || !cic(p.b, "multi-rule")) ret; |
4 | |
5 | LPair<S> lines = ai_findDoubleArrowRulesAsPairs(p.a); |
6 | Set<S> textsNeeded = asSet(mapPairsToList gazelle_constructRuleText(lines)); |
7 | S extractedComment = "extracted from multi-rule " + ruleID; |
8 | S deployedPrefix = "deployed as rule "; |
9 | LS allComments = tlft(p.b); |
10 | LS coreComments = listWithoutIC(allComments, "multi-rule"); |
11 | |
12 | L<T3S> rules = dm_gazelle_allRulesWithComment(extractedComment); |
13 | LS coreComments2 = withoutStartingWithIC(coreComments, deployedPrefix); |
14 | S commentsForDeployed = lines_rtrim(listPlus(coreComments2, extractedComment)); |
15 | new LS deployed; |
16 | for (T3S t : rules) |
17 | if (!textsNeeded.remove(t.a)) |
18 | gazelle_deleteRule(t.c); |
19 | else { |
20 | gazelle_setRuleComment(t.c, commentsForDeployed); |
21 | deployed.add(t.c); |
22 | } |
23 | for (S text : textsNeeded) |
24 | deployed.add(dm_gazelle_addRuleWithComment(text, commentsForDeployed).a); |
25 | LS allComments2 = withoutStartingWithIC(allComments, deployedPrefix); |
26 | for (S deployedID : deployed) |
27 | allComments2.add(deployedPrefix + deployedID); |
28 | gazelle_setRuleComment(ruleID, allComments2); |
29 | } |
Began life as a copy of #1022337
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, lnbujpyubztb, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1022430 |
Snippet name: | gazelle_splitMultiRule_v2 (should have same functionality) |
Eternal ID of this version: | #1022430/5 |
Text MD5: | 665542796d6159b74b4d4dc32a2a31d1 |
Author: | stefan |
Category: | javax / gazelle |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-03-17 11:12:54 |
Source code size: | 1242 bytes / 29 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 276 / 285 |
Version history: | 4 change(s) |
Referenced in: | [show references] |