aboutsummaryrefslogtreecommitdiffstats
path: root/core/pattern.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-03-01 17:44:56 +0000
committers-ol <s-ol@users.noreply.github.com>2020-03-01 17:46:04 +0000
commita1312100fad100190e20b1b3443b5cd962dc8999 (patch)
tree8fc6194fc4b326ee39a9ca6d798cd208664f5fc3 /core/pattern.moon
parentadd type-pattern matching language (diff)
downloadalive-a1312100fad100190e20b1b3443b5cd962dc8999.tar.gz
alive-a1312100fad100190e20b1b3443b5cd962dc8999.zip
new op interface part one
Diffstat (limited to 'core/pattern.moon')
-rw-r--r--core/pattern.moon4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/pattern.moon b/core/pattern.moon
index 45701e6..64b53b8 100644
--- a/core/pattern.moon
+++ b/core/pattern.moon
@@ -40,7 +40,7 @@ class Pattern
else
matches = @matches results[1]
assert @opt or matches, "couldn't match argument #{results[1]} as type #{@type}!"
- matches and table.remove results, 1
+ if matches then table.remove results, 1
match = (pattern, results) ->
patterns = while pattern
@@ -50,7 +50,7 @@ match = (pattern, results) ->
Pattern pat
values = [p\match results for p in *patterns]
assert #results == 0, "#{#results} extra arguments given!"
- unpack values
+ values
{
:Pattern