add an if-expression twist

This commit is contained in:
Matt Hargett 2022-09-07 19:37:13 -07:00
parent 026015954a
commit 7cf9c6571e
2 changed files with 22 additions and 13 deletions

View File

@ -26,5 +26,5 @@ return function <T>(req, ...: boolean): ({[string|number]: T}, string, Function<
res[#res - 2] = { ... }
end
return (res :: any) :: { T }, body, function(...): ...any return ... end
return (res :: any) :: { T }, (if req then body else "") :: string, function(...): ...any return ... end
end

View File

@ -271,18 +271,27 @@ L29
[T] 28 28
[}] 30 30
[,] 31 31
[body] 33 36
[,] 37 37
[function] 39 46
[(] 47 47
[...] 48 50
[)] 51 51
[:] 52 52
[...] 54 56
[any] 57 59
[return] 61 66
[...] 68 70
[end] 72 74
[(] 33 33
[if] 34 35
[req] 37 39
[then] 41 44
[body] 46 49
[else] 51 54
[""] 56 57
[)] 58 58
[::] 60 61
[string] 63 68
[,] 69 69
[function] 71 78
[(] 79 79
[...] 80 82
[)] 83 83
[:] 84 84
[...] 86 88
[any] 89 91
[return] 93 98
[...] 100 102
[end] 104 106
L30
[end] 1 3
EOF