aboutsummaryrefslogtreecommitdiff
path: root/source/meta.c
diff options
context:
space:
mode:
authorRaymaekers Luca <luca@spacehb.net>2025-03-18 11:26:40 +0100
committerRaymaekers Luca <luca@spacehb.net>2025-03-18 11:26:40 +0100
commitfee81a2dbda7791f462adc70e080e4bb6e96365f (patch)
tree22eeb8e39ecf018bbad00a7e327d47bf8e389c14 /source/meta.c
parentc1cbf799aef1393fecd707b6121c8a3d94d0a773 (diff)
Bug fixes
Fixed not outputting '@' if no keyword follows Fixed not outputting newline after @expand expression
Diffstat (limited to 'source/meta.c')
-rw-r--r--source/meta.c16
1 files changed, 5 insertions, 11 deletions
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];
}