Jan Nieuwenhuizen [Fri, 5 May 2017 20:13:01 +0000 (22:13 +0200)]
build: Resolve MODULEDIR confusion. Fixes mes installation.
* make/install.make (GUILEDIR): New variable. Was MODULEDIR.
(MODULEDIR): Mes' module dir.
* guile/mescc.scm: Update.
* src/mes.c (load_env, bload_env): Update.
Jan Nieuwenhuizen [Tue, 2 May 2017 12:08:59 +0000 (14:08 +0200)]
guix hash: 01m8n7zk4f1ryd61dj589zarx09vbi7fc5f8m1x5zfk6r7l0zja2
Jan Nieuwenhuizen [Thu, 27 Apr 2017 12:04:51 +0000 (14:04 +0200)]
guix.scm: Remove erroneous system restriction.
* guix.scm (mes): Remove second erroneous system restriction.
Jan Nieuwenhuizen [Sun, 25 Dec 2016 14:51:53 +0000 (15:51 +0100)]
Release 0.5.
* configure (VERSION): Bump.
Jan Nieuwenhuizen [Thu, 27 Apr 2017 10:07:26 +0000 (12:07 +0200)]
bootstrap: Regenerate.
* module/mes/read-0-32.mo: Regenerate.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 15:01:29 +0000 (17:01 +0200)]
doc: Release update.
* AUTHORS: Mention Nyacc and GuixSD.
* NEWS: Update.
* README: Update.
* doc/ANNOUNCE-0.5 New file.
* HACKING: Add pointers, update TODO/DONE.
Jan Nieuwenhuizen [Tue, 25 Apr 2017 18:20:10 +0000 (20:20 +0200)]
bootstrap: Regenerate.
* mes.mes: Regenerate.
Jan Nieuwenhuizen [Mon, 24 Apr 2017 17:09:54 +0000 (19:09 +0200)]
mescc: Parse mlibc early, show progress.
* module/mes/libc.mes (_start, strlen, getchar, assert_fail, ungetc,
putchar, fputc, eputs, fputs, puts, strcmp, itoa, isdigit, atoi,
malloc, realloc, strncmp, c:getenv): Change to function, add
progress. Update callers.
* module/language/c99/compiler.mes (c99-input->info): Compile libc separately.
* guile/mescc.scm: Update progress.
* scripts/mescc.mes: Update progress.
Jan Nieuwenhuizen [Tue, 25 Apr 2017 04:43:20 +0000 (06:43 +0200)]
bootstrap: Regenerate.
* mes.mes: Regenerate.
Jan Nieuwenhuizen [Mon, 24 Apr 2017 05:22:04 +0000 (07:22 +0200)]
core: Set argv for mescc too.
* src/mes.c (main)[!__MESC__]: Remove branch.
Jan Nieuwenhuizen [Mon, 24 Apr 2017 05:16:18 +0000 (07:16 +0200)]
bootstrap: Regenerate.
* mes.mes: Regenerate.
Jan Nieuwenhuizen [Sun, 23 Apr 2017 11:53:36 +0000 (13:53 +0200)]
mescc: Avoid duplication of globals.
* module/language/c99/compiler.mes (globals:add-string): New function.
(expr->arg): Use it to avoid globals duplication.
(expr->accu): Do not pre-add globals.
Jan Nieuwenhuizen [Sun, 23 Apr 2017 11:53:08 +0000 (13:53 +0200)]
mescc: Fix global creation in AND/OR clause.
* module/language/c99/compiler.mes (test->jump->info): Retain globals
created in AND/OR test.
Jan Nieuwenhuizen [Mon, 17 Apr 2017 21:32:02 +0000 (23:32 +0200)]
core: Move some debugging to MES_DEBUG=2.
* module/mes/base-0.mes (load): Add ;;;.
* src/gc.c (gc_flip): Test on g_debug > 1.
(gc): Likewise.
* src/mes.c (mes_builtins): Likewise.
(main): Likewise.
* src/reader.c (dump): Likewise.
Jan Nieuwenhuizen [Mon, 17 Apr 2017 21:29:54 +0000 (23:29 +0200)]
mescc: Add atoi.
* libc/mlibc.c (atoi): New function.
* module/mes/libc.mes (atoi): New function.
(libc): Add it.
Jan Nieuwenhuizen [Mon, 17 Apr 2017 00:24:20 +0000 (02:24 +0200)]
mescc: Add getenv.
* module/mes/libc-i386.mes (i386:_start): Push environment pointer.
* module/mes/libc.mes (g_environment): New global.
(_env): New function.
(_start): Use it to set g_environment.
(getenv): New function.
* lib/mlibc.c (strncmp): New function.
(getenv): Implement.
* lib/mstart.c (_start): Set g_environment.
* module/mes/libc.mes (strncmp): New function.
(libc): Add it.
* scaffold/t.c: (array_ref): Test it.
Jan Nieuwenhuizen [Mon, 17 Apr 2017 00:15:11 +0000 (02:15 +0200)]
mescc: Support pointer arrays and some arithmetic.
* module/language/c99/compiler.mes (.name): Support **; handle type size.
(.statements): Likewise.
(push-local-de-ref): Likewise.
(push-ident-de-ref): Likewise.
(expr->arg): Likewise.
(ident->accu): Likewise.
(base->ident-address): Likewise.
(ident-add): Likewise.
(expr->accu): Likewise.
(decl->type): Likewise.
(formal->text): Likewise.
(int->global, ident-address->accu, ident-address->base): New functions.
(ast->info): Support *, *[] ** declarations.
(push-local-de-de-ref, push-ident-de-de-ref): New functions.
* module/mes/as-i386.mes (i386:push-byte-local-de-ref): Rename from
i386:push-local-de-ref. Update callers.
(i386:push-local-de-ref, i386:push-byte-local-de-de-ref,
i386:accu-mem-add): New functions.
* module/mes/as-i386.scm (mes): Export them.
* scaffold/t.c (array_test): Test it.
Jan Nieuwenhuizen [Tue, 25 Apr 2017 21:18:29 +0000 (23:18 +0200)]
bootstrap: Regenerate.
* mes.mes: Regenerate.
* module/mes/read-0-32.mo: Regenerate.
Jan Nieuwenhuizen [Sun, 16 Apr 2017 07:51:45 +0000 (09:51 +0200)]
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.
Jan Nieuwenhuizen [Tue, 25 Apr 2017 21:44:23 +0000 (23:44 +0200)]
bootstrap: Regenerate
* module/mes/read-0-32.mo: Regenerate.
Jan Nieuwenhuizen [Wed, 12 Apr 2017 19:27:59 +0000 (21:27 +0200)]
build: Refactor.
* GNUmakefile (OUT,QUIET,SUBDIRS): New variables.
include make/common.make
* .gitignore: Remove toplevel targets.
* build-aux/compile-all.scm: Import from GNU Guix.
* configure (gulp-pipe): Check exit status. Actually test for CC,
CC32.
* make/bin.make: New file.
* make/check.make: New file.
* make/clean.make: New file.
* make/common.make: New file.
* make/compile.make: New file.
* make/guile.make: New file.
* make/mescc-guile.make: New file.
* make/mescc-mes.make: New file.
* make/reset.make: New file.
* lib/mlibc.c: Rename from top.
* lib/start.c: Rename from top.
* module/module.make: New file.
* scaffold/scaffold.make: New file.
* scripts/scripts.make: New file.
* src/mes.c: Rename from top.
* src/src.make: New file.
* src/mes.c: Rename from top.
* src/gc..c: Rename from top.
* src/lib.c: Rename from top.
* src/posix.c: Rename from top.
* src/reader.c: Rename from top.
* src/vector.c: Rename from top.
* tests/tests.make: New file.
Jan Nieuwenhuizen [Sat, 15 Apr 2017 14:50:03 +0000 (16:50 +0200)]
Remove gc scaffolding.
* tests/gc-0.test: Remove.
* tests/gc-1.test: Remove.
* tests/gc-2.test: Remove.
* tests/gc-2a.test: Remove.
* tests/gc-3.test: Remove.
* tests/gc-4.test: Remove.
* tests/gc-5.test: Remove.
* tests/gc-6.test: Remove.
* tests/gc.test:Remove.
Jan Nieuwenhuizen [Sat, 15 Apr 2017 13:13:38 +0000 (15:13 +0200)]
mescc: Add fsync.
* module/mes/libc-i386.mes (i386:fsync): New function.
(i386:libc): Export it.
* mlibc.c (fsync): New function.
Jan Nieuwenhuizen [Mon, 10 Apr 2017 17:13:20 +0000 (19:13 +0200)]
core/mini-mes: Merge merge mes.c and mini-mes.c.
* mes.c:
* scaffold/mini-mes.c:
* gc.c:
* GNUmakefile:
Jan Nieuwenhuizen [Mon, 10 Apr 2017 06:06:33 +0000 (08:06 +0200)]
mescc: Allow usage of const by ignoring.
* module/language/c99/compiler.mes (ast->info): Support const
declarations (by ignoring them).
* lib.c (display_helper)[!__GNUC__]: Remove branch.
* posix.c (write_byte)[!__GNUC__]: Likewise.
Jan Nieuwenhuizen [Mon, 10 Apr 2017 05:54:38 +0000 (07:54 +0200)]
HACKING: Removed __MESC__ workarounds.
* HACKING: Update pointer.
Jan Nieuwenhuizen [Mon, 10 Apr 2017 04:59:50 +0000 (06:59 +0200)]
mescc: Support break in while.
* module/language/c99/compiler.mes (make): Add break field.
(.break): New function.
(clone): Support break field.
(ast->info): Support break.
* scaffold/t.c (test): Test it.
* scaffold/mini-mes.c (lookup_symbol_): Use it; remove goto workaround.
Jan Nieuwenhuizen [Sun, 9 Apr 2017 04:52:39 +0000 (06:52 +0200)]
mescc: Refactor switch.
* module/language/c99/compiler.mes (case->jump-info): Refactor.
Support multiple case statements.
* scaffold/t.c (swits): Test it.
* lib.c (display_helper)[__NYACC__]: Remove branch.
Jan Nieuwenhuizen [Sat, 8 Apr 2017 13:01:24 +0000 (15:01 +0200)]
mini-mes: Merge with mes.c: lib.c, math.c, posix.c.
* mes.c: Include math.c after posix.c.
(assert_defined, check_formals, check_apply, load_env,
bload_env): Move from lib.c
* scaffold/mini-mes.c: Include mini-lib.h, lib.c., mini-math.h,
math.c, mini-posix.h, posix.c.
(greater_p, less_p, is_p, minus, plus, divide, modulo, multiply,
logior, ash): Remove.
(ungetchar, peekchar, peek_byte, read_byte, write_byte,
string_to_cstring, getenv_, open_input_file, current_input_port,
set_current_input_port, force_output): Remove.
(mes_builtins): include mini-lib.i, mini-lib.environment.i.
mini-math.i, mini-math.environment.i mini-posix.i,
mini-posix.environment.i.
* GNUmakefile (guile-mini-mes): Add dependencies.
Jan Nieuwenhuizen [Sat, 8 Apr 2017 04:31:12 +0000 (06:31 +0200)]
mescc: Refactor assignment.
* module/language/c99/compiler.mes (expr->accu): Refactor assignment.
Support multiple operators.
* scaffold/t.c (math_test): Test it.
* scaffold/mini-mes.c (minus, divide, modulo, multiply,
logior)[!__GNUC__]: Remove branch.
Jan Nieuwenhuizen [Fri, 7 Apr 2017 21:06:09 +0000 (23:06 +0200)]
mescc: Factor-out array-ref.
* module/language/c99/compiler.mes: Factor-out array-ref.
Jan Nieuwenhuizen [Fri, 7 Apr 2017 12:41:47 +0000 (14:41 +0200)]
mescc: Refactor expr->base.
* module/language/c99/compiler.mes (expr->base): Rename from
expr->+base. Use throughout.
Jan Nieuwenhuizen [Fri, 7 Apr 2017 12:31:35 +0000 (14:31 +0200)]
mescc: Refactor binary operators.
* module/language/c99/compiler.mes (binop->accu): Rename from
compare->accu. Update callers.
(expr->accu): Use it for binary operators.
* scaffold/t.c (math_test): Test it.
Jan Nieuwenhuizen [Fri, 7 Apr 2017 07:53:56 +0000 (09:53 +0200)]
mescc: Factor-out append-text.
* module/language/c99/compiler.mes: Use append-text throughout.
Jan Nieuwenhuizen [Fri, 7 Apr 2017 07:36:30 +0000 (09:36 +0200)]
mescc: Factor-out wrap-as.
* module/language/c99/compiler.mes (wrap-as): Rename from wrap. Use throughout.
Jan Nieuwenhuizen [Fri, 7 Apr 2017 05:06:35 +0000 (07:06 +0200)]
mescc: Refactor comparisons.
* module/language/c99/compiler.mes (compare->accu, append-text, wrap):
New functions.
(expr->accu): Use them to implement construct like 1 == inc (0).
* scaffold/t.c (math_test): Test them.
Jan Nieuwenhuizen [Thu, 6 Apr 2017 21:15:59 +0000 (23:15 +0200)]
HACKING: Removed gc.c, vector.c mescc workarounds.
* HACKING: Update pointer and recipe.
Jan Nieuwenhuizen [Thu, 6 Apr 2017 21:05:44 +0000 (23:05 +0200)]
mescc: Refactor array ref.
* module/language/c99/compiler.mes (expr->accu, expr->accu*): Remove
duplication, use expression as array index.
* scaffold/t.c (struct_test): Test it.
* vector.c (vector_length, list_to_vector)[!__GNUC__]: Remove branch.
Jan Nieuwenhuizen [Thu, 6 Apr 2017 07:12:50 +0000 (09:12 +0200)]
mescc: Refactor expressions.
* module/language/c99/compiler.mes (expr->accu, ast->info): Remove
duplication, separate concerns.
Jan Nieuwenhuizen [Wed, 5 Apr 2017 21:05:16 +0000 (23:05 +0200)]
mescc: Refactor pre/post inc/dec.
* module/language/c99/compiler.mes: Refactor pre/post inc/dec.
Jan Nieuwenhuizen [Wed, 5 Apr 2017 20:43:41 +0000 (22:43 +0200)]
bootstrap: Regenerate.
* mes-mini-mes: Regenerate.
* module/mes/read-0-32.mes: Regenerate.
Jan Nieuwenhuizen [Wed, 5 Apr 2017 18:11:13 +0000 (20:11 +0200)]
mescc: function call.
* module/language/c99/compiler.mes (expr->accu): Move function call
from ast->info.
Jan Nieuwenhuizen [Wed, 5 Apr 2017 12:24:34 +0000 (14:24 +0200)]
mescc: Support expression as lhs array index.
* module/language/c99/compiler.mes (expr->accu): Treat array index as expression.
* scaffold/t.c (struct_test): Test it.
* gc.c (gc_copy)[!__GNUC__]: Remove branch.
* vector.c (list_to_vector)[!__GNUC__]: Likewise.
Jan Nieuwenhuizen [Tue, 4 Apr 2017 12:37:17 +0000 (14:37 +0200)]
mescc: Remove duplication.
* module/language/c99/compiler.mes (expr->arg): Use expr->accu for
most expressions.
Jan Nieuwenhuizen [Tue, 4 Apr 2017 07:53:05 +0000 (09:53 +0200)]
scripts: Support --help, --version.
* guile/mescc.scm: Support --help, --version.
* scripts/mescc.mes: Likewise.
* scripts/repl.mes: Likewise.
Jan Nieuwenhuizen [Mon, 3 Apr 2017 05:19:38 +0000 (07:19 +0200)]
scm: Do not quote list of strings.
* module/mes/display.mes (display): Check value of write?, fixes
quoting display string.
Jan Nieuwenhuizen [Mon, 3 Apr 2017 05:09:03 +0000 (07:09 +0200)]
mescc: Do not return ELF text.
* module/language/c99/compiler.mes (info->exe): Do not return ELF text.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 16:50:07 +0000 (18:50 +0200)]
build: Update Guix build and install.
* guix.scm (%source-dir): New variable.
(git-file?): New function.
(mes): Use them to simplify building/installing from git.
* make/install.make (READMES): Add INSTALL, README.
* (install): Install mescc.scm and read-0-32.mo.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 10:41:33 +0000 (12:41 +0200)]
bootstrap: Regenerate.
* mes-mini-mes: First self-hosting binary.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 11:27:00 +0000 (13:27 +0200)]
HACKING: scripts/mescc.mes scaffold/mini-mes runs.
* HACKING: Update pointer and recipe.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 11:18:22 +0000 (13:18 +0200)]
mini-mes: Fix for assq.
* scaffold/mini-mes.c (assq): Use eq_p iso ==. Fixes
tests/display.test ("write alarm").
Jan Nieuwenhuizen [Sun, 2 Apr 2017 10:58:18 +0000 (12:58 +0200)]
core: Use 0.25% safety region.
* gc.c (gc_up_arena): Up GC_SAFETY too.
* scripts/repl.mes: Remove MES_ARENA override.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 11:21:01 +0000 (13:21 +0200)]
bootstrap: Regenerate.
* module/mes/read-0-32.mo: Regenerate.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 06:05:55 +0000 (08:05 +0200)]
core: Remove append.
* lib.c (append): Remove.
* scaffold/mini-mes.c (append): Remove.
* module/mes/base-0.mes (append): New function.
* module/mes/read-0.mo: Regenerate.
* module/mes/read-0-32.mo: Regenerate.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 06:04:25 +0000 (08:04 +0200)]
test: Add test for append-map.
* tests/srfi-1.test ("append-map"): New test.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 21:00:50 +0000 (23:00 +0200)]
core: Check gc free harder.
* gc.c (gc_check): New fuction.
* mes.c (eval_apply): Use it.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 21:12:37 +0000 (23:12 +0200)]
mescc: Fix by value assignment from array-of struct entry.
* module/language/c99/compiler.mes (expr->accu): Fix by value
assignment from array-of struct entry.
* scaffold/t.c (struct_test): Test it.
* vector.c (make_vector, list_to_vector, vector_to_list): Use it;
remove workarounds.
* gc.c (gc_copy): Likewise.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 18:25:03 +0000 (20:25 +0200)]
core: Fix flush for _POSIX_SOURCE.
* posix.c (write_byte, force_output)[_POSIX_SOURCE]: Use FILE*
functions. Fixes repl.mes.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 17:10:28 +0000 (19:10 +0200)]
core: Increase MAX_ARENA_SIZE and GC safety.
* mes.c (MAX_ARENA_SIZE): Double to
40000000.
(GC_SAFETY): Set to 10000 cells (WAS: 1000).
* scaffold/mini-mes.c (MAX_ARENA_SIZE, GC_SAFETY): Likewise.
* gc.c (gc)[MES_DEBUG]: Also print safety area.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 15:07:28 +0000 (17:07 +0200)]
HACKING: scripts/mescc.mes scaffold/t.c runs.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 14:51:48 +0000 (16:51 +0200)]
core: Increase GC safety.
* mes.c (GC_SAFETY): Set to 1000 cells (WAS: 100).
* scaffold/mini-mes.c (GC_SAFETY): Likewise.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 14:15:08 +0000 (16:15 +0200)]
HACKING: scripts/mescc.mes scaffold/tiny-mes.c runs.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 14:12:51 +0000 (16:12 +0200)]
HACKING: scripts/mescc.mes scaffold/cons-mes.c runs.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 13:06:07 +0000 (15:06 +0200)]
test: Add nyacc cpp match tests; two fail.
* tests/match.test ("match nyacc 0", "match nyacc 1"): New tests.
("match nyacc simple", "match nyacc tkl0"): New tests; FAIL with Mes.
(report): Set failure expectation to 2 for Mes.
* HACKING: Add to bugs.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 13:01:59 +0000 (15:01 +0200)]
scm: Support test failure expectation.
* module/mes/test.mes (result): Take second argument to mean expected
failure count.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 14:47:22 +0000 (16:47 +0200)]
scm: Evaluate arguments of OR only once.
* module/mes/base.mes (or): Evaluate arguments only once.
* module/mes/read-0.mes (or): Likewise.
* tests/base.test ("or only once"): Test it.
* module/mes/read-0-32.mo: Regenerate.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 07:36:34 +0000 (09:36 +0200)]
scm: Have char-set-contains? strictly return boolean.
* module/srfi/srfi-14.mes (char-set-contains?): Return #t rather than
memq result.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 05:23:10 +0000 (07:23 +0200)]
scm: Fix bug in assq-set!
* module/mes/scm.mes (assq-set!): Bugfix.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 07:35:47 +0000 (09:35 +0200)]
scm: Add c????r.
* module/mes/base-0.mes (caar, cadr, cdar, cddr, map): Remove. Update callers.
* module/mes/base.mes (): Remove.
* module/mes/base.mes (cadadr, cddadr, cdddar): New function.
Jan Nieuwenhuizen [Fri, 31 Mar 2017 19:41:32 +0000 (21:41 +0200)]
scm: Add access?
* module/mes/guile.mes (access?): New dummy function. Fixes Nyacc's #include.
Jan Nieuwenhuizen [Wed, 29 Mar 2017 06:05:18 +0000 (08:05 +0200)]
doc: Add Roamdmap.
* HACKING: Add roadmap.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 10:51:35 +0000 (12:51 +0200)]
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.
Jan Nieuwenhuizen [Sun, 2 Apr 2017 15:01:22 +0000 (17:01 +0200)]
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.
Jan Nieuwenhuizen [Mon, 27 Mar 2017 18:14:48 +0000 (20:14 +0200)]
core: Fix error message when macro is missing.
* mes.c (scm_vm_eval_check_func): New symbol.
(eval_apply): In eval, evaluate car before evlis. Fixes error
message when macro match is missing in (match ... (car x)).
(mes_symbols): Add cell_call_with_values, cell_current_module to environment.
* scaffold/mini-mes.c (eval_apply): Likewise.
Jan Nieuwenhuizen [Wed, 29 Mar 2017 06:07:51 +0000 (08:07 +0200)]
test: Add pmatch tests.
* tests/pmatch.test: New file.
* GNUmakefile (TESTS): Add it.
Jan Nieuwenhuizen [Tue, 28 Mar 2017 18:26:16 +0000 (20:26 +0200)]
nyacc: prefix globals.
Jan Nieuwenhuizen [Mon, 27 Mar 2017 19:41:44 +0000 (21:41 +0200)]
scm: Bugfix display of named characters: add port.
* module/mes/display.mes (display): Typo, add port.
Jan Nieuwenhuizen [Mon, 27 Mar 2017 19:01:22 +0000 (21:01 +0200)]
nyacc: Add missing (mes pmatch) include.
* module/nyacc/lang/c99/cpp.mes (mes): Include (mes pmatch).
Jan Nieuwenhuizen [Sat, 1 Apr 2017 10:16:09 +0000 (12:16 +0200)]
nyacc: Use pmatch rather than match for cpp.
* module/nyacc/lang/c99/cpp.scm (nyacc lang c99 cpp): Import (system
base pmatch) rather than (ice-9 match).
(rtokl->string): Rewrite using pmatch.
Jan Nieuwenhuizen [Mon, 27 Mar 2017 19:00:49 +0000 (21:00 +0200)]
scm: Bugfix drain-input.
* module/mes/guile.mes (drain-input): Bugfix: return string.
Jan Nieuwenhuizen [Mon, 27 Mar 2017 05:01:15 +0000 (07:01 +0200)]
scm: Add assoc-set!
* module/mes/scm.mes (assoc-set!): New function.
* tests/scm.test ("assoc-set!", "assoc-set! new"): New tests.
Jan Nieuwenhuizen [Sun, 26 Mar 2017 22:35:36 +0000 (00:35 +0200)]
scm: Add compose.
* module/mes/scm.mes (compose): New function.
* tests/scm.test ("compose"): New test.
Jan Nieuwenhuizen [Sun, 26 Mar 2017 22:11:05 +0000 (00:11 +0200)]
scm: Support reading negative hex numbers.
* module/mes/read-0.mes (read-hex): Support negative hex numbers.
* tests/math.test ("#x-10"): New test.
* tests/read.test: Add test.
Jan Nieuwenhuizen [Sun, 26 Mar 2017 21:48:15 +0000 (23:48 +0200)]
scm: Support map4.
* module/mes/base-0.mes (map): Remove. Update callers.
* module/mes/base.mes (map): Support map4.
Jan Nieuwenhuizen [Sun, 26 Mar 2017 21:09:44 +0000 (23:09 +0200)]
nyacc: Add simple split-cppdef for Mes.
* module/nyacc/lang/c99/body.scm: Add non-regexp split-cppdef for Mes.
Jan Nieuwenhuizen [Sun, 26 Mar 2017 21:09:11 +0000 (23:09 +0200)]
scm: Add with-throw-handler hack.
* module/mes/catch.mes (with-throw-handler): Add hack for Nyacc 0.75
Jan Nieuwenhuizen [Sun, 26 Mar 2017 20:33:51 +0000 (22:33 +0200)]
scm: Add list->char-set.
* module/srfi/srfi-14.mes (list->char-set): New function.
* tests/srfi-14.test ("list->char-set!"): Test it.
Jan Nieuwenhuizen [Sun, 26 Mar 2017 20:12:24 +0000 (22:12 +0200)]
mini-mes: Debugging to stderr.
* scaffold/mini-mes.c (error, bload_env, main): Send debug info to
stderr.
throw/catch dinges: URG
Jan Nieuwenhuizen [Sun, 26 Mar 2017 20:09:24 +0000 (22:09 +0200)]
scripts: Allow running with any mes.
* scripts/mescc.mes: Run $MES if set, default to ../scripts/mes.
* scripts/repl.mes: Likewise.
Jan Nieuwenhuizen [Sun, 26 Mar 2017 14:03:41 +0000 (16:03 +0200)]
mini-mes: Include and enable gc.
* scaffold/mini-mes.c: Set MES_GC=1.
(ARENA_SIZE)[MES_GC]: Reduce to 10,000 cells (WAS: 1,000,000,000
chars).
(g_news): New global.
(NTYPE, NCAR, NVALUE, NLENGTH, NCDR, NVECTOR): New macros.
(mes_symbols)[MES_GC]: Call gc_init_news.
(mes_builtins): Include gc.i, gc.environment.i.
Jan Nieuwenhuizen [Sat, 1 Apr 2017 21:30:45 +0000 (23:30 +0200)]
mini-mes: Workarounds for gc.c.
* gc.c (gc_copy)[!__GNUC__]: Avoid by value assignment from array-of
struct entry.
* scaffold/mini-mes.c (gc_init_cells): Workarounds.
Jan Nieuwenhuizen [Sun, 26 Mar 2017 13:55:12 +0000 (15:55 +0200)]
core: Prepare gc.c for mescc, non-POSIX_SOURCE.
* mes.c (NLENGTH, NVALUE, NVECTOR): New macros.
(mes_builtins): Add comment on .i include order.
* module/language/c99/compiler.mes (mescc): Add define _POSIX_SOURCE=0.
* gc.c (gc_up_arena, gc_flip, gc_loop, gc)[!_POSIX_SOURCE]: Use eputs
rather than fprintf.
(gc_loop): Use CAR, TYPE, NVECTOR rather than .car, .type, .vector.
* gc.c (gc_up_arena)[!_POSIX_SOURCE]: Add non-POSIX mlib.c
implementation.
Jan Nieuwenhuizen [Sun, 26 Mar 2017 13:49:45 +0000 (15:49 +0200)]
mescc: Bugfix for realloc.
* module/mes/libc.mes (realloc): Thinko.
Jan Nieuwenhuizen [Sat, 25 Mar 2017 18:03:03 +0000 (19:03 +0100)]
mescc: Bugfix for neg.
* module/language/c99/compiler.mes (expr->accu): Fix neg.
* scaffold/t.c (math_test): Test it.
* scaffold/mini-mes.c (ash): Remove workaround.
Jan Nieuwenhuizen [Sat, 25 Mar 2017 17:48:40 +0000 (18:48 +0100)]
mescc: Support rshift, have guile-mini-mes pass math test.
* module/mes/as-i386.mes (i386:accu>>base): New function.
* module/mes/as-i386.scm (mes): Export it.
* module/language/c99/compiler.mes (expr->accu): Support rshift.
* scaffold/t.c (math_test): Test it.
* scaffold/mini-mes.c (ash): Use it.
Jan Nieuwenhuizen [Sun, 26 Mar 2017 14:47:18 +0000 (16:47 +0200)]
test: Enable vector read test.
* tests/read.test: Enable vector read test.
Jan Nieuwenhuizen [Sat, 25 Mar 2017 13:05:17 +0000 (14:05 +0100)]
mini-mes: Support vectors.
* scaffold/mini-mes.c (REF, MAKE_REF): New macro.
Include vector.h, vector.c.
(mes_builtins): Include vector.i, vector.environment.i.
Jan Nieuwenhuizen [Sat, 25 Mar 2017 16:15:07 +0000 (17:15 +0100)]
mini-mes: Workarounds for vector.c.
* vector.c (make_vector, vector_set_x, list_to_vector)[!__GNUC__]: Avoid
by value assignment from array-of struct entry.
Jan Nieuwenhuizen [Sat, 25 Mar 2017 13:04:48 +0000 (14:04 +0100)]
core: prepare vector.c for mescc.
* vector.c (make_vector, vector_set_x, vector_to_list): Use REF, VALUE
rather than .ref, .value.
Jan Nieuwenhuizen [Sat, 25 Mar 2017 14:58:44 +0000 (15:58 +0100)]
mini-mes: Fully remove reader from core.
* scaffold/mini-mes.c (lookup_): Remove.
* mes.c: Likewise.
* reader.c (lookup_): Enable.
* mlib.c (putc): New function.
* module/mes/libc.mes (putc): New function.