From 02d50fb79fea0c7e88ad1e3b83c71bbc2c0ecd5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Reuh=20Fildadut?= Date: Sun, 28 Nov 2021 16:31:51 +0100 Subject: [PATCH] Update notes --- interpreter/interpreter.lua | 4 ++-- notes.txt | 44 +++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/interpreter/interpreter.lua b/interpreter/interpreter.lua index a79d35f..cc67c33 100644 --- a/interpreter/interpreter.lua +++ b/interpreter/interpreter.lua @@ -1,5 +1,5 @@ local eval -local truthy, merge_state, escape, get_variable, eval_text_callback, tags, events +local truthy, merge_state, escape, get_variable, tags, events local run_line, run_block -- returns var in case of success and there is a return @@ -206,7 +206,7 @@ local interpreter = { package.loaded[...] = interpreter eval = require((...):gsub("interpreter$", "expression")) local common = require((...):gsub("interpreter$", "common")) -truthy, merge_state, tags, get_variable, eval_text_callback, events = common.truthy, common.merge_state, common.tags, common.get_variable, common.eval_text_callback, common.events +truthy, merge_state, tags, get_variable, events = common.truthy, common.merge_state, common.tags, common.get_variable, common.events escape = require((...):gsub("interpreter%.interpreter$", "parser.common")).escape return interpreter diff --git a/notes.txt b/notes.txt index 4df685a..34b55f5 100644 --- a/notes.txt +++ b/notes.txt @@ -41,6 +41,50 @@ Reserved symbols that are still not used as a line type: `^+-= checkpoints defined using fn + + OK for tag though: pushtag/poptag fn: + + # color:red + a + + translate to + + ~ tag.push(color:red) + a + ~ tag.pop() + +TODO: perform seen/reached/etc default variable not in interpreter but using parse-time macro + +TODO: no function call without () (reference to fn instead?). Fn could be stored in save but replaced with new versions on code reload... -> how to track these references? + if we make fn first class this means anonymous fn, is it ok? + +TODO: make language simple enough to be able to reimplement it in, say, nim. Especially the interpreter (we could precompile a lot of stuff...) + TODO: test reacheability of script paths TODO: redisign the checkpoint system to work better when used with parallel scripts (if both change the same variable, will be overwritten)