Examples of ISourcePosition


Examples of org.jruby.lexer.yacc.ISourcePosition

                                        new LocalStaticScope(null),
                                        new InstVarNode(pos, "@" + name)));
    }

    public static void defineAttrWriter(Graph graph, String name) {
        ISourcePosition pos = new SimpleSourcePosition("(generated)", 0);
        graph.createVertex(new DefnNode(pos,
                                        new ArgumentNode(pos, name + "="),
                                        new ArgsPreOneArgNode(pos, new ListNode(null, new ArgumentNode(null, name))),
                                        new LocalStaticScope(null),
                                        new InstAsgnNode(pos, "@" + name, new LocalVarNode(null, 0, name))));
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

    public String toString() {
        return file + ":" + line;
    }

    public static SourceLocation of(Node node) {
        ISourcePosition pos = node.getPosition();
        if (pos != null && pos != ISourcePosition.INVALID_POSITION) {
            return new SourceLocation(pos.getFile(), pos.getStartLine() + 1);
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

        }

    }

    private DetailedSourcePosition detailedSource(Node node) {
        final ISourcePosition sourcePosition = node.getPosition();
        assertTrue(sourcePosition instanceof DetailedSourcePosition);
        return (DetailedSourcePosition) sourcePosition;
    }
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 WhenNode(position, expressionNodes, bodyNode, nextCase);
    }

    // FIXME: Currently this is passing in position of receiver
    public Node new_opElementAsgnNode(Node receiverNode, String operatorName, Node argsNode, Node valueNode) {
        ISourcePosition position = lexer.tokline;  // FIXME: ruby_sourceline in new lexer.
        Node newNode = null;

        if (argsNode instanceof ArrayNode) {
            ArrayNode array = (ArrayNode) argsNode;
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

        return ' ';
    }

    public void compile_error(String message) { // mri: rb_compile_error_with_enc
        String line = lexer.getCurrentLine();
        ISourcePosition position = lexer.getPosition();
        String errorMessage = position.getFile() + ":" + position.getLine() + ": ";

        if (line != null && line.length() > 5) {
            boolean addNewline = message != null && ! message.endsWith("\n");

            message += (addNewline ? "\n" : "") + line;
View Full Code Here

Examples of org.jruby.lexer.yacc.ISourcePosition

      this(id, position.getLine(), position.getStartLine(), position.getFile(), message, data);
    }
   
    private static final Object[] EMPTY_DATA = {} ;
    protected RubyIssue(SyntaxException error) {
      ISourcePosition position = error.getPosition();
      this.id = null; // is a syntax error
      this.line = position.getLine();
      this.startLine = position.getStartLine();
      this.fileName = position.getFile();
      this.message = error.getMessage();
      this.data = EMPTY_DATA;
    }
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.