Package org.jruby.lexer.yacc

Examples of org.jruby.lexer.yacc.IDESourcePosition


        int startLine = position.getStartLine();
        int endLine = position.getEndLine();
       
        // Since this is only used for IDEs this is safe code, but there is an obvious abstraction issue here.
        ISourcePosition commentIncludingPos =
            new IDESourcePosition(fileName, startLine, endLine, startOffset, endOffset);
       
        for (CommentNode comment: getComments()) {
            commentIncludingPos =
                IDESourcePosition.combinePosition(commentIncludingPos, comment.getPosition());
        }      
View Full Code Here


       
        return floatNode;
    }
   
    public ISourcePosition createEmptyArgsNodePosition(ISourcePosition pos) {
        return new IDESourcePosition(pos.getFile(), pos.getStartLine(), pos.getEndLine(), pos.getEndOffset() - 1, pos.getEndOffset() - 1);
    }
View Full Code Here

        int index = ((Integer) token.getValue()).intValue();
        if(index < 0) {
            return null;
        }
        String name = getCurrentScope().getLocalScope().getVariables()[index];
        ISourcePosition position = new IDESourcePosition(token.getPosition().getFile(), token.getPosition().getStartLine(), token.getPosition().getEndLine(), token.getPosition().getStartOffset(), token.getPosition().getEndOffset() + name.length());
        return new ArgumentNode(position, name);
    }
View Full Code Here

        visitor.flushStream();
        return out.getBuffer().toString();
    }

    public void testVisitRegexpNode() {
        RegexpNode n = new RegexpNode(new IDESourcePosition("", 0, 0, 2, 4), ByteList.create(".*"), 0);
        assertEquals("/.*/", visitNode(n));
    }
View Full Code Here

        assertEquals(ReWriteVisitor.unescapeChar('\t'), "t");
        assertEquals(ReWriteVisitor.unescapeChar('n'), null);
    }

    public void testArgumentNode() {
        Node node = new ArgumentNode(new IDESourcePosition(), "name");
        assertEquals("name", ReWriteVisitor.createCodeFromNode(node, ""));
    }
View Full Code Here

TOP

Related Classes of org.jruby.lexer.yacc.IDESourcePosition

Copyright © 2018 www.massapicom. 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.