From b81f241bd90092f52a47f64f4dc8297cc4f82f56 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 19 May 2017 23:54:16 -0400 Subject: - WIP: Added pattern-matching (case) analysis. --- new-luxc/source/luxc/env.lux | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'new-luxc/source/luxc/env.lux') 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)])))) -- cgit v1.2.3