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+removethis@s-ol.nu>2025-03-02 14:23:21 +0000
commitd36259f60b3e6f6077710905d5f7fcfd9f1710fc (patch)
treeec6975f00af35b0faf83f8c20b7ad0eab6e7ae7f /alv/base
parentadd and test Type:eq(a,b) (diff)
downloadalive-d36259f60b3e6f6077710905d5f7fcfd9f1710fc.tar.gz
alive-d36259f60b3e6f6077710905d5f7fcfd9f1710fc.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