Renamed "require %" to "use %"

This commit is contained in:
Bruce Hill 2018-01-11 03:35:35 -08:00
parent 9d8c701441
commit 756c1f718e
13 changed files with 35 additions and 35 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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;"

View File

@ -1,4 +1,4 @@
require "lib/metaprogramming.nom"
use "lib/metaprogramming.nom"
# Moonscript!
parse [moonscript do> %moonscript_code] as:

View File

@ -1,4 +1,4 @@
require "lib/metaprogramming.nom"
use "lib/metaprogramming.nom"
# Literals
compile [true, yes] to: "true"

View File

@ -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)

View File

@ -1,4 +1,4 @@
require "lib/core.nom"
use "lib/core.nom"
# Plurals
using:

View File

@ -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);

View File

@ -1,4 +1,4 @@
require "lib/metaprogramming.nom"
use "lib/metaprogramming.nom"
# For unit testing
rule [test tree %generated == %expected] =:

View File

@ -1,4 +1,4 @@
require "lib/metaprogramming.nom"
use "lib/metaprogramming.nom"
# Error functions
action [error!, panic!, fail!, abort!]:

View File

@ -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:

View File

@ -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 {

View File

@ -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});"