Exemple #1
0
 CppiaExpr *link(CppiaModule &inData)
 {
    strVal = strVal->link(inData);
    sought = sought->link(inData);
    start = start->link(inData);
    return this;
 }
Exemple #2
0
 hx::Object *runObject(CppiaCtx *ctx)
 {
    String val = strVal->runString(ctx);
    BCR_CHECK;
    String separator = a0->runString(ctx);
    BCR_CHECK;
    return val.split(separator).mPtr;
 }
Exemple #3
0
 String runString(CppiaCtx *ctx)
 {
    String val = strVal->runString(ctx);
    BCR_CHECK;
    int start = a0->runInt(ctx);
    BCR_CHECK;
    Dynamic end = a1->runObject(ctx);
    BCR_CHECK;
    if (SUBSTR)
       return val.substr(start,end);
    else
       return val.substring(start,end);
 }
Exemple #4
0
 int runInt(CppiaCtx *ctx)
 {
    String val = strVal->runString(ctx);
    BCR_CHECK;
    String s = sought->runString(ctx);
    BCR_CHECK;
    hx::Object *first = start->runObject(ctx);
    BCR_CHECK;
    if (LAST)
       return val.lastIndexOf(s,first);
    else
       return val.indexOf(s,first);
 }
Exemple #5
0
 String runString(CppiaCtx *ctx)
 {
    String val = strVal->runString(ctx);
    BCR_CHECK;
    int idx = a0->runInt(ctx);
    BCR_CHECK;
    return val.charAt(idx);
 }
Exemple #6
0
 int runInt(CppiaCtx *ctx)
 {
    //printf("Char code at %d INT\n", CODE);
    String val = strVal->runString(ctx);
    BCR_CHECK;
    int idx = a0->runInt(ctx);
    BCR_CHECK;
    return val.charCodeAt(idx);
 }
Exemple #7
0
   hx::Object *runObject(CppiaCtx *ctx)
   {
      String val = strVal->runString(ctx);
      BCR_CHECK;
      int idx = a0->runInt(ctx);
      BCR_CHECK;

      if (CODE)
         return val.charCodeAt(idx).mPtr;
      else
         return Dynamic(val.charAt(idx)).mPtr;
   }
Exemple #8
0
   int runInt(CppiaCtx *ctx)
   {
      //printf("Char code at %d INT\n", CODE);
      String val = strVal->runString(ctx);
      BCR_CHECK;
      int idx = a0->runInt(ctx);
      BCR_CHECK;

      if (AS_INT)
         return (int)( ((unsigned char *)val.__s) [idx]);
      else
         return val.charCodeAt(idx);
   }
Exemple #9
0
   hx::Object *runObject(CppiaCtx *ctx)
   {
      String val = strVal->runString(ctx);
      BCR_CHECK;
      int idx = a0->runInt(ctx);
      BCR_CHECK;

      if (CODE)
      {
         if (AS_INT)
            return Dynamic( (int)( ((unsigned char *)val.__s) [idx]) ).mPtr;
         else
            return val.charCodeAt(idx).mPtr;
      }
      else
         return Dynamic(val.charAt(idx)).mPtr;
   }
Exemple #10
0
 CppiaExpr *link(CppiaModule &inData)
 {
    a0 = a0->link(inData);
    return StringExpr::link(inData);
 }
Exemple #11
0
 CppiaExpr *link(CppiaModule &inData)
 {
    strVal = strVal->link(inData);
    return this;
 }