Examples of ISourcePosition


Examples of org.jruby.lexer.yacc.ISourcePosition

    }
   
    public Node new_opAssign(AssignableNode lhs, String asgnOp, Node rhs) {
        checkExpression(rhs);

        ISourcePosition pos = lhs.getPosition();
       
        if (asgnOp.equals("||")) {
            lhs.setValueNode(rhs);
            return new OpAsgnOrNode(pos, gettable2(lhs), lhs);
        } else if (asgnOp.equals("&&")) {
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

                return new AttrAssignNode(position, receiver, name, argsNode);
        }
    }
   
    private Node new_call_noargs(Node receiver, Token name, IterNode iter) {
        ISourcePosition position = position(receiver, name);
       
        if (receiver == null) receiver = NilImplicitNode.NIL;
       
        if (iter != null) return new CallNoArgBlockNode(position, receiver, (String) name.getValue(), iter);
       
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

        return new CallSpecialArgNode(position(receiver, args), receiver, (String) name.getValue(), args);
    }
   
    private Node new_call_blockpass(Node receiver, Token operation, BlockPassNode blockPass) {
        ISourcePosition position = position(receiver, blockPass);
        String name = (String) operation.getValue();
        Node args = blockPass.getArgsNode();
       
        if (args == null) return new CallNoArgBlockPassNode(position, receiver, name, args, blockPass);
        if (!(args instanceof ArrayNode)) return new CallSpecialArgBlockPassNode(position, receiver, name, args, blockPass);
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

        return new FCallNoArgNode(operation.getPosition(), (String) operation.getValue());
    }
   
    private Node new_fcall_simpleargs(Token operation, ArrayNode args, Node iter) {
        String name = (String) operation.getValue();
        ISourcePosition position = position(operation, args);
           
        switch (args.size()) {
            case 0// foo()
                if (iter != null) return new FCallNoArgBlockNode(position, name, args, (IterNode) iter);
                   
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

                return new FCallManyArgsNode(position, name, args);
        }
    }
   
    private Node new_fcall_blockpass(Token operation, BlockPassNode blockPass) {
        ISourcePosition position = position(operation, blockPass);
        String name = (String) operation.getValue();
        Node args = blockPass.getArgsNode();
       
        if (args == null) return new FCallNoArgBlockPassNode(position, name, args, blockPass);
        if (!(args instanceof ArrayNode)) return new FCallSpecialArgBlockPassNode(position, name, args, blockPass);
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

            e.printStackTrace();
        }
    }

    private static void debug(Node node, String indent) {
        ISourcePosition pos = node.getPosition();
        int line = pos.getStartLine();
        System.out.println(String.format("%03d", line) + indent + node.getNodeType() + "(" + pos.getClass().getCanonicalName() + ")");
        for (Node child : node.childNodes())
            debug(child, indent + "  ");
    }
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

        return Node.createList(condition, thenBody, elseBody);
    }
   
    @Override
    public IRubyObject interpret(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock) {
        ISourcePosition position = getPosition();

        context.setFileAndLine(position.getFile(), position.getStartLine());

        IRubyObject result = condition.interpret(runtime, context, self, aBlock);
       
        // TODO: put these nil guards into tree (bigger than I want to do right now)
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

        return createList(nextNode);
    }
   
    @Override
    public IRubyObject interpret(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock) {
        ISourcePosition position = getPosition();
        // something in here is used to build up ruby stack trace...
        context.setLine(position.getLine());

        if (runtime.hasEventHooks()) {
            ASTInterpreter.callTraceFunction(runtime, context, RubyEvent.LINE);
        }
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

        context.pollThreadEvents();

        for (Node child : cases.childNodes()) {
            WhenNode when = (WhenNode) child;
            ISourcePosition position = child.getPosition();

            context.setFileAndLine(position.getFile(), position.getStartLine());

            if (runtime.hasEventHooks()) ASTInterpreter.callTraceFunction(runtime, context, RubyEvent.LINE);
            IRubyObject result = when.when(expression, context, runtime, self, aBlock);
            if (result != null) return result;
            context.pollThreadEvents();
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

            }
        }
    }

    public static void defineAttrReader(Graph graph, String name) {
        ISourcePosition pos = new SimpleSourcePosition("(generated)", 0);
        graph.createVertex(new DefnNode(pos,
                                        new ArgumentNode(pos, name),
                                        new ArgsNoArgNode(pos),
                                        new LocalStaticScope(null),
                                        new InstVarNode(pos, "@" + name)));
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.