Exemplo n.º 1
0
 public static byte[] Eval_val_or(
     Xop_ctx ctx,
     byte[] src,
     Xot_invk caller,
     Xot_invk self,
     int self_args_len,
     int i,
     byte[] or) {
   if (i >= self_args_len) return or;
   Bry_bfr bfr = Bry_bfr_.New();
   Arg_nde_tkn nde = self.Args_get_by_idx(i);
   nde.Val_tkn().Tmpl_evaluate(ctx, src, caller, bfr);
   return bfr.To_bry_and_clear_and_trim();
 }
Exemplo n.º 2
0
 public static void Eval_arg_or(
     Bry_bfr bfr,
     Xop_ctx ctx,
     byte[] src,
     Xot_invk caller,
     Xot_invk self,
     Arg_nde_tkn nde,
     byte[] or) {
   nde.Key_tkn()
       .Tmpl_evaluate(
           ctx, src, caller,
           bfr); // NOTE: must add key b/c parser functions do not have keys and some usages pass
   // in xml_tkns; EX: {{#if|<a href='{{{1}}}'|}}; "<a href" should not be
   // interpreted as key
   if (nde.KeyTkn_exists()) bfr.Add_byte(Byte_ascii.Eq);
   nde.Val_tkn().Tmpl_evaluate(ctx, src, caller, bfr);
 }