mescc: Tinycc support: comma operator.

* module/language/c99/compiler.mes (expr->accu): Handle comma operator.
* scaffold/tests/74-multi-line-string.c (test): Test it.
This commit is contained in:
Jan Nieuwenhuizen 2017-07-17 00:29:18 +02:00
parent 3cdfdd7407
commit 59e663021a
2 changed files with 9 additions and 2 deletions

View File

@ -449,6 +449,13 @@
locals)) locals))
(pmatch o (pmatch o
((expr) info) ((expr) info)
((comma-expr) info)
((comma-expr ,a . ,rest)
(let ((info ((expr->accu info) a)))
((expr->accu info) `(comma-expr ,@rest))))
((p-expr (string ,string)) ((p-expr (string ,string))
(let* ((globals ((globals:add-string globals) string)) (let* ((globals ((globals:add-string globals) string))
(info (clone info #:globals globals))) (info (clone info #:globals globals)))

View File

@ -31,7 +31,7 @@ char const* help =
int int
test () test ()
{ {
if (strcmp (help, "All your base are")) return 1; if (printf ("belong to us"), strcmp (help, "All your base are")) return 1;
return 0; return 2,1,0;
} }