Commit graph

91 commits

Author SHA1 Message Date
Jan Nieuwenhuizen 33ac19d7df Support PEG from Guile.
* module/mes/peg.mes: New file.
* module/mes/peg/cache.scm: New file.
* module/mes/peg/codegen.scm: New file.
* module/mes/peg/simplify-tree.scm: New file.
* module/mes/peg/string-peg.scm: New file.
* module/mes/peg/using-parsers.scm: New file.
* tests/peg.test: New file.
* GNUmakefile (TESTS): Add it.
2016-12-22 20:16:44 +01:00
Jan Nieuwenhuizen a0b18a402b Support pmatch from Guile.
* module/mes/pmatch.scm: New file.
* module/mes/pmatch.mes: New file.
* AUTHORS: Mention it.
2016-12-22 19:49:58 +01:00
Jan Nieuwenhuizen 8a78f45e25 Use include-from-path for psyntax.pp.
* module/mes/psyntax.pp: Rename from module/mes/psyntax-pp.mes.
* module/mes/psyntax.mes: Update.
* AUTHORS: Update.
2016-12-22 19:49:41 +01:00
Jan Nieuwenhuizen 0bac0cb948 Use include-from-path for upstream.
* module/mes/lalr.scm: Rename from module/mes/lalr.upstream.mes.
* module/mes/lalr.mes: Update.
* module/mes/match.scm: Rename from module/mes/match.upstream.mes.
* module/mes/match.mes: Update.
* module/mes/optargs.scm: Rename from module/mes/optargs.upstream.mes.
* module/mes/optargs.mes: Update.
* module/mes/quasisyntax.scm: Rename from module/mes/quasisyntax.upstream.mes.
* module/mes/quasisyntax.mes: Update.
* module/srfi/srfi-1.scm: Rename from module/srfi/srfi-1.upstream.mes.
* module/srfi/srfi-1.mes: Update.
* module/srfi/srfi-9.scm: Rename from module/srfi/srfi-9.upstream.mes.
* module/srfi/srfi-9.mes: Update.
* AUTHORS: Update.
2016-12-22 19:34:41 +01:00
Jan Nieuwenhuizen 51cd4885fc Add string-copy, string=, string=?, char<?, char>?, char<=?, char>=?.
* module/srfi/srfi-13.mes: New file.
* module/mes/scm.mes (char<?, char>?, char<=?, char>=?): New function.
* module/srfi/srfi-13.mes: New file.
* tests/srfi-13.test: New file.
* string.c (string_to_symbol): Handle "".
2016-12-11 21:26:27 +01:00
Jan Nieuwenhuizen ea7c0aac86 Refactor quasiquote.
* module/mes/quasiquote.mes (quasiquote): Refactor.
* tests/quasiquote.test: Add tests.
2016-12-22 12:11:55 +01:00
Jan Nieuwenhuizen 326095c9c9 Add psyntax-based quasisyntax.
* module/mes/quasisyntax.upstream.mes: Import from Guile.
* AUTHORS: Mention it.
* module/mes/quasisyntax.mes: New file.
* module/mes/psyntax.mes: Include it.
2016-12-21 16:48:33 +01:00
Jan Nieuwenhuizen 7bf25a7e17 core: Remove define.
* base-0.mes (cons*): Refactor.
* module/mes/read-0.mes: Implement define, define-macro using macros.
* define.c: Remove.
* mes.c: Remove callers.
* GNUmakefile (mes.o): Remove dependency on define.
2016-12-21 22:22:34 +01:00
Jan Nieuwenhuizen 1072c7fba9 nyacc: Support enhanced Guile-1.8.
* module/nyacc/lalr.scm: Export process-spec, reserved?.  Use optargs, syncase.
* module/nyacc/lex.scm: Use optargs, syncase.
* module/nyacc/parse.scm: Use optargs.
* module/nyacc/util.scm: Use optargs.
* module/nyacc/lang/util.scm: Use optargs.
* module/nyacc/lang/c99/cpp.scm: Use syncase.
* module/nyacc/lang/c99/parser.scm: Use optargs, syncase.
2016-12-18 22:16:14 +01:00
Jan Nieuwenhuizen f8e4d6e42b nyacc: Add mes modules.
* module/nyacc/lang/c99/cpp.mes
* module/nyacc/lang/c99/parser.mes
* module/nyacc/lang/calc/parser.mes
* module/nyacc/lang/util.mes
* module/nyacc/lex.mes
* module/nyacc/parse.mes
* module/nyacc/util.mes
2016-12-18 15:47:55 +01:00
Jan Nieuwenhuizen 0a9bfa7e3d nyacc: Use standard \return rather than \cr. 2016-12-18 15:39:36 +01:00
Jan Nieuwenhuizen a53e09d3e8 Import Nyacc 0.72.0.
* module/nyacc: Import module/nyacc.
2016-12-17 22:34:43 +01:00
Jan Nieuwenhuizen f8bc344dfc Import psyntax from Guile-1.8: R7RS with-ellipsis.
* GNUmakefile (psyntax-import): New target.
* module/mes/psyntax.ss: Import.
* module/mes/psyntax-pp.mes: Import.
* NEWS: Mention it.
2016-12-19 19:41:43 +01:00
Jan Nieuwenhuizen 40a6f2df34 Prepare for psyntax-6.3..7.3 support.
* module/mes/psyntax-0.mes (ormap): New function.
  (eval): New function.
  (remprop): New function.
  ($sc-put-cte, $make-environment, environment?, syntax->list,
  syntax->vector, literal-identifier=?, $syntax-dispatch, eval-when):
  New variable.
