aboutsummaryrefslogtreecommitdiffstats
path: root/alv/base
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-05-10 14:25:09 +0000
committers-ol <s-ol@users.noreply.github.com>2020-05-10 14:37:22 +0000
commit966eef2d6557eeffc5b5c7b379efc1f2e7d0de0b (patch)
tree524d983750073d17a8adfed2c90550ebd0e0501f /alv/base
parentadd and test Type:eq(a,b) (diff)
downloadalive-966eef2d6557eeffc5b5c7b379efc1f2e7d0de0b.tar.gz
alive-966eef2d6557eeffc5b5c7b379efc1f2e7d0de0b.zip
make <num! 4> == <num= 4>
Diffstat (limited to 'alv/base')
-rw-r--r--alv/base/match.moon4
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