Examples of commentType


Examples of org.python.pydev.parser.jython.ast.commentType

            while (it.hasNext()) {
                String string = it.next();
                if (string.trim().startsWith("#")) {
                    int l = it.getCurrentLine() - 1;
                    addFoldingEntry(ret, new FoldingEntry(FoldingEntry.TYPE_COMMENT, l, l + 1, new ASTEntry(null,
                            new commentType(string))));
                }
            }
        }

        Collections.sort(ret, new Comparator<FoldingEntry>() {
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.commentType

            //also make comments found after the node a part of its context.
            List<Object> s = entry.node.specialsAfter;
            if (s != null) {
                for (Object o : s) {
                    if (o instanceof commentType) {
                        commentType comment = (commentType) o;
                        if (comment.beginLine > entry.endLine) {
                            entry.endLine = comment.beginLine;
                        }
                    }
                }
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.commentType

        if (size > 0) {
            int i = -1;
            if (node.specialsAfter != null) {
                for (Object o : node.specialsAfter) {
                    if (o instanceof commentType) {
                        commentType type = (commentType) o;
                        if (type.beginLine > i) {
                            i = type.beginLine;
                        }
                    }
                }
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.commentType

            }
            modules.deleteCharAt(modules.length() - 1);
            return modules.toString() + " (" + ((NameTok) importToken.module).id + ")";

        } else if (astThis.node instanceof commentType) {
            commentType type = (commentType) astThis.node;
            String rep = type.id.trim();
            rep = StringUtils.split(rep, '\n').get(0);
            rep = StringUtils.split(rep, '\r').get(0);
            rep = rep.substring(1);
            rep = StringUtils.rightTrim(rep, '-');
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.commentType

                    getSpecialsAfter().add(addAt, special);
                }

            } else {
                if (special instanceof commentType) {
                    commentType s = (commentType) special;
                    if (s.beginLine < this.beginLine) {
                        getSpecialsBefore().add(countBefore(special, true), special);
                    } else {
                        getSpecialsBefore().add(special);
                    }
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.commentType

        if (o instanceof ISpecialStr) {
            ISpecialStr s = (ISpecialStr) o;
            return new int[] { s.getBeginLine(), s.getBeginCol() };
        }
        if (o instanceof commentType) {
            commentType c = (commentType) o;
            return new int[] { c.beginLine, c.beginColumn };
        }
        return null;
    }
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.commentType

        List<Name> r = new ArrayList<Name>();

        if (specials != null) {
            for (Object s : specials) {
                if (s instanceof commentType) {
                    commentType comment = (commentType) s;
                    checkSimpleNodeForTokenMatch(match, r, comment, comment.id);
                }
            }
        }
        return r;
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.commentType

                "    pass#end\n" +
                "";
        Module ast = (Module) parseLegalDocStr(s);
        ClassDef d = (ClassDef) ast.body[0];
        assertEquals(1, d.specialsAfter.size());
        commentType c = (commentType) d.specialsAfter.get(0);
        assertEquals("#end", c.id);
        checkPrettyPrintEqual(s, s, s, v3);

    }
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.commentType

    public void testOnlyComment() {
        String s = "#end\n" +
                "";
        Module ast = (Module) parseLegalDocStr(s);
        assertEquals(1, ast.specialsBefore.size());
        commentType c = (commentType) ast.specialsBefore.get(0);
        assertEquals("#end", c.id);
        checkPrettyPrintEqual(s);

    }
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.commentType

                        "#end\n" +
                        "";
                Module ast = (Module) parseLegalDocStr(s);
                ClassDef d = (ClassDef) ast.body[0];
                assertEquals(1, d.specialsAfter.size());
                commentType c = (commentType) d.specialsAfter.get(0);
                assertEquals("#end", c.id);
                return true;
            }
        });
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.