Renamed "require %" to "use %"
This commit is contained in:
parent
9d8c701441
commit
756c1f718e
@ -1,7 +1,7 @@
|
||||
require "lib/metaprogramming.nom"
|
||||
require "lib/utils.nom"
|
||||
require "lib/control_flow.nom"
|
||||
require "lib/operators.nom"
|
||||
use "lib/metaprogramming.nom"
|
||||
use "lib/utils.nom"
|
||||
use "lib/control_flow.nom"
|
||||
use "lib/operators.nom"
|
||||
|
||||
# List/dict functions:
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "lib/metaprogramming.nom"
|
||||
require "lib/operators.nom"
|
||||
require "lib/utils.nom"
|
||||
use "lib/metaprogramming.nom"
|
||||
use "lib/operators.nom"
|
||||
use "lib/utils.nom"
|
||||
|
||||
# Conditionals
|
||||
immediately:
|
||||
|
14
lib/core.nom
14
lib/core.nom
@ -1,8 +1,8 @@
|
||||
require "lib/metaprogramming.nom"
|
||||
require "lib/utils.nom"
|
||||
require "lib/operators.nom"
|
||||
require "lib/control_flow.nom"
|
||||
require "lib/collections.nom"
|
||||
require "lib/utils2.nom"
|
||||
require "lib/scopes.nom"
|
||||
use "lib/metaprogramming.nom"
|
||||
use "lib/utils.nom"
|
||||
use "lib/operators.nom"
|
||||
use "lib/control_flow.nom"
|
||||
use "lib/collections.nom"
|
||||
use "lib/utils2.nom"
|
||||
use "lib/scopes.nom"
|
||||
lua> "nomsu.core_defs = nomsu.__class.def_number;"
|
||||
|
@ -1,4 +1,4 @@
|
||||
require "lib/metaprogramming.nom"
|
||||
use "lib/metaprogramming.nom"
|
||||
|
||||
# Moonscript!
|
||||
parse [moonscript do> %moonscript_code] as:
|
||||
|
@ -1,4 +1,4 @@
|
||||
require "lib/metaprogramming.nom"
|
||||
use "lib/metaprogramming.nom"
|
||||
|
||||
# Literals
|
||||
compile [true, yes] to: "true"
|
||||
|
@ -1,9 +1,9 @@
|
||||
require "lib/metaprogramming.nom"
|
||||
require "lib/control_flow.nom"
|
||||
require "lib/operators.nom"
|
||||
require "lib/collections.nom"
|
||||
use "lib/metaprogramming.nom"
|
||||
use "lib/control_flow.nom"
|
||||
use "lib/operators.nom"
|
||||
use "lib/collections.nom"
|
||||
|
||||
rule [called by %whitelist] =:
|
||||
action [called by %whitelist]:
|
||||
if ((%whitelist's "type") != "List"): %whitelist = [%whitelist]
|
||||
%defs = (..)
|
||||
dict ([(nomsu's "defs")->(nomsu "get_stub" [%]), yes] for all %whitelist)
|
||||
|
@ -1,4 +1,4 @@
|
||||
require "lib/core.nom"
|
||||
use "lib/core.nom"
|
||||
|
||||
# Plurals
|
||||
using:
|
||||
|
@ -1,7 +1,7 @@
|
||||
require "lib/metaprogramming.nom"
|
||||
require "lib/operators.nom"
|
||||
require "lib/control_flow.nom"
|
||||
require "lib/collections.nom"
|
||||
use "lib/metaprogramming.nom"
|
||||
use "lib/operators.nom"
|
||||
use "lib/control_flow.nom"
|
||||
use "lib/collections.nom"
|
||||
|
||||
compile [<%var> = %value] to code: ".."
|
||||
nomsu.defs['#vars'][\(repr (%var's "value"))] = \(%value as lua);
|
||||
|
@ -1,4 +1,4 @@
|
||||
require "lib/metaprogramming.nom"
|
||||
use "lib/metaprogramming.nom"
|
||||
|
||||
# For unit testing
|
||||
rule [test tree %generated == %expected] =:
|
||||
|
@ -1,4 +1,4 @@
|
||||
require "lib/metaprogramming.nom"
|
||||
use "lib/metaprogramming.nom"
|
||||
|
||||
# Error functions
|
||||
action [error!, panic!, fail!, abort!]:
|
||||
|
@ -1,8 +1,8 @@
|
||||
require "lib/metaprogramming.nom"
|
||||
require "lib/utils.nom"
|
||||
require "lib/control_flow.nom"
|
||||
require "lib/operators.nom"
|
||||
require "lib/collections.nom"
|
||||
use "lib/metaprogramming.nom"
|
||||
use "lib/utils.nom"
|
||||
use "lib/control_flow.nom"
|
||||
use "lib/operators.nom"
|
||||
use "lib/collections.nom"
|
||||
|
||||
|
||||
compile [say %str] to:
|
||||
|
@ -1220,7 +1220,7 @@ end]]):format(lua_code))
|
||||
self:define_action("run file %filename", "nomsu.moon", function(self, _filename)
|
||||
return self:run_file(_filename)
|
||||
end)
|
||||
return self:define_compile_action("require %filename", "nomsu.moon", function(self, _filename)
|
||||
return self:define_compile_action("use %filename", "nomsu.moon", function(self, _filename)
|
||||
local filename = self:tree_to_value(_filename)
|
||||
self:require_file(filename)
|
||||
return {
|
||||
|
@ -799,7 +799,7 @@ end]]\format(lua_code))
|
||||
@define_action "run file %filename", "nomsu.moon", (_filename)=>
|
||||
@run_file(_filename)
|
||||
|
||||
@define_compile_action "require %filename", "nomsu.moon", (_filename)=>
|
||||
@define_compile_action "use %filename", "nomsu.moon", (_filename)=>
|
||||
filename = @tree_to_value(_filename)
|
||||
@require_file(filename)
|
||||
return statements:"nomsu:require_file(#{repr filename});"
|
||||
|
Loading…
Reference in New Issue
Block a user