From 1b6da2babfc65c4b8f6f7ac8644c0498e094bab7 Mon Sep 17 00:00:00 2001 From: s-ol Date: Mon, 3 Feb 2020 11:59:10 +0100 Subject: Forward references --- base.moon | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'base.moon') diff --git a/base.moon b/base.moon index fc9f885..0404e3d 100644 --- a/base.moon +++ b/base.moon @@ -34,6 +34,12 @@ class Macro __tostring: => "" __inherited: (cls) => cls.__base.__tostring = @__tostring +class Forward + new: (@node) => + + get: => (assert @node.value, "node never patched!")\get! + getc: => (assert @node.value, "node never patched!")\getc! + class Const types = { sym: true @@ -78,7 +84,7 @@ class Const switch ancestor klass when Op then 'op' when Scope then 'scope' - when Const + when Const, Forward return val else error "#{name}: cannot wrap '#{klass.__name}' instance" @@ -93,5 +99,6 @@ class Const { :Op :Macro + :Forward :Const } -- cgit v1.2.3