-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
C code:
#define TEST(s) #s
int printf(const char* str, ...);
int main()
{
printf("%s\n", TEST(hello));
return 0;
}
When I ran the above code, it outputted:
hello)
A right bracket was appended to the string, so I modified the function nextc() in lexer.c to:
static char nextc()
{
char c = lex_process->functions->next_char(lex_process);
if(lex_is_in_expression())
{
buffer_write(lex_process->parentheses_buffer, c);
if(lex_process->argument_string_buffer)
{
if(c != ')') //I only added this if statement before buffer_write, I don't know if it is ok or not
buffer_write(lex_process->argument_string_buffer, c);
}
}
lex_process->pos.col += 1;
if (c == '\n')
{
lex_process->pos.line += 1;
lex_process->pos.col = 1;
}
return c;
}
It ouputted correctly, but I am not sure it would affects other functionalities or not.
Metadata
Metadata
Assignees
Labels
No labels