aboutsummaryrefslogtreecommitdiffstats
path: root/base.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-02-03 10:59:10 +0000
committers-ol <s-ol@users.noreply.github.com>2020-02-03 11:00:32 +0000
commit1b6da2babfc65c4b8f6f7ac8644c0498e094bab7 (patch)
tree61ef0fc20c511cd8936e6af2d889a2ffddab9211 /base.moon
parentfix error handling again (diff)
downloadalive-1b6da2babfc65c4b8f6f7ac8644c0498e094bab7.tar.gz
alive-1b6da2babfc65c4b8f6f7ac8644c0498e094bab7.zip
Forward references
Diffstat (limited to 'base.moon')
-rw-r--r--base.moon9
1 files changed, 8 insertions, 1 deletions
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: => "<macro: #{@@__name}>"
__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
}