2016-12-11 21:39:54 +01:00
Jan Nieuwenhuizen 8b172e3438 Add abs.
* module/mes/scm.mes (abs): New function.
2016-12-20 21:22:21 +01:00
Jan Nieuwenhuizen 7d5c3a0201 Support (sxml xpath) for Nyacc c99.
* module/sxml/xpath.mes: New file.
* module/sxml/xpath.upstream.mes: Import from Guile.
* AUTHORS: Mention it.
2016-12-20 20:12:47 +01:00
Jan Nieuwenhuizen 096a2ed52e Partial (rnrs arithmetic bitwise) support for Nyacc c99.
* module/rnrs/arithmetic/bitwise.mes: New file.
2016-12-20 20:11:35 +01:00
Jan Nieuwenhuizen d08a28cfc1 Add string->number.
* module/mes/scm.mes (string->number): New function.
2016-12-20 19:01:00 +01:00
Jan Nieuwenhuizen 489d7c7f51 Add unless.
* module/mes/scm.mes (unless): New syntax.
2016-12-20 15:48:10 +01:00
Jan Nieuwenhuizen 8e1b25368b Add iota.
* module/mes/scm.mes: (iota): New function.
* tests/scm.test (iota, iota 0, iota -1): New tests.
2016-12-20 19:25:26 +01:00
Jan Nieuwenhuizen 641653563d Partial srfi-43 support for Nyacc.
* module/srfi/srfi-43.mes: New file.
2016-12-20 11:31:46 +01:00
Jan Nieuwenhuizen f8bb463da6 Partial srfi-14 support for Nyacc.
* module/srfi/srfi-14.mes: New file.
* tests/srfi-14.test: New file.
* GNUmakefile (TESTS): Add it.
2016-12-20 12:26:20 +01:00
Jan Nieuwenhuizen c07f3e18ca Add delete, delq, vector-copy.
* module/mes/scm.mes (filter, delete, delq, vector-copy): New functions.
2016-12-20 11:19:40 +01:00
Jan Nieuwenhuizen d7d46b9546 Add negative?, positive?, zero?, 1+ 1-.
* module/mes/scm.mes (negative?, positive?, zero?, 1+, 1-): New functions.
2016-12-20 10:57:09 +01:00
Jan Nieuwenhuizen 376435e974 Add missing srfi-1 functions for Nyacc.
* module/srfi/srfi-1.scm (fold, fold-right, remove, append-reverse,
  remove!): New functions.
