Commit Graph

13 Commits

Author SHA1 Message Date
Jan Nieuwenhuizen ccddde9a84 mescc: Output performance hacks: use core:display.
* src/lib.c (display_): Write to g_stdout (WAS: STDOUT).
* module/mes/guile.scm (guile): Declare and export core:display core:display-error.
* module/mes/M1.mes (object->M1): Use core:display and string-append
  instead of format.
* module/mes/guile.mes (with-input-from-string): Add debugging.
  (open-input-string): Likewise.
  (read-string): Likewise.  Re-implement.
  (drain-input): Use read-string.
2017-12-09 20:10:57 +01:00
Jan Nieuwenhuizen 21aff4c7ad mes: Simplify read-string.
* module/mes/guile.mes (read-string): Simplify, probably fix even.
2017-05-21 12:21:07 +02:00
Jan Nieuwenhuizen 45ce77df85 core: Add current-output-port, open-output-file, set-current-output-port.
* libc/include/fcntl.h: Declare it.  Add some fcntl defines.
* libc/include/stdio.h: Remove fcntl defines, Declare g_stdout.
* module/language/c99/compiler.mes (c99-input->ast): Define O_WRONLY, O_RDWR.
* module/mes/guile.mes (with-output-to-file, with-output-to-port): New functions.
* src/posix.c (current_output_port, open_output_file,
  set_current_output_port): New functions.
* libc/mlibc.c (open): Add optional mode parameter.
* module/mes/libc-i386.mes (i386:open): Forward third parameter.
* scaffold/mini-mes.c (main): Init g_stdout.
* src/mes.c (main): Likewise.
2017-05-19 06:56:47 +02:00
Jan Nieuwenhuizen ec935e5667 mes: Consider GUILE_LOAD_PATH for include-from-path.
* module/mes/guile.scm (include-from-path): New macro.
2017-05-07 08:23:20 +02:00
Jan Nieuwenhuizen 92c363701b mes: Add srfi-16 to Nyacc Guile support.
* module/mes/guile.mes: Include srfi-16 for Nyacc.
2017-05-06 22:47:45 +02:00
Jan Nieuwenhuizen 9918ffab92 Add access?
* libc/mlibc.c (access): New function.
* module/mes/libc-i386.mes (i386:access): New function.
  (i386:libc): Add it.
* src/posix.c (access_p): New function.
* module/mes/posix.mes: New file.
* module/mes/base-0.mes (mes): Include it.
* module/mes/read-0-32.mo: Regenerate.
2017-04-16 09:51:45 +02:00
Jan Nieuwenhuizen 2c25f45678 scm: Add access?
* module/mes/guile.mes (access?): New dummy function.  Fixes Nyacc's #include.
2017-03-31 21:41:32 +02:00
Jan Nieuwenhuizen d938b38d5e scm: Add open-input-string, read-string.
* module/mes/guile.mes (open-input-string, read-string): New functions.
* tests/guile.test: New file.
* GNUmakefile (TESTS): Add it.
2017-04-01 12:51:35 +02:00
Jan Nieuwenhuizen fc263de433 build: Cleanup, use gcc-specific snarfing.
* .gitignore: Ignore *.o-32, mes-mini-mes.
* scripts/nyacc-calc.mes: Remove.
* scripts/nyacc.mes: Remove.
* scripts/paren.mes: Remove.
* make/install.make (install): Remove them.
p* module/mes/mes-0.mes: Remove.
* module/mes/loop-0.mes: Remove.
* build-aux/mes-snarf.scm (main): Add --mini option.
* GNUmakefile (mini-mes): Use it.
2017-04-02 17:01:22 +02:00
Jan Nieuwenhuizen 945fb39d18 scm: Bugfix drain-input.
* module/mes/guile.mes (drain-input): Bugfix: return string.
2017-03-27 21:00:49 +02:00
Jan Nieuwenhuizen b8fd6ca7b9 Add drain-input.
* module/mes/guile.mes (drain-input): New function.
2017-01-04 09:16:52 +01:00
Jan Nieuwenhuizen da6bd4cf97 Add make-string, object->string.
* module/mes/guile.mes (make-string, object->string): New functions.
2017-01-04 09:12:26 +01:00
Jan Nieuwenhuizen 77a9146aa5 Add support for including Guile files.
* module/mes/guile.mes: New file.
* module/mes/pretty-print.mes: New file.
2016-12-18 15:48:49 +01:00