Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > cat test.toml
- 1 [my-first-pattern]
- 2
- 3 match="swap(:[a], :[b])"
- 4
- 5 rewrite="swap(:[b], :[a])"
- 6
- 7 rule='''
- 8 where
- 9 rewrite :[a] {":[[1]], :[[2]]" -> ":[2], :[1]"},
- 10 rewrite :[b] {":[[1]], :[[2]]" -> ":[2], :[1]"}
- 11 '''
- > cat in.js
- swap(swap(swap(a,b), swap(x,y)), swap(c, d));
- > comby -config test.toml -stdout -f in.js
- swap(swap(d, c), swap(swap(a,b), swap(x,y)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement