Package org.python.pydev.parser.fastparser

Examples of org.python.pydev.parser.fastparser.TabNannyDocIterator


        String str = "{g \n" +
                " ( ''' thnehouno '''\n" +
                "}\n" +
                "    pass";
        Document d = new Document(str);
        TabNannyDocIterator it = new TabNannyDocIterator(d);
        assertEquals("    ", it.next().o1);
        assertTrue(!it.hasNext());
    }
View Full Code Here


        String str = "{g \n" + //error here
                " ( ''' thnehouno '''\n" +
                "\n" +
                "    pass";
        Document d = new Document(str);
        TabNannyDocIterator it = new TabNannyDocIterator(d);
        assertEquals(" ", it.next().o1);
        assertEquals("    ", it.next().o1);
        assertTrue(!it.hasNext());
    }
View Full Code Here

        Document doc = new Document("" +
                "aaa\n" +
                "\t\n" +
                "ccc\n" +
                "");
        TabNannyDocIterator it = new TabNannyDocIterator(doc);
        assertEquals("\t", it.next().o1);
        assertTrue(!it.hasNext());
    }
View Full Code Here

        Document doc = new Document("" +
                "aaa\n" +
                "\t\n" +
                "ccc\n" +
                "");
        TabNannyDocIterator it = new TabNannyDocIterator(doc, true, false);
        assertEquals("", it.next().o1);
        //        assertEquals("\t",it.next().o1); -- empty line
        assertEquals("", it.next().o1);
        assertTrue(!it.hasNext());
    }
View Full Code Here

        Document doc = new Document("" +
                "aaa\n" +
                "\ta\n" +
                "ccc\n" +
                "");
        TabNannyDocIterator it = new TabNannyDocIterator(doc, true, false);
        assertEquals("", it.next().o1);
        assertEquals("\t", it.next().o1);
        assertEquals("", it.next().o1);
        assertTrue(!it.hasNext());
    }
View Full Code Here

                "\t\n" + //don't return this one -- inside of {}
                "}\n" +
                "pass\n" +
                "    pass" +
                "");
        TabNannyDocIterator it = new TabNannyDocIterator(doc);
        assertEquals("    ", it.next().o1);
        assertTrue(!it.hasNext());
    }
View Full Code Here

                "\t\n" + //don't return this one -- inside of {}
                "}\n" +
                "pass\n" +
                "    pass" +
                "");
        TabNannyDocIterator it = new TabNannyDocIterator(doc, true, false);
        assertEquals("", it.next().o1);
        assertEquals("", it.next().o1);
        assertEquals("    ", it.next().o1);
        assertTrue(!it.hasNext());
    }
View Full Code Here

                "\ta\n" +
                "\tpass\n" +
                "def m2:\n" +
                "    pass\n" +
                "");
        TabNannyDocIterator it = new TabNannyDocIterator(doc, true, false);
        assertEquals("", it.next().o1);
        assertEquals("\t", it.next().o1);
        assertEquals("\t", it.next().o1);
        assertEquals("", it.next().o1);
        assertEquals("    ", it.next().o1);
        assertTrue(!it.hasNext());
    }
View Full Code Here

                "    '''\r" +
                "    '''\r" +
                "\t" +
                "";
        Document d = new Document(str);
        TabNannyDocIterator it = new TabNannyDocIterator(d, true, false);
        assertEquals("", it.next().o1);
        assertEquals("    ", it.next().o1);
        assertEquals("\t", it.next().o1);
        assertTrue(!it.hasNext()); //no indentations here...
    }
View Full Code Here

TOP

Related Classes of org.python.pydev.parser.fastparser.TabNannyDocIterator

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.