Skip to content

Commit

Permalink
fixed broken implodeTests and also removed the use of annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Apr 9, 2024
1 parent 4476e3c commit ce87697
Showing 1 changed file with 12 additions and 30 deletions.
42 changes: 12 additions & 30 deletions src/org/rascalmpl/library/lang/rascal/syntax/tests/ImplodeTests.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,14 @@ import lang::rascal::\syntax::tests::ImplodeTestGrammar;
import ParseTree;
import Exception;

public data Num = \int(str n);
public data Exp = id(str name) | eq(Exp e1, Exp e2) | number(Num n);
public data Num(loc src=|unknown:///|, map[int,list[str]] comments = ()) = \int(str n);
public data Exp(loc src=|unknown:///|, map[int,list[str]] comments = ()) = id(str name) | eq(Exp e1, Exp e2) | number(Num n);
public Exp number(Num::\int("0")) = Exp::number(Num::\int("01"));

public anno loc Num@location;
public anno loc Exp@location;
public anno map[int,list[str]] Num@comments;
public anno map[int,list[str]] Exp@comments;

public data Number = \int(str n);
public data Expr = id(str name) | eq(Expr e1, Expr e2) | number(Number n);
public data Number(loc src=|unknown:///|, map[int,list[str]] comments = ()) = \int(str n);
public data Expr(loc src=|unknown:///|, map[int,list[str]] comments = ()) = id(str name) | eq(Expr e1, Expr e2) | number(Number n);
public Expr number(Number::\int("0")) = Expr::number(Number::\int("02"));

public anno loc Number@location;
public anno loc Expr@location;
public anno map[int,list[str]] Number@comments;
public anno map[int,list[str]] Expr@comments;

public Exp implodeExp(str s) = implode(#Exp, parseExp(s));
public Exp implodeExpLit1() = implode(#Exp, expLit1());
public Exp implodeExpLit2() = implode(#Exp, expLit2());
Expand All @@ -43,31 +33,23 @@ public Expr implodeExprLit2() = implode(#Expr, exprLit2());

test bool test11() { try return Exp::id(_) := implodeExp("a"); catch ImplodeError(_): return false;}

@IgnoreCompiler{
TODO
}
test bool test12() { try return Exp::number(Num::\int("01")) := implodeExp("0"); catch ImplodeError(_): return false;}
@IgnoreCompiler{TODO}
test bool test12() { try return Exp::number(Num::\int("0")) := implodeExp("0"); catch ImplodeError(_): return false;}

test bool test13() { try return Exp::eq(Exp::id(_),Exp::id(_)) := implodeExp("a == b"); catch ImplodeError(_): return false;}

@IgnoreCompiler{
TODO
}
test bool test14() { try return Exp::eq(Exp::number(Num::\int("01")), Exp::number(Num::\int("1"))) := implodeExp("0 == 1"); catch ImplodeError(_): return false;}
@IgnoreCompiler{TODO}
test bool test14() { try return Exp::eq(Exp::number(Num::\int("0")), Exp::number(Num::\int("1"))) := implodeExp("0 == 1"); catch ImplodeError(_): return false;}

test bool test15() { try return Expr::id(_) := implodeExpr("a"); catch ImplodeError(_): return false;}

@IgnoreCompiler{
TODO
}
test bool test16() { try return Expr::number(Number::\int("02")) := implodeExpr("0"); catch ImplodeError(_): return false;}
@IgnoreCompiler{TODO}
test bool test16() { try return Expr::number(Number::\int("0")) := implodeExpr("0"); catch ImplodeError(_): return false;}

test bool test17() { try return Expr::eq(Expr::id(_),Expr::id(_)) := implodeExpr("a == b"); catch ImplodeError(_): return false;}

@IgnoreCompiler{
TODO
}
test bool test18() { try return Expr::eq(Expr::number(Number::\int("02")), Expr::number(Number::\int("1"))) := implodeExpr("0 == 1"); catch ImplodeError(_): return false;}
@IgnoreCompiler{TODO}
test bool test18() { try return Expr::eq(Expr::number(Number::\int("0")), Expr::number(Number::\int("1"))) := implodeExpr("0 == 1"); catch ImplodeError(_): return false;}

// ---- test2 ----

Expand Down

0 comments on commit ce87697

Please sign in to comment.