Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

41
LINES

< > BotCompany Repo | #1021761 // Gazelle Fakery Include [for test cases]

JavaX fragment (include)

static new L<T3<S>> rules; // text, comment, ID
static new L<GazelleFulfillment> fulfillments;
static new LinkedHashSet<S> temporaryFacts;

static L<T3<S>> dm_allRulesFromRulesModuleWithCommentsAndIDs() {
  ret rules;
}

svoid dm_gazelle_setRuleComments_verbose(S ruleID, S comments) {
  set(objectWhere(rules, c := ruleID), b := comments);
}

static PairS dm_textAndCommentForRule(S ruleID) {
  T3<S> t = objectWhere(rules, c := ruleID);
  ret t == null ? null : pair(t.a, t.b);
}

static Pair<S, Bool> dm_gazelle_addRuleWithComment(S text, S comment) {
  T3<S> t = objectWhere(rules, a := text, b := comment);
  if (t != null) ret pair(t.c, false);
  S id = aGlobalID();
  rules.add(t3(text, comment, id));
  ret pair(id, true);
}

static L dm_gazelle_fulfillmentsForRule(S ruleID) {
  ret objectsWhere(fulfillments, rule := ruleID);
}

static GazelleEvalContext dm_gazelle_stdEvalContext() {
  ret dm_gazelle_stdEvalContext(dm_allRulesFromRulesModuleWithCommentsAndIDs());
}

static GazelleEvalContext dm_gazelle_stdEvalContext(L<T3<S>> rules) {
  ret gazelle_stdEvalContext(rules);
}

sS dm_gazelle_addTempFact(S text) {
  temporaryFacts.add(text);
  ret aGlobalID();
}

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): ayivmpnvhhik, bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021761
Snippet name: Gazelle Fakery Include [for test cases]
Eternal ID of this version: #1021761/4
Text MD5: 610716c64198b1ae4c34732b73359ff1
Author: stefan
Category: javax / gazelle
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-28 09:17:23
Source code size: 1213 bytes / 41 lines
Pitched / IR pitched: No / No
Views / Downloads: 376 / 2121
Version history: 3 change(s)
Referenced in: [show references]