diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-05-10 14:25:09 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-05-10 14:37:22 +0000 |
| commit | 966eef2d6557eeffc5b5c7b379efc1f2e7d0de0b (patch) | |
| tree | 524d983750073d17a8adfed2c90550ebd0e0501f /alv/base | |
| parent | add and test Type:eq(a,b) (diff) | |
| download | alive-966eef2d6557eeffc5b5c7b379efc1f2e7d0de0b.tar.gz alive-966eef2d6557eeffc5b5c7b379efc1f2e7d0de0b.zip | |
make <num! 4> == <num= 4>
Diffstat (limited to 'alv/base')
| -rw-r--r-- | alv/base/match.moon | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/alv/base/match.moon b/alv/base/match.moon index 926c970..f19c4d8 100644 --- a/alv/base/match.moon +++ b/alv/base/match.moon @@ -50,11 +50,13 @@ import Primitive from require 'alv.type' local Repeat, Sequence, Choice, Optional class Pattern + fulltype = (res) -> (tostring res.type) .. res.metatype + match: (seq) => @reset! num, cap = @capture seq, 1 if num != #seq - args = table.concat [arg.result\fulltype! for arg in *seq], ' ' + args = table.concat [fulltype arg.result for arg in *seq], ' ' msg = "couldn't match arguments (#{args}) against pattern #{@}" error Error 'argument', msg cap |
