diff --git a/module/language/c99/compiler.mes b/module/language/c99/compiler.mes index 90d24f27..a544757e 100644 --- a/module/language/c99/compiler.mes +++ b/module/language/c99/compiler.mes @@ -942,6 +942,12 @@ (info (clone info #:globals globals))) (append-text info (list (i386:label->accu `(#:string ,string)))))) + ((p-expr (string . ,strings)) + (let* ((string (apply string-append strings)) + (globals ((globals:add-string globals) string)) + (info (clone info #:globals globals))) + (append-text info (list (i386:label->accu `(#:string ,string)))))) + ((p-expr (fixed ,value)) (let ((value (cstring->number value))) (append-text info (wrap-as (i386:value->accu value))))) @@ -954,9 +960,6 @@ (let ((char (char->integer (car (string->list char))))) (append-text info (wrap-as (i386:value->accu char))))) - ((p-expr (string . ,strings)) - (append-text info (list (i386:label->accu `(#:string ,(apply string-append strings)))))) - (,char (guard (char? char)) (append-text info (wrap-as (i386:value->accu char)))) ((p-expr (ident ,name)) diff --git a/module/mes/M1.mes b/module/mes/M1.mes index 3280cd58..2713df2d 100644 --- a/module/mes/M1.mes +++ b/module/mes/M1.mes @@ -110,7 +110,7 @@ (let ((index (list-index (lambda (s) (equal? s o)) strings))) (if index (string-append "_string_" file-name "_" (number->string index)) - ""))) + (error "no such string:" o)))) (define (text->M1 o) (cond ((char? o) (text->M1 (char->integer o))) diff --git a/scaffold/tests/t.c b/scaffold/tests/t.c index a92504c0..9dad4c89 100644 --- a/scaffold/tests/t.c +++ b/scaffold/tests/t.c @@ -153,6 +153,8 @@ main (int argc, char* argv[]) if (lst[i+1] != i) return 30 + i; } + puts ("foo" + "bar"); return 0; }