term_branches.go 856 B

1234567891011121314151617181920212223242526272829303132
  1. package node
  2. func (impl Switch) Term() {}
  3. type Switch struct {
  4. Node `part:"switch"`
  5. Argument VariousTerm `part:"term"`
  6. Branches [] Branch `list_more:"branch_list" item:"branch"`
  7. }
  8. type Branch struct {
  9. Node `part:"branch"`
  10. Type MaybeRef `part_opt:"branch_key.type_ref.ref"`
  11. Pattern MaybePattern `part_opt:"branch_key.opt_pattern.pattern"`
  12. Expr Expr `part:"expr"`
  13. }
  14. func (impl If) Term() {}
  15. type If struct {
  16. Node `part:"if"`
  17. Condition VariousTerm `part:"term"`
  18. YesBranch Expr `part:"if_yes.expr"`
  19. NoBranch Expr `part:"if_no.expr"`
  20. ElIfs [] ElIf `list_rec:"elifs"`
  21. }
  22. type ElIf struct {
  23. Node `part:"elif"`
  24. Condition VariousTerm `part:"term"`
  25. YesBranch Expr `part:"expr"`
  26. }