Examples of luaByte()


Examples of org.luaj.vm2.LuaString.luaByte()

    n = (int)(pose -  posi + 1);
    if (posi + n <= pose/* overflow? */
        error("string slice too long");
    LuaValue[] v = new LuaValue[n];
    for (i=0; i<n; i++)
      v[i] = valueOf(s.luaByte(posi+i-1));
    return varargsOf(v);
  }

  /**
   * string.char (...)
View Full Code Here

Examples of org.luaj.vm2.LuaString.luaByte()

    Buffer result = new Buffer(n);
    int arg = 1;
    int c;
   
    for ( int i = 0; i < n; ) {
      switch ( c = fmt.luaByte( i++ ) ) {
      case '\n':
        result.append( "\n" );
        break;
      default:
        result.append( (byte) c );
View Full Code Here

Examples of org.luaj.vm2.LuaString.luaByte()

      default:
        result.append( (byte) c );
        break;
      case L_ESC:
        if ( i < n ) {
          if ( ( c = fmt.luaByte( i ) ) == L_ESC ) {
            ++i;
            result.append( (byte)L_ESC );
          } else {
            arg++;
            FormatDesc fdsc = new FormatDesc(args, fmt, i );
View Full Code Here

Examples of org.luaj.vm2.LuaString.luaByte()

  static LuaValue reverse( LuaValue arg ) {   
    LuaString s = arg.checkstring();
    int n = s.length();
    byte[] b = new byte[n];
    for ( int i=0, j=n-1; i<n; i++, j-- )
      b[j] = (byte) s.luaByte(i);
    return LuaString.valueOf( b );
  }

  /**
   * string.sub (s, i [, j])
View Full Code Here

Examples of org.luaj.vm2.LuaString.luaByte()

    } else {
      MatchState ms = new MatchState( args, s, pat );
     
      boolean anchor = false;
      int poff = 0;
      if ( pat.luaByte( 0 ) == '^' ) {
        anchor = true;
        poff = 1;
      }
     
      int soff = init;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.