1 | svoid dm_gazelle_wireStatementConditions() { |
2 | for (T3<S> t : dm_gazelle_allRulesWithComment("in 2 = statement")) |
3 | dm_gazelle_wireStatementConditions(/*assertGlobalID*/(t.c)); |
4 | } |
5 | |
6 | svoid dm_gazelle_wireStatementConditions(S ruleID) pcall { |
7 | PairS p = dm_textAndCommentForRule(ruleID); |
8 | LS lines = tlft(p.a); |
9 | new Matches m; |
10 | LS comments = lines(p.b); |
11 | bool change = false; |
12 | for i over comments: { |
13 | if (match("in * = statement", comments.get(i), m)) { |
14 | int line = parseInt($1); |
15 | S s = dropPrefixTrim("+", get(lines, line-1)); |
16 | if (empty(s) || startsWith(s, "=>")) continue; // avoid any weird stuff |
17 | S ruleID2 = dm_gazelle_findRuleForStatementCondition(s); |
18 | if (ruleID2 == null) { |
19 | print("No statement rule found for: " + s + ", making one"); |
20 | ruleID2 = pairA(dm_gazelle_addRuleWithComment(s + "\n=> statement", "in = statement\n" + "made for rule " + ruleID + "\n" + p.b); |
21 | } |
22 | comments.set(i, "in " + line + " = statement " + ruleID2); |
23 | set change; |
24 | } |
25 | } |
26 | if (change) |
27 | dm_gazelle_setRuleComments_verbose(ruleID, lines(comments)); |
28 | } |
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, whxojlpjdney
No comments. add comment
Snippet ID: | #1021748 |
Snippet name: | dm_gazelle_wireStatementConditions |
Eternal ID of this version: | #1021748/12 |
Text MD5: | 8be345a4b9d537be140d8b3a5ce7d1c8 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-03-04 13:00:48 |
Source code size: | 1130 bytes / 28 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 329 / 381 |
Version history: | 11 change(s) |
Referenced in: | [show references] |