From e8c4953719a057bec2c1344633cf88c480948e40 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 2 Feb 2012 03:41:16 +1000 Subject: Fix up crements ignorables. --- LuaSL/src/LuaSL_LSL_tree.h | 3 ++- LuaSL/src/LuaSL_compile.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'LuaSL/src') diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h index 64832d2..8be8afd 100644 --- a/LuaSL/src/LuaSL_LSL_tree.h +++ b/LuaSL/src/LuaSL_LSL_tree.h @@ -224,7 +224,8 @@ struct _LSL_Parenthesis struct _LSL_Identifier // For variables and function parameters. { LSL_Text name; - const char *sub; + Eina_Strbuf *ignorable; + const char *sub; LSL_Leaf value; }; diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index 73b43dd..ac4d779 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c @@ -495,6 +495,10 @@ LSL_Leaf *addCrement(LuaSL_compiler *compiler, LSL_Leaf *variable, LSL_Leaf *cre if ((variable) && (crement)) { crement->value.identifierValue = variable->value.identifierValue; +#if LUASL_DIFF_CHECK + crement->value.identifierValue->ignorable = variable->ignorable; + variable->ignorable = NULL; +#endif crement->basicType = variable->basicType; crement->toKen = tokens[type - lowestToken]; } @@ -1698,12 +1702,20 @@ static void outputCrementsToken(FILE *file, outputMode mode, LSL_Leaf *content) case LSL_INCREMENT_PRE : { fprintf(file, "%s", content->toKen->toKen); +#if LUASL_DIFF_CHECK + if (content->value.identifierValue->ignorable) + fwrite(eina_strbuf_string_get(content->value.identifierValue->ignorable), 1, eina_strbuf_length_get(content->value.identifierValue->ignorable), file); +#endif outputText(file, &(content->value.identifierValue->name), FALSE); break; } case LSL_DECREMENT_POST : case LSL_INCREMENT_POST : { +#if LUASL_DIFF_CHECK + if (content->value.identifierValue->ignorable) + fwrite(eina_strbuf_string_get(content->value.identifierValue->ignorable), 1, eina_strbuf_length_get(content->value.identifierValue->ignorable), file); +#endif outputText(file, &(content->value.identifierValue->name), FALSE); fprintf(file, "%s", content->toKen->toKen); break; -- cgit v1.1