Examples of GoForWithRangeAndVarsStatement


Examples of ro.redeul.google.go.lang.psi.statements.GoForWithRangeAndVarsStatement

                                    "    for i := range data {\n" +
                                    "        println(i)\n" +
                                    "    }\n" +
                                    "}"));

        GoForWithRangeAndVarsStatement forStmt =
            castAs(GoForWithRangeAndVarsStatement.class, 0,
                   get(
                       childAt(0,
                               file.getFunctions()
                       ).getBlock()
                   ).getStatements()
            );

        assertEquals("i", get(forStmt.getKey()).getText());
        assertNull(forStmt.getValue());
        assertEquals("data", get(forStmt.getRangeExpression()).getText());
    }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.statements.GoForWithRangeAndVarsStatement

                                    "    for key, value := range {\n" +
                                    "        println(i)\n" +
                                    "    }\n" +
                                    "}"));

        GoForWithRangeAndVarsStatement forStmt =
            castAs(GoForWithRangeAndVarsStatement.class, 0,
                   get(
                       childAt(0,
                               file.getFunctions()
                       ).getBlock()
                   ).getStatements()
            );

        assertEquals("key", get(forStmt.getKey()).getText());
        assertEquals("value", get(forStmt.getValue()).getText());
        assertNull(forStmt.getRangeExpression());
    }
View Full Code Here

Examples of ro.redeul.google.go.lang.psi.statements.GoForWithRangeAndVarsStatement

                                    "    for key, value := range data {\n" +
                                    "        println(i)\n" +
                                    "    }\n" +
                                    "}"));

        GoForWithRangeAndVarsStatement forStmt =
            castAs(GoForWithRangeAndVarsStatement.class, 0,
                   get(
                       childAt(0,
                               file.getFunctions()
                       ).getBlock()
                   ).getStatements()
            );

        assertEquals("key", get(forStmt.getKey()).getText());
        assertEquals("value", get(forStmt.getValue()).getText());
        assertEquals("data", get(forStmt.getRangeExpression()).getText());
    }
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.