@@ -37,20 +37,20 @@ func TestWriteCompound(t *testing.T) {
37
37
{title : "list-ish" , term : PartialList (NewAtom (`rest` ), NewAtom (`a` ), NewAtom (`b` )), output : `[a,b|rest]` },
38
38
{title : "circular list" , term : l , output : `[a,b,a|...]` },
39
39
{title : "curly brackets" , term : atomEmptyBlock .Apply (NewAtom (`foo` )), output : `{foo}` },
40
- {title : "fx" , term : atomIf .Apply (atomIf .Apply (NewAtom (`foo` ))), opts : WriteOptions {ops : ops , priority : 1201 }, output : `:- (:-foo)` },
41
- {title : "fy" , term : atomNegation .Apply (atomMinus .Apply (atomNegation .Apply (NewAtom (`foo` )))), opts : WriteOptions {ops : ops , priority : 1201 }, output : `\+ - (\+foo)` },
42
- {title : "xf" , term : NewAtom (`-:` ).Apply (NewAtom (`-:` ).Apply (NewAtom (`foo` ))), opts : WriteOptions {ops : ops , priority : 1201 }, output : `(foo-:)-:` },
43
- {title : "yf" , term : NewAtom (`+/` ).Apply (NewAtom (`--` ).Apply (NewAtom (`+/` ).Apply (NewAtom (`foo` )))), opts : WriteOptions {ops : ops , priority : 1201 }, output : `(foo+/)-- +/` },
44
- {title : "xfx" , term : atomIf .Apply (NewAtom ("foo" ), atomIf .Apply (NewAtom ("bar" ), NewAtom ("baz" ))), opts : WriteOptions {ops : ops , priority : 1201 }, output : `foo:-(bar:-baz)` },
45
- {title : "yfx" , term : atomAsterisk .Apply (Integer (2 ), atomPlus .Apply (Integer (2 ), Integer (2 ))), opts : WriteOptions {ops : ops , priority : 1201 }, output : `2*(2+2)` },
46
- {title : "xfy" , term : atomComma .Apply (Integer (2 ), atomBar .Apply (Integer (2 ), Integer (2 ))), opts : WriteOptions {ops : ops , priority : 1201 }, output : `2,(2|2)` },
47
- {title : "ignore_ops(false)" , term : atomPlus .Apply (Integer (2 ), Integer (- 2 )), opts : WriteOptions {ignoreOps : false , ops : ops , priority : 1201 }, output : `2+ -2` },
48
- {title : "ignore_ops(true)" , term : atomPlus .Apply (Integer (2 ), Integer (- 2 )), opts : WriteOptions {ignoreOps : true , ops : ops , priority : 1201 }, output : `+(2,-2)` },
49
- {title : "number_vars(false)" , term : f .Apply (atomVar .Apply (Integer (0 )), atomVar .Apply (Integer (1 )), atomVar .Apply (Integer (25 )), atomVar .Apply (Integer (26 )), atomVar .Apply (Integer (27 ))), opts : WriteOptions {quoted : true , numberVars : false , ops : ops , priority : 1201 }, output : `f('$VAR'(0),'$VAR'(1),'$VAR'(25),'$VAR'(26),'$VAR'(27))` },
50
- {title : "number_vars(true)" , term : f .Apply (atomVar .Apply (Integer (0 )), atomVar .Apply (Integer (1 )), atomVar .Apply (Integer (25 )), atomVar .Apply (Integer (26 )), atomVar .Apply (Integer (27 ))), opts : WriteOptions {quoted : true , numberVars : true , ops : ops , priority : 1201 }, output : `f(A,B,Z,A1,B1)` },
51
- {title : "prefix: spacing between operators" , term : atomAsterisk .Apply (NewAtom ("a" ), atomMinus .Apply (NewAtom ("b" ))), opts : WriteOptions {ops : ops , priority : 1201 }, output : `a* -b` },
52
- {title : "postfix: spacing between unary minus and open/close" , term : atomMinus .Apply (NewAtom (`+/` ).Apply (NewAtom ("a" ))), opts : WriteOptions {ops : ops , priority : 1201 }, output : `- (a+/)` },
53
- {title : "infix: spacing between unary minus and open/close" , term : atomMinus .Apply (atomAsterisk .Apply (NewAtom ("a" ), NewAtom ("b" ))), opts : WriteOptions {ops : ops , priority : 1201 }, output : `- (a*b)` },
40
+ {title : "fx" , term : atomIf .Apply (atomIf .Apply (NewAtom (`foo` ))), opts : WriteOptions {_ops : ops , priority : 1201 }, output : `:- (:-foo)` },
41
+ {title : "fy" , term : atomNegation .Apply (atomMinus .Apply (atomNegation .Apply (NewAtom (`foo` )))), opts : WriteOptions {_ops : ops , priority : 1201 }, output : `\+ - (\+foo)` },
42
+ {title : "xf" , term : NewAtom (`-:` ).Apply (NewAtom (`-:` ).Apply (NewAtom (`foo` ))), opts : WriteOptions {_ops : ops , priority : 1201 }, output : `(foo-:)-:` },
43
+ {title : "yf" , term : NewAtom (`+/` ).Apply (NewAtom (`--` ).Apply (NewAtom (`+/` ).Apply (NewAtom (`foo` )))), opts : WriteOptions {_ops : ops , priority : 1201 }, output : `(foo+/)-- +/` },
44
+ {title : "xfx" , term : atomIf .Apply (NewAtom ("foo" ), atomIf .Apply (NewAtom ("bar" ), NewAtom ("baz" ))), opts : WriteOptions {_ops : ops , priority : 1201 }, output : `foo:-(bar:-baz)` },
45
+ {title : "yfx" , term : atomAsterisk .Apply (Integer (2 ), atomPlus .Apply (Integer (2 ), Integer (2 ))), opts : WriteOptions {_ops : ops , priority : 1201 }, output : `2*(2+2)` },
46
+ {title : "xfy" , term : atomComma .Apply (Integer (2 ), atomBar .Apply (Integer (2 ), Integer (2 ))), opts : WriteOptions {_ops : ops , priority : 1201 }, output : `2,(2|2)` },
47
+ {title : "ignore_ops(false)" , term : atomPlus .Apply (Integer (2 ), Integer (- 2 )), opts : WriteOptions {ignoreOps : false , _ops : ops , priority : 1201 }, output : `2+ -2` },
48
+ {title : "ignore_ops(true)" , term : atomPlus .Apply (Integer (2 ), Integer (- 2 )), opts : WriteOptions {ignoreOps : true , _ops : ops , priority : 1201 }, output : `+(2,-2)` },
49
+ {title : "number_vars(false)" , term : f .Apply (atomVar .Apply (Integer (0 )), atomVar .Apply (Integer (1 )), atomVar .Apply (Integer (25 )), atomVar .Apply (Integer (26 )), atomVar .Apply (Integer (27 ))), opts : WriteOptions {quoted : true , numberVars : false , _ops : ops , priority : 1201 }, output : `f('$VAR'(0),'$VAR'(1),'$VAR'(25),'$VAR'(26),'$VAR'(27))` },
50
+ {title : "number_vars(true)" , term : f .Apply (atomVar .Apply (Integer (0 )), atomVar .Apply (Integer (1 )), atomVar .Apply (Integer (25 )), atomVar .Apply (Integer (26 )), atomVar .Apply (Integer (27 ))), opts : WriteOptions {quoted : true , numberVars : true , _ops : ops , priority : 1201 }, output : `f(A,B,Z,A1,B1)` },
51
+ {title : "prefix: spacing between operators" , term : atomAsterisk .Apply (NewAtom ("a" ), atomMinus .Apply (NewAtom ("b" ))), opts : WriteOptions {_ops : ops , priority : 1201 }, output : `a* -b` },
52
+ {title : "postfix: spacing between unary minus and open/close" , term : atomMinus .Apply (NewAtom (`+/` ).Apply (NewAtom ("a" ))), opts : WriteOptions {_ops : ops , priority : 1201 }, output : `- (a+/)` },
53
+ {title : "infix: spacing between unary minus and open/close" , term : atomMinus .Apply (atomAsterisk .Apply (NewAtom ("a" ), NewAtom ("b" ))), opts : WriteOptions {_ops : ops , priority : 1201 }, output : `- (a*b)` },
54
54
{title : "recursive" , term : r , output : `f(...)` },
55
55
}
56
56
0 commit comments