From fee81a2dbda7791f462adc70e080e4bb6e96365f Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 18 Mar 2025 11:26:40 +0100 Subject: Bug fixes Fixed not outputting '@' if no keyword follows Fixed not outputting newline after @expand expression --- source/meta.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'source/meta.c') diff --git a/source/meta.c b/source/meta.c index 1eb643d..9b7faff 100644 --- a/source/meta.c +++ b/source/meta.c @@ -180,12 +180,11 @@ main(int ArgC, char *Args[]) { Filename = Args[1]; } -#if 1 else { - Filename = "table.c"; + fprintf(stderr, "Usage: %s [filename]\n", Args[0]); + return 1; } -#endif // NOTE(luca): The memory is assumed to stay mapped until program exits, because we will use // pointers into that memory. @@ -239,7 +238,6 @@ main(int ArgC, char *Args[]) } Assert(ExpressionTable); - // TODO: not used yet while (IsWhitespace(In[At]) && At < InSize) At++; Assert(At < InSize); ExpressionTableArgumentAt = At; @@ -309,17 +307,13 @@ main(int ArgC, char *Args[]) memcpy(Out, Expansion.Memory, Expansion.Size); Out += Expansion.Size; } - else if (In[At] == '`') - { - // ERROR: When the last character is '`' does not print. - *Out++ = '\n'; - } - else + else if (In[At] != '`') { *Out++ = In[At++]; } } + *Out++ = '\n'; } Assert(At < InSize); @@ -486,7 +480,7 @@ main(int ArgC, char *Args[]) } else { - // ERROR: What if the code contains a non meta-"@_expand" tag ??? + *Out++ = '@'; *Out++ = In[At]; } -- cgit v1.2.3