Skip to content

Commit

Permalink
Added test function to compare syntax trees
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasguts committed May 4, 2019
1 parent dd811e5 commit 9d0f69e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tst/testinstall/syntaxtree.tst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ gap> SyntaxTree(x -> x);
<syntax tree>
gap> SyntaxTree(\+);
Error, SYNTAX_TREE: <func> must be a plain GAP function (not a function)
gap> test_tree := function( f )
> local curr_tree, new_func, new_tree;
> curr_tree := SYNTAX_TREE( f );
> new_func := SYNTAX_TREE_CODE( curr_tree );
> new_tree := SYNTAX_TREE( new_func );
> return new_tree = curr_tree;
> end;;

# Just try compiling all functions we can find in the workspace
# to see nothing crashes.
Expand Down Expand Up @@ -37,8 +44,7 @@ gap> testit := function(f)
> local tree;
> tree := SYNTAX_TREE(f);
> Display(tree);
> # TODO: recode the tree, then decode again and compare
> return true;
> return test_tree( f );
> end;;

# T_PROCCALL_0ARGS
Expand Down

0 comments on commit 9d0f69e

Please sign in to comment.