diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2017-10-08 15:06:05 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2017-10-08 15:06:05 -0700 |
| commit | 529afd465fbbfbf923831d8a33fc3ce349dc703f (patch) | |
| tree | b87f31c1e2e2832c80acd7baa60656c45420ac87 /nomsu.moon | |
| parent | 6a429d79558f70578ba30565f5ae299f0fe42da1 (diff) | |
Fixed permissions to work better with aliases.
Diffstat (limited to 'nomsu.moon')
| -rwxr-xr-x | nomsu.moon | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -191,7 +191,8 @@ class NomsuCompiler @utils = utils @repr = (...)=> repr(...) @loaded_files = {} - @initialize_core! + if not parent + @initialize_core! writeln:(...)=> @write(...) @@ -200,6 +201,7 @@ class NomsuCompiler def: (signature, thunk, src, is_macro=false)=> assert type(thunk) == 'function', "Bad thunk: #{repr thunk}" canonical_args = nil + aliases = {} for {stub, arg_names} in *@get_stubs(signature) assert stub, "NO STUB FOUND: #{repr signature}" if @debug then @writeln "#{colored.bright "DEFINING RULE:"} #{colored.underscore colored.magenta repr(stub)} #{colored.bright "WITH ARGS"} #{colored.dim repr(arg_names)}" @@ -208,7 +210,8 @@ class NomsuCompiler if canonical_args assert utils.equivalent(utils.set(arg_names), canonical_args), "Mismatched args" else canonical_args = utils.set(arg_names) - @defs[stub] = {:thunk, :stub, :arg_names, :src, :is_macro} + insert aliases, stub + @defs[stub] = {:thunk, :stub, :arg_names, :src, :is_macro, :aliases} defmacro: (signature, thunk, src)=> @def(signature, thunk, src, true) |
