t18964.nim 284 B

12345678910111213
  1. discard """
  2. errormsg: "invalid order of case branches"
  3. """
  4. import macros
  5. macro genCase(val: string): untyped =
  6. result = nnkCaseStmt.newTree(val,
  7. nnkElse.newTree(quote do: echo "else"),
  8. nnkOfBranch.newTree(newLit("miauz"), quote do: echo "first branch"))
  9. genCase("miauz")