* tests/srfi-1.test: New file.
* GNUmakefile (TESTS): Add it.
* module/srfi/srfi-1.upstream.mes: Import bits from Guile-1.8.
* AUTHORS: Mention it.
2016-12-20 10:44:43 +01:00
Jan Nieuwenhuizen 898e6a1b6b Add even?, odd?.
* module/mes/scm.mes (even?, odd?): New function.
2016-12-20 10:41:39 +01:00
Jan Nieuwenhuizen eb92e77719 Bugfix: for-each with two lists.
* module/mes/scm.mes (for-each): Fix for two lists.  Always return *unspecified*.
2016-12-20 12:23:10 +01:00
Jan Nieuwenhuizen 4df7673a33 Add and=>.
* module/mes/base.scm (and=>): New function.
2016-12-20 09:03:05 +01:00
Jan Nieuwenhuizen 0bf21998a0 Add eqv?.
* module/mes/base.scm (eqv?): New function.
2016-12-20 07:51:50 +01:00
Jan Nieuwenhuizen 2390d46a63 Closure is not a pair.
* module/mes/base.mes (closure_p, mes_car, mes_cdr): New function.
  (pair_p): Closure is not a pair.
* NEWS: Mention it.
* psyntax-0.mes (self-evaluating?): Add closure?.
2016-12-19 19:35:38 +01:00
Jan Nieuwenhuizen c93096fe5f Bugfix: support map^3.
* module/mes/base-0.scm (map): Support third list, add more visible
  error when used with 4 or more list.
2016-12-19 19:32:17 +01:00
Jan Nieuwenhuizen e8b78a1077 Add psyntax-based srfi-9.
* module/srfi/srfi-9-psyntax.mes: New file.
2016-12-18 16:05:35 +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
Jan Nieuwenhuizen 276ffdd7ba Support include and include-from-path.
* module/mes/base-0.mes (include, include-from-path): New function.
2016-12-18 15:43:06 +01:00
Jan Nieuwenhuizen 89f771f18a Support #\alarm, #\vtab.
* mes.c (char_alarm): New variable.
  (char_vtab): Rename from char_vt.
* reader.c (read_character): Add alarm, update vtab.
* display.c (display): Likewise.
* module/language/c/lexer.mes (read-string): Use vtab.
2016-12-18 15:21:05 +01:00
Jan Nieuwenhuizen 95d913097d Support non-nested #| |# comment.
* module/mes/read-0.mes (read-word, read-block-comment): Implement #|.
* reader.c (read_word, read_block_comment)[READER]: Likewise.
* tests/read.test: Test it.
* NEWS: Mention it.
2016-12-18 10:11:22 +01:00
Jan Nieuwenhuizen 9dcff14bba Support #; comment.
* module/mes/read-0.mes (read-word): Implement #;.
* reader.c (read_word)[READER]: Likewise.
* tests/read.test: Test it.
* NEWS: Mention it.
2016-12-18 10:02:49 +01:00
Jan Nieuwenhuizen a8b16ba013 Minimal syntactic exception support.
* module/mes/catch.mes: New file.
* tests/catch.test: New file.
* GNUmakefile (TEST): Add it.
2016-12-17 22:21:46 +01:00
Jan Nieuwenhuizen 4744b315c9 Minimal syntactic fluids support.
* module/mes/fluids.mes: New file.
* tests/fluids.test: New file.
* GNUmakefile (TESTS): Add it.
2016-12-17 14:51:45 +01:00
Jan Nieuwenhuizen 58537e7c66 Add string-prefix?, symbol-prefix, symbol-append.
* module/mes/scm.mes (string-prefix?, symbol-prefix, symbol-append):
  New function,
2016-12-17 15:42:44 +01:00
Jan Nieuwenhuizen dab37a844b Add list-head, list-tail.
* module/mes/scm (list-head, list-tail): New function.
2016-12-17 14:44:34 +01:00
Jan Nieuwenhuizen f3c464d07b Make guile switchable in GNUmakefile.
* GNUmakefile (GUILE): New variable.  Update users.
* guile/mes-0.scm (mes?, guile-1.8?, guile-2?): New variables.
* module/mes/base.mes (guile?): Remove.
* module/mes/base-0.mes (effective-version, mes?, guile?, guile-1.8?,
  guile-2?): New variables.
* tests/cwv.test: Support Guile 1.8.
2016-12-21 17:08:36 +01:00
Jan Nieuwenhuizen d4dc29c498 Resurrect guile-mescc with guile-2.1.5.
* scripts/include.mes: Grep all files.
* GNUmakefile (mescc.cat): Update for mes-use-module; list all toplevel inputs.
* module/language/c/lexer.mes: Use (system base lalr).
* module/language/c/parser.mes: Likewise.
* module/language/c/compiler.mes: Likewise.  Remove encoding on output port.
* scripts/mescc.mes: Remove BROKEN comment.
2016-12-17 10:57:38 +01:00
Jan Nieuwenhuizen 8531e9d898 Support Guile optargs.
* module/mes/optargs.upstream.mes: Import latest non-syntax-case
  version from Guile.
* AUTHORS: Add it.
* module/mes/optargs.scm: New file.
* tests/optargs.test: New file.
* GNUmakefile (TESTS): Add it.
* NEWS: Update.
2016-12-16 23:34:08 +01:00
Jan Nieuwenhuizen bbeb4708e5 Support => in cond.
* module/mes/base-0.mes (cond): Support =>.
* module/mes/rea-0.mes (cond): Update.
* NEWS: Update.
2016-12-16 20:18:38 +01:00
Jan Nieuwenhuizen 885f48757a Handle form-feed.
* module/mes/read-0.mes (eat-whitespace, read-word): Handle form-feed.
* reader.c (eat_whitespace, read_word): Likewise.
2016-12-16 18:30:54 +01:00
Jan Nieuwenhuizen dd1daf92e4 Extend Scheme reader, reduce C reader dependency.
* mes.c (bload_env): Mark as internal.
  (load_env): Likewise.  Load Scheme reader from source.  Remove dumping.
  (dump): New function.
* (vm_begin_env): Allow for gc while read_input_file_env.
  (mes_builtins): Add *dot*.
  (read_input_file_env)[!READER]: Invoke read-input-file.
* module/mes/read-0.mes (read-env): New function.
  (read-word): Support quasisyntax.
  Remove usage of ' thoughout.
* module/mes/repl.mes (repl): Use read instead of read-env. 
* guile/mes.scm (environment): Add *dot*.
* guile/reader.mes: Update.
* NEWS: Update.
2016-12-13 19:58:34 +01:00
Jan Nieuwenhuizen 90e5f16ef9 Release 0.3.
* configure (VERSION): Bump to 0.3.
* mes.c (main): Likewise.
* module/mes/repl.mes: Likewise.
2016-12-12 21:00:02 +01:00
Jan Nieuwenhuizen 661954a352 Update Mes in Guile.
* guile/mes.scm: Update for guile-2.2.
* guile/mes.mes: Update from module/mes/mes-0.mes.
* guile/reader.mes: Update from module/mes/read-0.mes.
2016-12-12 20:35:19 +01:00
Jan Nieuwenhuizen 3a72f1f186 core: Resurrect QUASIQUOTE=0.
* mes.c (mes_builtins) [!QUASIQUOTE]: Do not add unquoters.
* module/mes/base-0.mes (push!, pop!, load, mes-use-module): Rewrite
  without quasiquote.
* module/mes/quasiquote.mes (quasiquote): Rewrite using if, and.
* module/srfi/srfi-0 (cond-expand): Rewrite without quasiquote.
2016-12-12 20:35:19 +01:00