Advertisement
Guest User

Untitled

a guest
Nov 26th, 2020
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. > cat test.toml
  2.  
  3. 1 [my-first-pattern]
  4. 2
  5. 3 match="swap(:[a], :[b])"
  6. 4
  7. 5 rewrite="swap(:[b], :[a])"
  8. 6
  9. 7 rule='''
  10. 8 where
  11. 9 rewrite :[a] {":[[1]], :[[2]]" -> ":[2], :[1]"},
  12. 10 rewrite :[b] {":[[1]], :[[2]]" -> ":[2], :[1]"}
  13. 11 '''
  14.  
  15. > cat in.js
  16. swap(swap(swap(a,b), swap(x,y)), swap(c, d));
  17.  
  18. > comby -config test.toml -stdout -f in.js
  19.  
  20. swap(swap(d, c), swap(swap(a,b), swap(x,y)));
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement