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:
parent
3cdfdd7407
commit
59e663021a
|
@ -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)))
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue