From d7ca3739aa8b608609b04f878f4064140354dec7 Mon Sep 17 00:00:00 2001 From: Christian Lincoln Date: Tue, 3 Mar 2026 14:22:18 +0000 Subject: [PATCH] Renaming. --- {src => nellie}/helper.lua | 0 {src => nellie}/index.lua | 0 {src => nellie}/interpreter.lua | 0 nellie => nellie/nellie | 0 {src => nellie}/parser.lua | 0 src/nelli.lua => nellie/proto.lua | 27 ++++++++++++--------------- test | 0 tests/print.nel | 0 tests/test.lua | 1 + 9 files changed, 13 insertions(+), 15 deletions(-) rename {src => nellie}/helper.lua (100%) rename {src => nellie}/index.lua (100%) rename {src => nellie}/interpreter.lua (100%) rename nellie => nellie/nellie (100%) rename {src => nellie}/parser.lua (100%) rename src/nelli.lua => nellie/proto.lua (96%) create mode 100644 test create mode 100644 tests/print.nel create mode 100644 tests/test.lua diff --git a/src/helper.lua b/nellie/helper.lua similarity index 100% rename from src/helper.lua rename to nellie/helper.lua diff --git a/src/index.lua b/nellie/index.lua similarity index 100% rename from src/index.lua rename to nellie/index.lua diff --git a/src/interpreter.lua b/nellie/interpreter.lua similarity index 100% rename from src/interpreter.lua rename to nellie/interpreter.lua diff --git a/nellie b/nellie/nellie similarity index 100% rename from nellie rename to nellie/nellie diff --git a/src/parser.lua b/nellie/parser.lua similarity index 100% rename from src/parser.lua rename to nellie/parser.lua diff --git a/src/nelli.lua b/nellie/proto.lua similarity index 96% rename from src/nelli.lua rename to nellie/proto.lua index 9dffc44..e373c7d 100644 --- a/src/nelli.lua +++ b/nellie/proto.lua @@ -1,3 +1,4 @@ +-- Prototype for nel require("interpreter") function Bind(scope,abstract,callback) @@ -19,6 +20,7 @@ end NelliScope = Scope() local ns = NelliScope +--[[ -- Replace all :text() occurrences with ones in 'exp_map' local function substitute(target,exp_map) local text = target:text() @@ -64,7 +66,7 @@ local function Bexpands(s,e,c) --[[error(string.format( "nel: Abstract parameter \"%s\" not in 'quotes'.", text - ))]] + ))]]--[[ else table.insert(bound,text) end @@ -78,8 +80,8 @@ local function Bexpands(s,e,c) local expanded = substitute(e.expression,map) return Run(_s,expanded,_c,"means: "..tostring(expanded)) end) -end -Bind(ns,"(abstract) means (expression)",Bexpands) +end]] +--[[Bind(ns,"(abstract) means (expression)",Bexpands) local function Bevaluate(s,e,c) return Binding(e.abstract,function(_s,_e,_c) local scope = Scope() @@ -259,27 +261,20 @@ Bind(ns,"evaluate (text) in (scope)",function(s,e,c) local scope = Run(s,e.scope,c,"evaluate: scope") return Run(s,interpret(Run(scope,e.text,c,"include: source")),c,"include: result") end) -Bind(ns,"print (text)",function(s,e,c) - log(Run(s,e.text,c,"print: text")) -end) Bind(ns,"text (literal)",function(s,e,c) return e.literal:text() end) Bind(ns,"return (expression)",function(s,e,c) return Run(s,e.expression,c,"return: result") -end) -Bind(ns,"(macro) means (expansion)",function(s,e,c) - -end) -Bind(ns,"(identifier) is (value)",function(s,e,c) - -end) -Bind(ns,"(expression) becomes (result)",function(s,e,c) - end) Bind(ns,"let (binding) in (scope)",function(s,e,c) end) +]] + +Bind(ns,"print (text)",function(s,e,c) + log(Run(s,e.text,c,"print: text")) +end) local Hpath = "nel/helper.nel" local Hchain = Chain("in internal: "..Hpath) @@ -288,6 +283,8 @@ local success,result = Hchain:call(function(chain) end) --[[ Documentation: +(log (text)) -> Log text to the output stream (print?) + (a new scope) -> Becomes a created new scope (this scope) -> Becomes the current scope diff --git a/test b/test new file mode 100644 index 0000000..e69de29 diff --git a/tests/print.nel b/tests/print.nel new file mode 100644 index 0000000..e69de29 diff --git a/tests/test.lua b/tests/test.lua new file mode 100644 index 0000000..f5f8a0d --- /dev/null +++ b/tests/test.lua @@ -0,0 +1 @@ +require("") \ No newline at end of file