aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/env.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-05-19 23:54:16 -0400
committerEduardo Julian2017-05-19 23:54:16 -0400
commitb81f241bd90092f52a47f64f4dc8297cc4f82f56 (patch)
treea07f20ec91597ca98e66833e14c42accf6b169f7 /new-luxc/source/luxc/env.lux
parenta73037f8ab46e31196b1257d7621ceeacb1cad38 (diff)
- WIP: Added pattern-matching (case) analysis.
Diffstat (limited to 'new-luxc/source/luxc/env.lux')
-rw-r--r--new-luxc/source/luxc/env.lux10
1 files changed, 10 insertions, 0 deletions
diff --git a/new-luxc/source/luxc/env.lux b/new-luxc/source/luxc/env.lux
index edc6a4a5b..e15e01130 100644
--- a/new-luxc/source/luxc/env.lux
+++ b/new-luxc/source/luxc/env.lux
@@ -146,3 +146,13 @@
output])
))
))
+
+(def: #export next-local
+ (Lux Nat)
+ (function [compiler]
+ (case (get@ #;scopes compiler)
+ #;Nil
+ (#R;Error "Cannot get next reference when there is no scope.")
+
+ (#;Cons top _)
+ (#R;Success [compiler (get@ [#;locals #;counter] top)]))))