Check arguments in with-decorator tag

Fixes #1757.
This commit is contained in:
Brandon T. Willard 2019-03-16 23:19:49 -05:00
parent 49c9d8a845
commit 9203fcaeb5

View File

@ -240,6 +240,8 @@ name (i.e. `sys.argv[0]`).
(deftag @ [expr]
"with-decorator tag macro"
(if (empty? expr)
(macro-error expr "missing function argument"))
(setv decorators (cut expr None -1)
fndef (get expr -1))
`(with-decorator ~@decorators ~fndef))