WONKY



LOG | FILES | OVERVIEW


F diff --git a/src/misc/gcc_string.c b/src/misc/gcc_string.c --- a/src/misc/gcc_string.c +++ b/src/misc/gcc_string.c
return ret;
}
+ void gmemmove(void *where_to,void *from_where,size_t how_many_bytes)
+ {
+ size_t i;
+ for(i=0;i<how_many_bytes;++i)
+ ((char*)where_to)[i]=((char *)from_where)[i];
+ }
#endif
F diff --git a/src/misc/gcc_string.h b/src/misc/gcc_string.h --- a/src/misc/gcc_string.h +++ b/src/misc/gcc_string.h
char *gstr_append_and_consume(const char *lead,const char *follower);
char* gstr_dup(const char *first,const char *last,size_t limit);
char* gstr_to_heap(const char *literal);
+ void gmemmove(void *where_to,void *from_where,size_t how_many_bytes);
#endif
F diff --git a/src/semantics/program/translation_unit.c b/src/semantics/program/translation_unit.c --- a/src/semantics/program/translation_unit.c +++ b/src/semantics/program/translation_unit.c
{
struct token *hold_token;
struct token *hold_hold_token;
+ struct token *hold_hold_hold_token;
hold_token=token_ptr_get_token_under_pointer_inner(token_pointer);
if(hold_token->type==KW_STRING)
{
- while(token_ptr_check_next_normal_token(token_pointer)->type==KW_STRING)
+ while( (hold_hold_hold_token=token_ptr_check_next_normal_token(token_pointer))->type==KW_STRING
+ || hold_hold_hold_token->type==PKW_FILE_MACRO
+ )
{
hold_hold_token=hold_token;
hold_token=token_ptr_get_token_under_pointer_inner(token_pointer);
+ hold_token=get_token_from_two_adjacent_strings((struct token_string*)hold_hold_token,(struct token_string*)hold_token);
}
}
F diff --git a/src/semantics/value/constant.c b/src/semantics/value/constant.c --- a/src/semantics/value/constant.c +++ b/src/semantics/value/constant.c
/*TODO*/
struct Constant* concatenate_string_literals(struct Constant *first,struct Constant *second)
{
+ size_t first_size;
+ size_t second_size;
+ char *hold_new;
+ first_size=get_type_size(first->type);
+ second_size=get_type_size(second->type);
- return first;
+ hold_new=wonky_malloc(first_size+second_size);
+
+ gmemmove(hold_new,first->value,first_size);
+ gmemmove(hold_new+first_size,second->value,second_size);
+
+ return extract_literal_string(hold_new,first_size+second_size);
}
struct Constant* get_long_long_int_constant(long long number)