Examples of ISourcePosition


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.setFile(position.getFile());
        context.setLine(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

        context.pollThreadEvents();

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

            context.setFile(position.getFile());
            context.setLine(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

        Node rightNode = null;

        // FIXME: DSTR,EVSTR,STR: warning "string literal in condition"
        switch(node.getNodeType()) {
        case DREGEXPNODE: {
            ISourcePosition position = node.getPosition();

            return new Match2Node(position, node, new GlobalVarNode(position, "$_"));
        }
        case ANDNODE:
            leftNode = cond0(((AndNode) node).getFirstNode());
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

            return;
        }

        if (expressionNodes instanceof ListNode) {
            ListNode list = (ListNode) expressionNodes;
            ISourcePosition position = sourceWhen.getPosition();
            Node bodyNode = sourceWhen.getBodyNode();

            for (int i = 0; i < list.size(); i++) {
                Node expression = list.get(i);
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

        Node rightNode = null;

        // FIXME: DSTR,EVSTR,STR: warning "string literal in condition"
        switch(node.getNodeType()) {
        case DREGEXPNODE: {
            ISourcePosition position = node.getPosition();

            return new Match2Node(position, node, new GlobalVarNode(position, "$_"));
        }
        case ANDNODE:
            leftNode = cond0(((AndNode) node).getFirstNode());
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

            return;
        }

        if (expressionNodes instanceof ListNode) {
            ListNode list = (ListNode) expressionNodes;
            ISourcePosition position = sourceWhen.getPosition();
            Node bodyNode = sourceWhen.getBodyNode();

            for (int i = 0; i < list.size(); i++) {
                Node expression = list.get(i);
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.