1 | svoid gazelle_dropMatchedDefaultRules(L<GazelleTree> l, O... _) { |
2 | L<GazelleTree> l2 = filter(l, t -> !eqic(t.lineType, "temporary fact")); |
3 | |
4 | new Set<S> trumpedRules; |
5 | for (GazelleTree t : l2) |
6 | addAll(trumpedRules, matchAll_first("trumps rule *", t.ruleComments())); |
7 | |
8 | L<GazelleTree> trumped = [GazelleTree t : l2 | |
9 | contains(t.ruleComments(), "default") |
10 | || trumpedRules.contains(t.ruleID())]; |
11 | |
12 | if (nempty(trumped) && l(trumped) < l(l2)) { |
13 | if (boolPar debug(_) || boolPar debugDefaults(_)) { |
14 | print("Removing default/trumped rules:"); |
15 | printIndentLines(trumped); |
16 | print("Because there are also:"); |
17 | printIndentLines(listMinusSet(l2, trumped)); |
18 | } |
19 | l.removeAll(trumped); |
20 | } |
21 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1021801 |
Snippet name: | gazelle_dropMatchedDefaultRules (and trumped) |
Eternal ID of this version: | #1021801/10 |
Text MD5: | 248dbe6a5b448e791037f31b8ad2b51e |
Author: | stefan |
Category: | javax / gazelle |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-03-12 11:25:30 |
Source code size: | 750 bytes / 21 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 316 / 362 |
Version history: | 9 change(s) |
Referenced in: | [show references] |