Search in sources :

Example 11 with Exp

use of org.abs_models.frontend.ast.Exp in project abstools by abstools.

the class FreeVarTest method parFnApp.

@Test
public void parFnApp() {
    Exp e = getSecondExp("def Unit f(m)(Bool b) = Unit; { Bool b = True; Unit u = f(println)(b); }");
    assertEquals(e.getFreeVars(), "b");
}
Also used : Exp(org.abs_models.frontend.ast.Exp) FrontendTest(org.abs_models.frontend.FrontendTest) Test(org.junit.Test)

Example 12 with Exp

use of org.abs_models.frontend.ast.Exp in project abstools by abstools.

the class FreeVarTest method callExp2.

@Test
public void callExp2() {
    Exp e = getExp("interface I { Unit m(Bool b); } { Bool b = True; I i; Bool c = i.m(True); }", 2);
    assertEquals(e.getFreeVars(), "i");
}
Also used : Exp(org.abs_models.frontend.ast.Exp) FrontendTest(org.abs_models.frontend.FrontendTest) Test(org.junit.Test)

Example 13 with Exp

use of org.abs_models.frontend.ast.Exp in project abstools by abstools.

the class FreeVarTest method fnApp.

@Test
public void fnApp() {
    Exp e = getSecondExp("def Unit f(Bool b) = Unit; { Bool b; Unit u = f(b); }");
    assertEquals(e.getFreeVars(), "b");
}
Also used : Exp(org.abs_models.frontend.ast.Exp) FrontendTest(org.abs_models.frontend.FrontendTest) Test(org.junit.Test)

Example 14 with Exp

use of org.abs_models.frontend.ast.Exp in project abstools by abstools.

the class FreeVarTest method callExp.

@Test
public void callExp() {
    Exp e = getExp("interface I { Unit m(Bool b); } { Bool b = True; I i; Bool c = i.m(b); }", 2);
    assertEquals(e.getFreeVars(), "i", "b");
}
Also used : Exp(org.abs_models.frontend.ast.Exp) FrontendTest(org.abs_models.frontend.FrontendTest) Test(org.junit.Test)

Example 15 with Exp

use of org.abs_models.frontend.ast.Exp in project abstools by abstools.

the class FreeVarTest method asyncCallExp.

@Test
public void asyncCallExp() {
    Exp e = getExp("interface I { Unit m(Bool b); } { Bool b = True; I i; Bool c = i!m(b); }", 2);
    assertEquals(e.getFreeVars(), "i", "b");
}
Also used : Exp(org.abs_models.frontend.ast.Exp) FrontendTest(org.abs_models.frontend.FrontendTest) Test(org.junit.Test)

Aggregations

FrontendTest (org.abs_models.frontend.FrontendTest)24 Exp (org.abs_models.frontend.ast.Exp)24 Test (org.junit.Test)24 ClassDecl (org.abs_models.frontend.ast.ClassDecl)1 LetExp (org.abs_models.frontend.ast.LetExp)1 MethodImpl (org.abs_models.frontend.ast.MethodImpl)1 NegExp (org.abs_models.frontend.ast.NegExp)1 PatternVarDecl (org.abs_models.frontend.ast.PatternVarDecl)1 ReturnStmt (org.abs_models.frontend.ast.ReturnStmt)1 Stmt (org.abs_models.frontend.ast.Stmt)1 VarDecl (org.abs_models.frontend.ast.VarDecl)1 VarUse (org.abs_models.frontend.ast.VarUse)1