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

15
LINES

< > TinyBrain | #1008912 - ctxEvalCondition

JavaX fragment (include)

static bool ctxEvalCondition(S cond) {
  cond = ctxUnbracket(cond);
  L<S> tok = javaTok(cond);
  S t = get(tok, 1);
  if (isQuoted(t))
    ret ctxEvalPattern(unquoteCtx(t));
  if (isIdentifier(t) && (
    l(tok) == 9 && eqGet(tok, 3, "=") && eqGet(tok, 5, "=") && eqGetIC(tok, 7, "true")
    || l(tok) == 3))
    ret eqic(t, "TRUE") || eqic(ctxGetVar(t), "TRUE");
  Bool b = woodyEvalTimeCondition(cond);
  if (b != null) ret b;
  CtxExpr exp = ctxParseExpression(cond);
  ret exp.get();
}

download  show line numbers  debug dex   

Travelled to 2 computer(s): cfunsshuasjs, tvejysmllsmz

No comments. add comment

Snippet ID: #1008912
Snippet name: ctxEvalCondition
Eternal ID of this version: #1008912/15
Text MD5: 5cfac0fd2a197a0773d84384c91fb44f
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-22 19:50:26
Source code size: 504 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 37 / 43
Version history: 14 change(s)
Referenced in: [show]