From 14d348bad98fc9a769bf1de4e5502856c0524d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Reuh=20Fildadut?= Date: Sat, 27 Nov 2021 14:37:55 +0100 Subject: [PATCH] Untypo --- interpreter/interpreter.lua | 4 +-- ...ice line interpolation with text event.lua | 30 +++++++++---------- ...ext line interpolation with text event.lua | 22 +++++++------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/interpreter/interpreter.lua b/interpreter/interpreter.lua index 909821b..b124517 100644 --- a/interpreter/interpreter.lua +++ b/interpreter/interpreter.lua @@ -18,9 +18,9 @@ local function post_process_text(state, text) for i=1, #text-1 do local a, b = text[i], text[i+1] local na = #a.text:match(" *$") - local nb = #b.text:match(" *$") + local nb = #b.text:match("^ *") if na > 0 and nb > 0 then -- remove duplicated spaces from second element first - b.text = b.text:match("^(.-) *$") + b.text = b.text:match("^ *(.-)$") end if na > 1 then a.text = a.text:match("^(.- ) *$") diff --git a/test/tests/choice line interpolation with text event.lua b/test/tests/choice line interpolation with text event.lua index 62e9a1d..12204c3 100644 --- a/test/tests/choice line interpolation with text event.lua +++ b/test/tests/choice line interpolation with text event.lua @@ -4,20 +4,20 @@ _[29]={} _[28]={} _[27]={1} _[26]={} -_[25]={tags=_[26],text=" to move."} -_[24]={tags=_[26],text=" joystick"} -_[23]={tags=_[30],text="left"} -_[22]={tags=_[26],text="Use "} -_[21]={tags=_[29],text="Other"} +_[25]={text=" to move.",tags=_[26]} +_[24]={text="joystick",tags=_[26]} +_[23]={text="left ",tags=_[30]} +_[22]={text="Use ",tags=_[26]} +_[21]={text="Other",tags=_[29]} _[20]={} -_[19]={tags=_[28],text="No"} -_[18]={tags=_[20],text=" to jump."} -_[17]={tags=_[27],text="A"} -_[16]={tags=_[20],text="Press "} -_[15]={tags=_[26],text="ok"} +_[19]={text="No",tags=_[28]} +_[18]={text="to jump.",tags=_[20]} +_[17]={text="A ",tags=_[27]} +_[16]={text="Press ",tags=_[20]} +_[15]={text="ok",tags=_[26]} _[14]={_[22],_[23],_[24],_[25]} _[13]={_[21]} -_[12]={tags=_[20],text="ok"} +_[12]={text="ok",tags=_[20]} _[11]={_[19]} _[10]={_[16],_[17],_[18]} _[9]={_[15]} @@ -36,10 +36,10 @@ return {_[1],_[2],_[3],_[4],_[5]} text = "Press " }, { tags = { 1 }, - text = "A" + text = "A " }, { tags = , - text = " to jump." + text = "to jump." } }, { { tags = {}, text = "No" @@ -56,10 +56,10 @@ return {_[1],_[2],_[3],_[4],_[5]} text = "Use " }, { tags = { 1 }, - text = "left" + text = "left " }, { tags =
, - text = " joystick" + text = "joystick" }, { tags =
, text = " to move." diff --git a/test/tests/text line interpolation with text event.lua b/test/tests/text line interpolation with text event.lua index cab6e7e..c208c91 100644 --- a/test/tests/text line interpolation with text event.lua +++ b/test/tests/text line interpolation with text event.lua @@ -3,13 +3,13 @@ _[16]={1} _[15]={} _[14]={1} _[13]={} -_[12]={tags=_[15],text=" to move."} -_[11]={tags=_[15],text=" joystick"} -_[10]={tags=_[16],text="left"} -_[9]={tags=_[15],text="Use "} -_[8]={tags=_[13],text=" to jump."} -_[7]={tags=_[14],text="A"} -_[6]={tags=_[13],text="Press "} +_[12]={text=" to move.",tags=_[15]} +_[11]={text="joystick",tags=_[15]} +_[10]={text="left ",tags=_[16]} +_[9]={text="Use ",tags=_[15]} +_[8]={text="to jump.",tags=_[13]} +_[7]={text="A ",tags=_[14]} +_[6]={text="Press ",tags=_[13]} _[5]={_[9],_[10],_[11],_[12]} _[4]={_[6],_[7],_[8]} _[3]={"return"} @@ -22,20 +22,20 @@ return {_[1],_[2],_[3]} text = "Press " }, { tags = { 1 }, - text = "A" + text = "A " }, { tags =
, - text = " to jump." + text = "to jump." } } } { "text", { { tags = <1>{}, text = "Use " }, { tags = { 1 }, - text = "left" + text = "left " }, { tags =
, - text = " joystick" + text = "joystick" }, { tags =
, text = " to move."