Package org.openquark.cal.compiler.SourceModel

Examples of org.openquark.cal.compiler.SourceModel.SourceElement


    public void testCodeGemWithLet() {
        String code = "let b = x; a = y; in (b, a, x, y)";
       
        CodeGem gem = createCodeGem(code);
       
        SourceElement element = createFunctionDefn("x y", code);
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here


        String code = "let b = x; a = y; in (b, a, x, y)";
       
        CodeGem gem = createCodeGem(code);
        reorderArgs(gem, new int[] {1, 0});
       
        SourceElement element = createFunctionDefn("y x", code);
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

       
        CodeGem gem = createCodeGem(code.replaceAll("%x", "x"));
       
        renameArg(gem, 0, "x", "y");
       
        SourceElement element = createFunctionDefn("y", code.replaceAll("%x", "y"));
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

    public void testLetBindingShadowingOriginalParam2() {
        String code = "let foo = x; in let x = 3.0; in x";
       
        CodeGem gem = createCodeGem(code);
               
        SourceElement element = createFunctionDefn("x", code);
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

            .replaceAll("@x", "x"));
       
        renameArg(gem, 0, "x", "y");
        renameArg(gem, 1, "z", "x");
       
        SourceElement element = createFunctionDefn("y x", code
            .replaceAll("%x", "y").replaceAll("%z", "x")
            .replaceAll("@x", "x_1"));
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

        CodeGem gem = createCodeGem(code
            .replaceAll("%x", "x").replaceAll("@y", "y"));
       
        renameArg(gem, 0, "x", "y");
       
        SourceElement element = createFunctionDefn("y", code
            .replaceAll("%x", "y").replaceAll("@y", "y_1"));
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

       
        CodeGem gem = createCodeGem(code.replaceAll("%x", "x").replaceAll("@a","a"));
       
        renameArg(gem, 0, "x", "a");
       
        SourceElement element = createFunctionDefn("a", code
            .replaceAll("%x", "a").replaceAll("@a", "a_1"));
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

        CodeGem gem = createCodeGem(code
            .replaceAll("%x", "x").replaceAll("@y", "y"));
       
        renameArg(gem, 0, "x", "y");
       
        SourceElement element = createFunctionDefn("y", code
            .replaceAll("%x", "y").replaceAll("@y", "y_2"));
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

        CodeGem gem = createCodeGem(code
            .replaceAll("%x", "x").replaceAll("@y", "y"));
       
        renameArg(gem, 0, "x", "y");
       
        SourceElement element = createFunctionDefn("y y_1", code
            .replaceAll("%x", "y").replaceAll("@y", "y_2"));
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

            .replaceAll("@y", "y"));
       
        renameArg(gem, 0, "x", "y");
        renameArg(gem, 1, "z", "y_1");
       
        SourceElement element = createFunctionDefn("y y_1", code
            .replaceAll("%x", "y").replaceAll("%z", "y_1")
            .replaceAll("@y", "y_2"));
       
        assertFunctionTextEquals(gem, element);
    }
View Full Code Here

TOP

Related Classes of org.openquark.cal.compiler.SourceModel.SourceElement

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.