From 37ab76c9d1f43e9c0197ade428be76618931d8e7 Mon Sep 17 00:00:00 2001 From: Franck Dary <franck.dary@lis-lab.fr> Date: Thu, 19 Mar 2020 17:46:00 +0100 Subject: [PATCH] Its now impossible to have empty forms --- reading_machine/src/Action.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reading_machine/src/Action.cpp b/reading_machine/src/Action.cpp index 2d0aa64..4dc7d6f 100644 --- a/reading_machine/src/Action.cpp +++ b/reading_machine/src/Action.cpp @@ -386,7 +386,15 @@ Action Action::addCurCharToCurWord() auto appliable = [](const Config & config, const Action &) { - return config.hasCharacter(config.getCharacterIndex()) and !util::isIllegal(config.getLetter(config.getCharacterIndex())); + if (!config.hasCharacter(config.getCharacterIndex())) + return false; + + auto letter = config.getLetter(config.getCharacterIndex()); + + if (letter == ' ') + return !util::isEmpty(config.getAsFeature("FORM", config.getWordIndex())); + + return !util::isIllegal(letter); }; return {Type::Write, apply, undo, appliable}; -- GitLab