Package org.jruby.util

Examples of org.jruby.util.ByteList.charAt()


                    break;
                }
                buffer.append(c);
            }
            for (; i >= 0; i++) {
                unread(buffer.charAt(i));
            }
            buffer.append(new byte[] {' ', '.', '.', '.'});
            return buffer.toString();
        } catch(Exception e) {
            return null;
View Full Code Here


                    regexFlags = RE_OPTION_IGNORECASE;
                }
            }
            if (args.length == 3 && !args[2].isNil()) {
                ByteList kcodeBytes = args[2].convertToString().getByteList();
                char first = kcodeBytes.length() > 0 ? kcodeBytes.charAt(0) : 0;
                regexFlags &= ~0x70;
                switch (first) {
                case 'n': case 'N':
                    regexFlags |= 16;
                    break;
View Full Code Here

    }

    public Object constructRubyScalar(final Node node) {
        if(node instanceof org.jvyamlb.nodes.ScalarNode) {
            ByteList sc = (ByteList)super.constructScalar(node);
            if(sc.length() > 1 && sc.charAt(0) == ':' && ((org.jvyamlb.nodes.ScalarNode)node).getStyle() == 0) {
                int first = sc.get(1);
                int last = sc.get(sc.realSize-1);
                if((first == '"' && last == '"') ||
                   (first == '\'' && last == '\'')) {
View Full Code Here

                    break;
                }
                buffer.append(c);
            }
            for (; i >= 0; i++) {
                unread(buffer.charAt(i));
            }
            buffer.append(new byte[] {' ', '.', '.', '.'});
            return buffer.toString();
        } catch(Exception e) {
            return null;
View Full Code Here

        int optionsInt = objectAsJoniOptions(arg1);
        options = RegexpOptions.fromJoniOptions(optionsInt);
       
        if (!arg2.isNil()) {
            ByteList kcodeBytes = arg2.convertToString().getByteList();
            char first = kcodeBytes.length() > 0 ? kcodeBytes.charAt(0) : 0;
            switch (first) {
            case 'n': case 'N':
                options.setExplicitKCode(KCode.NONE);
                break;
            case 'e': case 'E':
View Full Code Here

        int optionsInt = objectAsJoniOptions(arg1);
        options = RegexpOptions.fromJoniOptions(optionsInt);
       
        if (!arg2.isNil()) {
            ByteList kcodeBytes = arg2.convertToString().getByteList();
            char first = kcodeBytes.length() > 0 ? kcodeBytes.charAt(0) : 0;
            switch (first) {
            case 'n': case 'N':
                options.setExplicitKCode(KCode.NONE);
                break;
            case 'e': case 'E':
View Full Code Here

                    break;
                }
                buffer.append(c);
            }
            for (; i >= 0; i--) {
                unread(buffer.charAt(i));
            }
            buffer.append(new byte[] {' ', '.', '.', '.'});
            return buffer.toString();
        } catch(Exception e) {
            return null;
View Full Code Here

            int i = 0;
            int c = read();
            unreadBuffer.append(c);
           
            if (c == -1) {
                unread(unreadBuffer.charAt(0));
                buffer.append(EOF_LABEL);
                buffer.append('>');
               
                return buffer.toString();
            } else {
View Full Code Here

                    break;
                }
                buffer.append(c);
            }
            for (; i >= 0; i--) {
                unread(unreadBuffer.charAt(i));
            }
            buffer.append(new byte[] {' ', '.', '.', '.'});
            return buffer.toString();
        } catch(Exception e) {
            return null;
View Full Code Here

    public static IRubyObject quote_name_part(final ThreadContext context,
        final IRubyObject self, final IRubyObject part) {

        final RubyString partString = (RubyString) part;
        final ByteList str = partString.getByteList();
        if ( str.charAt(0) == '[' && str.charAt(str.length() - 1) == ']' ) {
            return part; // part =~ /^\[.*\]$/ ? part
        }

        return quoteCharAndDecorateWith(context, partString, ']', ']', (byte) '[', (byte) ']');
    }
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.