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

20
LINES

< > BotCompany Repo | #1015762 // checkStandardFunctionForSafety (OLD)

JavaX fragment (include)

sS checkStandardFunctionForSafety(S fname) {
  S listName = "JavaX Identifier Safety";
  Set<S> identifiers = setMinus(tok_allIdentifiers(textOfStandardFunction(fname)), fname);
  
  // TODO: should lock on map
  Set<S> statuses = treeSet();
  final SS map = mechHashMap_fresh(listName);
  bool changes = false;
  for (S id : identifiers) {
    S status = map.get(id);
    if (status == null)
      if (mapPut_trueIfChanged(map, id, status = "?")) set changes;
    statuses.addAll(tokSplitAtComma(status));
  }
  S status = or2(joinWithComma(simplifySafetyTags(statuses)), "?");
  if (mapPut_trueIfChanged(map, fname, status)) set changes;
  if (changes)
    uploadMechMap(listName, map);
  ret status;
}

Author comment

Began life as a copy of #1015756

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1015762
Snippet name: checkStandardFunctionForSafety (OLD)
Eternal ID of this version: #1015762/8
Text MD5: c39cdf318dea712a5f0eec727ab10010
Author: stefan
Category: javax / code analysis
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-06 07:42:29
Source code size: 723 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 459 / 503
Version history: 7 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1018160 - getCodeFragmentSafety - "S1" safety checker (simply identifier based, fixed allowed list)
#1032799 - checkStandardFunctionDefinitionForSafety