diff --git a/anselme.lua b/anselme.lua index fc534b6..c0b3ccc 100644 --- a/anselme.lua +++ b/anselme.lua @@ -55,13 +55,13 @@ local anselme = { -- * `api`, which is incremented at each update which may break Lua API compatibility versions = { save = 2, - language = 23, + language = 24, api = 5 }, --- General version number. -- -- It is incremented at each update. - version = 24, + version = 25, --- Currently running [interpreter](#interpreters). -- `nil` if no interpreter running. running = nil diff --git a/interpreter/common.lua b/interpreter/common.lua index fa8aa6e..70a12ea 100644 --- a/interpreter/common.lua +++ b/interpreter/common.lua @@ -538,7 +538,7 @@ common = { -- returns true in case of success -- returns nil, err in case of error make_space_for = function(self, state, type) - if #state.interpreter.event_buffer_stack == 0 and state.interpreter.current_event and state.interpreter.current_event.type ~= type then -- FIXME useful? + if #state.interpreter.event_buffer_stack == 0 and state.interpreter.current_event and state.interpreter.current_event.type ~= type then return self:manual_flush(state) end return true diff --git a/notes.txt b/notes.txt index a23ad37..9b1e4a4 100644 --- a/notes.txt +++ b/notes.txt @@ -52,6 +52,7 @@ TODO: type system is not super nice to use. TODO: some sensible way to capture text event in string litterals (string interpolation/subtexts)? -> meh, this means we can capture choice events, and choice events contain their code block, and we don't want to store code blocks in the save file (as code can be updated/translated/whatever) ignoring choice events, we might be able to use subtexts in string litterals; using the same code for text lines and text litterals? we would lose tags... + -> no. would break ability to switch between two translations of the script as the save would contain the text events from the previous language. TODO: simplify language, it is much too complicated. Less line types? (var def, func, checkpoint, tag). Rewrite some ad hoc syntax using the expression system? diff --git a/parser/common.lua b/parser/common.lua index 9a23182..1dcea17 100644 --- a/parser/common.lua +++ b/parser/common.lua @@ -193,7 +193,7 @@ common = { text = rem:match("^%s*}(.*)$") -- start subtext elseif allow_subtext and r:match("^%[") then - local exp, rem = common.parse_text(r:gsub("^%[", ""), state, namespace, "text", allow_binops, allow_subtext, true) + local exp, rem = common.parse_text(r:gsub("^%[", ""), state, namespace, "text", "#~", allow_subtext, true) if not exp then return nil, rem end if not rem:match("^%]") then return nil, ("expected closing ] at end of subtext before %q"):format(rem) end -- add to text