mescc: Support strings in struct initialization.
authorJan Nieuwenhuizen <janneke@gnu.org>
Thu, 9 Mar 2017 07:14:27 +0000 (08:14 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Thu, 9 Mar 2017 07:14:27 +0000 (08:14 +0100)
commite9560e95a5231da21d241afb1230615fe3647b84
tree7cb958fc857000b5d9eac885eab2e2fb0e52eedf
parent64e73dcf297ed4b412aa7032b78e2799ac0b3cce
mescc: Support strings in struct initialization.

* module/mes/elf-util.mes (add-s:-prefix, drop-s:-prefix): New functions.
* module/mes/elf-util.scm: Export them.
* module/language/c99/compiler.mes (string->global): Add `s:' prefix
  to global strings.  Update users.
  (expr->arg): Update.
  (expr->accu): Handle string expressions.
  (initzer->global): New function.
  (struct-field): Handle string field.
* doc/examples/t.c: Test it.
* doc/examples/mini-mes.c: Use it.

dun!
module/language/c99/compiler.mes
module/mes/elf-util.mes
module/mes/elf-util.scm
scaffold/mini-mes.c
scaffold/t.c