1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

86 commits

Author SHA1 Message Date
Rob Browning
d79a226359 Fix crash on #nil in syntaxes
In 3.0.7 (after 0cc7991855 "Ensure
that (syntax ()) results in ("), the use of #nil in syntax-rules
expansions like this:

  (define-syntax foo
    (syntax-rules ()
      ((_ x) (eq? #nil x))))

  (foo #t)

could cause a crash that looks like this:

  ice-9/psyntax.scm:2795:12: In procedure syntax-violation:
  Syntax error:
  unknown location: unexpected syntax in form ()

To fix it, add another special case (the commit mentioned above
special-cased the empty list) to preserve #nil

* module/ice-9/psyntax.scm (gen-syntax): Preserve #nil.
* test-suite/tests/syntax.test: Test #nil in syntax expansions.

Closes: 49305
2021-07-11 15:00:33 -05:00
Andy Wingo
3bce507407 Fix syntax test
* test-suite/tests/syntax.test ("expressions"): The source location
alist is unordered.
2021-04-29 22:04:10 +02:00
Ludovic Courtès
8847aaec41 bug#48096: [3.0.6] ‘syntax-error’ exceptions include vectors instead of source location properties
Hi!

In 3.0.6, a slight incompatibility crept in: ‘syntax-error’ exceptions
include vectors like #("example.scm" 1 2) instead of good’ol source
property alists.

Here is a test case that reproduces the problem:
2021-04-29 21:50:12 +02:00
Andy Wingo
2053592214 Allow mixed local definitions and expressions
This change to the expander allows mixed local definitions and
expressions.  The expansion turns:

  (let () (a) (define (b) 42) (b) (b))

into:

  (let ()
    (letrec* ((t0 (begin (a) (if #f #f)))
              (b (lambda () 42)))
      (b)))

Which is to say, expressions that precede definitions are expanded as
definitions of a temporary via (begin EXP (if #f #f)).

* module/ice-9/psyntax.scm (expand-body): Allow mixed definitions and
  expressions.
* module/ice-9/psyntax-pp.scm: Regenerate.
* test-suite/tests/syntax.test: Add a couple tests and update for new
  error messages.
2019-08-25 16:44:07 +02:00
Andy Wingo
2e5f7d8f6d Syntax objects are comparable with equal?
* libguile/eq.c (scm_equal_p, scm_raw_ihash): Add cases for syntax
  objects, which should be comparable with equal?.
* test-suite/tests/syntax.test ("syntax objects"): Add tests.
2017-04-21 11:56:51 +02:00
Andy Wingo
dc33a94502 Fix syntax.test
* test-suite/tests/syntax.test (exception:variable-ref): Change expected
  error.
2014-12-10 16:25:50 +01:00
Andy Wingo
7974c57937 Assignment conversion in the interpreter
* libguile/expand.c (compute_assigned, convert_assignment)
  (scm_convert_assignment): New functions.

* libguile/expand.h: Declare scm_convert_assignment.

* libguile/memoize.c (scm_memoize_expression): Do assignment conversion
  before memoization.

* test-suite/tests/syntax.test ("letrec"): Detection of unbound letrec
  variables now works.
2014-12-05 11:45:36 +01:00
Andy Wingo
b00c9b2214 Merge commit '866af5da3d'
Removes the special arity handler, and instead relies on the procedure
returning the correct number of values.
2014-02-07 15:24:43 +01:00
Mark H Weaver
48eb902119 Implement R7RS 'define-values'.
* module/ice-9/boot-9.scm (%define-values-arity-error): New procedure.
  (define-values): New macro.

* doc/ref/api-binding.texi (Binding Multiple Values): Add docs.

* test-suite/tests/syntax.test: Add tests.
2014-02-02 03:28:23 -05:00
Mark H Weaver
ba578eb044 Merge branch 'stable-2.0'
Conflicts:
	libguile/read.c
	test-suite/tests/web-response.test
2014-01-21 03:57:04 -05:00
Mark H Weaver
2d6a3144a1 Document that we support srfi-46 and add it to %cond-expand-features.
* module/ice-9/boot-9.scm (%cond-expand-features): Add srfi-46.

* doc/ref/srfi-modules.texi (SRFI-0): Add srfi-46 to the list of core
  features.
  (SRFI-46): New node.

* doc/ref/api-macros.texi (Syntax Rules): Mention that the custom
  ellipsis identifier support is specified by SRFI-46.

* test-suite/tests/syntax.test ("syntax-rules"): Add ellipsis hygiene
  test from SRFI-46.
2014-01-15 03:21:07 -05:00
Mark H Weaver
b958141cdb Merge branch 'stable-2.0'
Conflicts:
	libguile/hash.c
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	test-suite/tests/r6rs-ports.test
2014-01-14 01:30:56 -05:00
Mark H Weaver
0e18163366 Implement R7RS 'syntax-error'.
* module/ice-9/psyntax.scm (syntax-error): New macro.
  (syntax-rules): Handle 'syntax-error' templates specially
  for improved error reporting.

* module/ice-9/psyntax-pp.scm: Regenerate.

* doc/ref/api-macros.texi (Syntax Rules): Add new subsection "Reporting
  Syntax Errors in Macros".

* test-suite/tests/syntax.test: Add tests.
2014-01-09 17:43:53 -05:00
Mark H Weaver
1624e149f7 psyntax: custom ellipses using 'with-ellipsis' or R7RS syntax-rules.
* module/ice-9/psyntax.scm (binding-type): Update the header comment
  to mention the new 'ellipsis' binding type.
  (macros-only-env): Preserve ellipsis bindings.
  (ellipsis?): Add 'r' and 'mod' as arguments.  Search the lexical
  environment for an ellipsis binding, and use it.
  (gen-syntax): Adapt to the additional arguments of 'ellipsis?'.
  (with-ellipsis): New core syntax.
  (convert-pattern): Add unary 'ellipsis?' procedure as an argument.
  (gen-clause): Adapt to the additional arguments of 'ellipsis?'.
  Pass unary 'ellipsis?' procedure to 'convert-pattern'.
  (syntax-case): Adapt to the additional arguments of 'ellipsis?'.
  (syntax-local-binding): Support new 'ellipsis' binding type.
  (syntax-rules): Add support for a custom ellipsis identifier as
  the first operand, as per R7RS.  Collect common code within new
  local procedure 'expand-syntax-rules'.

* module/ice-9/psyntax-pp.scm: Regenerate.

* module/ice-9/local-eval.scm (analyze-identifiers): Add support for
  'ellipsis' binding type.

* doc/ref/api-macros.texi (Syntax Rules): Add docs for R7RS custom
  ellipsis syntax.  Use @dots{}.
  (Syntax Case): Add docs for 'with-ellipsis'.  Use @dots{}.
  (Syntax Transformer Helpers): Update to include new 'ellipsis'
  binding type.

* test-suite/tests/syntax.test: Add tests.
2014-01-09 17:41:19 -05:00
Mark H Weaver
1df515a077 Merge branch 'stable-2.0'
Conflicts:
	module/system/vm/traps.scm
	test-suite/tests/peval.test
2014-01-09 02:52:34 -05:00
Mark H Weaver
0b83be7eb6 Revert "Fix bound-identifier=? to compare binding names, not just symbolic names."
This reverts commit 70c74b8476.
2013-12-16 22:55:25 -05:00
Mark H Weaver
70c74b8476 Fix bound-identifier=? to compare binding names, not just symbolic names.
Fixes <http://bugs.gnu.org/16158>.

* module/ice-9/psyntax.scm (bound-id=?): Use 'id-var-name' to compare
  binding names (gensyms), not just symbolic names.

* module/ice-9/psyntax-pp.scm: Regenerate.

* test-suite/tests/syntax.test: Add test.
2013-12-15 19:04:59 -05:00
Mark H Weaver
aa8630efb3 syntax-case: fix error reporting for misplaced ellipses.
Reported by taylanbayirli@gmail.com (Taylan Ulrich B.).

* module/ice-9/psyntax.scm (cvt*): Use 'syntax-case' to destructure
  the pattern tail, instead of 'pair?', 'car', and 'cdr'.
  (gen-clause): When checking for errors, check for misplaced ellipsis
  before duplicate pattern variables, to improve the error message in
  case of multiple misplaced ellipses.

* module/ice-9/psyntax-pp.scm: Regenerate.

* test-suite/tests/syntax.test: Add tests.
2013-12-13 13:25:07 -05:00
Andy Wingo
a41bed83ab Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/read.c
	test-suite/tests/tree-il.test
2012-02-11 18:14:48 +01:00
Mark H Weaver
e7cf0457d7 Support => within case, and improve error messages for cond and case
* module/ice-9/boot-9.scm (cond, case): Reimplement using syntax-case,
  with improved error messages and support for '=>' within 'case' as
  mandated by the R7RS.  Add warnings for duplicate case datums and
  case datums that cannot be meaningfully compared using 'eqv?'.

* module/system/base/message.scm (%warning-types): Add 'bad-case-datum'
  and 'duplicate-case-datum' warning types.

* test-suite/tests/syntax.test (cond, case): Update tests to reflect
  improved error reporting.  Add tests for '=>' within 'case'.

* test-suite/tests/tree-il.test (partial evaluation): Update tests to
  reflect changes in how 'case' is expanded.

* doc/ref/api-control.texi (Conditionals): Document '=>' within 'case'.
2012-02-08 16:27:48 -05:00
Andy Wingo
91ee7515da Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/__scm.h
	libguile/array-map.c
	libguile/procprop.c
	libguile/tags.h
	module/ice-9/deprecated.scm
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	test-suite/standalone/test-num2integral.c
	test-suite/tests/regexp.test
2012-01-10 00:41:42 +01:00
Andy Wingo
0bdd43515e Merge commit 'f78a1ccede' 2012-01-10 00:23:49 +01:00
Andy Wingo
bbc2364a3e Merge commit 'cc8afa2b36'
Conflicts:
	module/ice-9/psyntax-pp.scm
	module/language/tree-il/peval.scm
2012-01-10 00:21:48 +01:00
Ludovic Courtès
9133716faa Fix the exception type of the (begin) test.
* test-suite/tests/syntax.test (exception:zero-expression-sequence): New
  variable.
  ("begin")["legal (begin)"]: Rename to "valid (begin)".
  ["illegal (begin)"]: Ditto.  Expect `exception:zero-expression-sequence'.
2012-01-05 23:49:01 +01:00
Ludovic Courtès
f78a1ccede Raise an error for (begin) when `--disable-deprecated'.
* module/ice-9/psyntax.scm (define-expansion-constructors)[begin-form]:
  Emit a syntax-violation error for empty sequences when
  --disable-deprecated.

* test-suite/tests/syntax.test (pass-if-syntax-error): Fix typo in error
  message.
2012-01-05 22:38:06 +01:00
Andy Wingo
dc65d1cf5b document invalidity of (begin) as expression; add back-compat shim
* doc/ref/api-control.texi (begin): Update to distinguish between
  splicing begin and sequencing begin.

* module/ice-9/psyntax.scm (expand-expr): Add a back-compatibility shim
  for `(begin)'.
* module/ice-9/psyntax-pp.scm: Regenerate.

* test-suite/tests/syntax.test: Update to run illegal (begin) test only
  if we are not including deprecated features.
2011-12-21 20:14:59 -05:00
Andy Wingo
adf91e1cc5 add tests for hygienic name introduction
* test-suite/tests/syntax.test ("top-level define"): Add tests for
  hygienic introduction of names.
2011-11-07 11:48:04 +01:00
Andy Wingo
ab2d0f8f0c another scoping test
* test-suite/tests/syntax.test ("top-level define"): Add another test
  for scoping.
2011-11-07 11:45:15 +01:00
Andy Wingo
1ce645567d add scoping test
* test-suite/tests/syntax.test ("top-level define"): Add a test for
  module scoping of introduced identifiers.
2011-11-07 11:42:29 +01:00
Andy Wingo
91956a94fe allow while as an expression
* module/ice-9/boot-9.scm (while): Specify the return value as #f under
  normal conditions, #t under (break), and arg... under (break arg...).
* test-suite/tests/syntax.test ("while"): Test.
* doc/ref/api-control.texi (while do): Document.
2011-04-28 15:48:35 +02:00
Andy Wingo
36ad25332e fix quasiquote test
* test-suite/tests/syntax.test ("quasiquote"): Fix unquote-splicing
  extra args test to update for current behavior.
2011-02-08 22:43:43 +01:00
Andy Wingo
e75184d5d2 adapt tests to new syntax-error form
* test-suite/tests/syntax.test (pass-if-syntax-error): Fix up for new
  form of syntax errors. Adapt all tests.

* test-suite/tests/srfi-17.test: Likewise.
2010-11-18 11:04:15 +01:00
Andy Wingo
31fe120216 fix matches? test
* test-suite/tests/syntax.test (matches?): Unfortunately this relatively
  recent macro fails due to the underscore-in-literals-list prohibition.
  But, it seems I was in the minority wanting _ for a literal.
2010-06-21 21:06:29 +02:00
Andy Wingo
5f8c55ce3b fix order of internal definitions
* module/ice-9/psyntax.scm (chi-body): Whoops, actually render internal
  definitions into a letrec* in the right order.
* module/ice-9/psyntax-pp.scm: Regenerate.

* test-suite/tests/syntax.test: Add some letrec* tests.
2010-06-17 14:39:32 +02:00
Andy Wingo
10e69149f6 while in terms of syntax-case
* module/ice-9/boot-9.scm (while): Reimplement in terms of syntax-case.
  Prompt inlining is coming later.

* test-suite/tests/syntax.test ("while"): Update the expected syntax
  errors.
2010-06-11 16:58:36 +02:00
Andy Wingo
5f1611640a really boot primitive-eval from scheme.
* libguile/eval.c (scm_primitive_eval, scm_c_primitive_eval):
  (scm_init_eval): Rework so that scm_primitive_eval always calls out to
  the primitive-eval variable. The previous definition is the default
  value, which is probably overridden by scm_init_eval_in_scheme.

* libguile/init.c (scm_i_init_guile): Move ports and load-path up, so we
  can debug when initing eval. Call scm_init_eval_in_scheme. Awesome.

* libguile/load.h:
* libguile/load.c (scm_init_eval_in_scheme): New procedure, loads up
  ice-9/eval.scm to replace the primitive-eval definition, if everything
  is there and up-to-date.

* libguile/modules.c (scm_module_transformer): Export to Scheme, so it's
  there for eval.go.

* module/ice-9/boot-9.scm: No need to define module-transformer.

* module/ice-9/eval.scm (capture-env): Only reference the-root-module if
  modules are booted.
  (primitive-eval): Inline a definition for identity. Throw a more
  standard error for "wrong number of arguments".

* module/ice-9/psyntax.scm (chi-install-global): The macro binding for a
  syncase macro is now a pair: the transformer, and the module that was
  current when the transformer was installed. The latter is used for
  hygiene purposes, replacing the use of procedure-module, which didn't
  work with the interpreter's shared-code closures.
  (chi-macro): Adapt for the binding being a pair, and get the hygiene
  from the cdr.
  (eval-local-transformer): Adapt to new form of macro bindings.

* module/ice-9/psyntax-pp.scm: Regenerated.

* .gitignore: Ignore eval.go.stamp.

* module/Makefile.am: Reorder for fastest serial compilation, now that
  there are no ordering constraints. I did a number of experiments here
  and this seems to be the best; but the bulk of the time is compiling
  psyntax-pp.scm with eval.scm. Not so great.

* libguile/vm-engine.c (vm-engine): Throw a more standard error for
  "wrong type to apply".

* test-suite/tests/gc.test ("gc"): Remove a hack that shouldn't affect
  the new evaluator, and throw in another (gc) for good measure.

* test-suite/tests/goops.test ("defining classes"):
* test-suite/tests/hooks.test (proc1): We can't currently check what the
  arity is of a closure made by eval.scm -- or more accurately all
  closures have 0 required args and no rest args. So punt for now.

* test-suite/tests/syntax.test ("letrec"): The scheme evaluator can't
  check that a variable is unbound, currently; perhaps the full "fixing
  letrec" expansion could fix this. But barring that, punt.
2009-12-03 00:00:38 +01:00
Andy Wingo
b7742c6b71 new evaluator, y'all
* libguile/eval.c: So, ladies & gents, a new evaluator. It's similar to
  the old one, in that we memoize and then evaluate, but in this
  incarnation, memoization of an expression happens before evaluation,
  not lazily as the expression is evaluated. This makes the evaluation
  itself much cleaner, in addition to being threadsafe. In addition,
  since this C evaluator will in the future just serve to bootstrap the
  Scheme evaluator, we don't have to pay much concern for debugging
  conveniences. So the environment is just a list of values, and the
  memoizer pre-computes where it's going to find each individual value
  in the environment.

  Interface changes are commented below, with eval.h.

  (scm_evaluator_traps): No need to reset the debug mode after rnning te
  traps thing. But really, the whole traps system needs some love.

* libguile/memoize.h:
* libguile/memoize.c: New memoizer, which runs before evaluation,
  checking all syntax before evaluation begins. Significantly, no
  debugging information is left for lexical variables, which is not so
  great for interactive debugging; perhaps we should change this to have
  a var list in the future as per the classic interpreters. But it's
  quite fast, and the resulting code is quite good. Also note that it
  doesn't produce ilocs, memoized code is a smob whose type is in the
  first word of the smob itself.

* libguile/eval.h (scm_sym_and, scm_sym_begin, scm_sym_case)
  (scm_sym_cond, scm_sym_define, scm_sym_do, scm_sym_if, scm_sym_lambda)
  (scm_sym_let, scm_sym_letstar, scm_sym_letrec, scm_sym_quote)
  (scm_sym_quasiquote, scm_sym_unquote, scm_sym_uq_splicing, scm_sym_at)
  (scm_sym_atat, scm_sym_atapply, scm_sym_atcall_cc)
  (scm_sym_at_call_with_values, scm_sym_delay, scm_sym_eval_when)
  (scm_sym_arrow, scm_sym_else, scm_sym_apply, scm_sym_set_x)
  (scm_sym_args): Remove public declaration of these symbols.
  (scm_ilookup, scm_lookupcar, scm_eval_car, scm_eval_body)
  (scm_eval_args, scm_i_eval_x, scm_i_eval): Remove public declaration
  of these functions.
  (scm_ceval, scm_deval, scm_ceval_ptr): Remove declarations of these
  deprecated functions.
  (scm_i_print_iloc, scm_i_print_isym, scm_i_unmemocopy_expr)
  (scm_i_unmemocopy_body): Remove declarations of these internal
  functions.
  (scm_primitive_eval_x, scm_eval_x): Redefine as macros for their less
  destructive siblings.

* libguile/Makefile.am: Add memoize.[ch] to the build.

* libguile/debug.h (scm_debug_mode_p, scm_check_entry_p)
  (scm_check_apply_p, scm_check_exit_p, scm_check_memoize_p)
  (scm_debug_eframe_size): Remove these vars that were tied to the old
  evaluator's execution model.
  (SCM_RESET_DEBUG_MODE): Remove, no more need for this.
  (SCM_MEMOIZEDP, SCM_MEMOIZED_EXP, SCM_MEMOIZED_ENV): Remove macros
  referring to old memoized code representation.
  (scm_local_eval, scm_procedure_environment, scm_memoized_environment)
  (scm_make_memoized, scm_memoized_p): Remove functions operating on old
  memoized code representation.
  (scm_memcons, scm_mem_to_proc, scm_proc_to_mem): Remove debug-only
  code for old evaluator.

* libguile/debug.c: Remove code to correspond with debug.h removals.
  (scm_debug_options): No need to set the debug mode or frame limit
  here, as we don't have C stack limits any more. Perhaps this is a bug,
  but as long as we can compile eval.scm, we should be fine.

* libguile/init.c (scm_i_init_guile): Init memoize.c.

* libguile/modules.c (scm_top_level_env, scm_env_top_level)
  (scm_env_module, scm_system_module_env_p): Remove these functions.

* libguile/print.c (iprin1): No more need to handle isyms. Adapt to new
  form of interpreted procedures.

* libguile/procprop.c (scm_i_procedure_arity): Adapt to new form of
  interpreted procedures.

* libguile/procs.c (scm_thunk_p): Adapt to new form of interpreted
  procedures.
* libguile/procs.h (SCM_CLOSURE_FORMALS): Removed, this exists no more.
  (SCM_CLOSURE_NUM_REQUIRED_ARGS, SCM_CLOSURE_HAS_REST_ARGS): New
  accessors.

* libguile/srcprop.c (scm_source_properties, scm_source_property)
  (scm_set_source_property_x): Remove special cases for memoized code.

* libguile/stacks.c (read_frame): Remove a source-property case for
  interpreted code.
  (NEXT_FRAME): Remove a case that I don't fully understand, that seems
  to be designed to skip over apply frames. Will be obsolete in the
  futures.
  (read_frames): Default source value for interpreted frames to #f.
  (narrow_stack): Don't pay attention to the system_module thing.

* libguile/tags.h: Remove isyms and ilocs. Whee!

* libguile/validate.h (SCM_VALIDATE_MEMOIZED): Fix to use the new
  MEMOIZED_P formulation.

* module/ice-9/psyntax-pp.scm (do, quasiquote, case): Adapt for these no
  longer being primitive macros.
* module/ice-9/boot-9.scm: Whitespace change, but just a poke to force a
  rebuild due to and/or/cond/... not being primitives any more.

* module/ice-9/deprecated.scm (unmemoize-expr): Deprecate, it's
  unmemoize-expression now.

* test-suite/tests/eval.test ("define set procedure-name"): XFAIL a
  couple of tests here; I don't know what to do about them. I reckon the
  expander should ensure that defined values are named.

* test-suite/tests/chars.test ("basic char handling"): Fix expected
  exception when trying to apply a char.
2009-12-01 21:00:26 +01:00
Andy Wingo
c89222f8ce refactor psyntax.scm's treatment of lambda and lambda*
* module/ice-9/psyntax.scm (lambda-formals, chi-simple-lambda)
  (lambda*-formals, chi-lambda-case): Refactor the lambda
  transformations with an eye to being able to do case-lambda.

* module/ice-9/psyntax-pp.scm: Regenerated.

* test-suite/tests/syntax.test: Adapted tests so that the errors we
  expect match what is given by psyntax.
2009-10-25 12:36:44 +01:00
Andy Wingo
afe5e6baa7 eval is actually compile
* module/ice-9/boot-9.scm (eval): Here at the tail of boot-9, replace
  the root definition of `eval' with a procedure that will call
  `compile'.

* test-suite/tests/syntax.test ("top-level define"):
  ("internal define"): Run unmemoization tests in the interpreter, using
  primitive-eval.
2009-08-20 18:52:51 +02:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Andy Wingo
9ecac781bf syntax.test is passing, yay
* test-suite/tests/syntax.test ("top-level define"): Remove the test for
  currying, as we don't do that any more by default. It should be easy
  for the user to add in if she wants it, though.
  ("do"): Remove unmemoization tests, as sc-expand fully expands `do'.
  ("while"): Remove while tests in empty environments. They have been
  throwing 'unresolved, and the problem they seek to test is fully
  handled by hygiene anyway.

  And otherwise tweak expected exception strings, and everything passes!
2009-05-22 12:22:39 +02:00
Andy Wingo
dc1eed52f7 residualize names into procedures. re-implement srfi-61. module naming foo.
* module/ice-9/boot-9.scm (cond): Implement srfi-61; most of the code is
  from the SRFI itself. Yuk.
  (%print-module, make-modules-in, %app, (%app modules))
  (module-name): Syncase needs to get at the names of modules, even at
  anonymous modules. So lazily assign gensyms as module names. Name %app
  as (%app), but since (%app modules) is at the top of the module
  hierarchy, name it ().

* module/ice-9/psyntax.scm: When building tree-il, try to name lambdas in
  definitions and in lets.
  (let, letrec): Give more specific errors in a couple of cases.

* module/ice-9/psyntax-pp.scm: Regenerated.

* test-suite/tests/syntax.test: More work. Many exceptions have different
  messages than they used to, many more generic; we can roll this back to
  be faithful to the original strings, but it doesn't seem necessary to
  me.
2009-05-22 12:08:50 +02:00
Andy Wingo
0260421208 some work on syntax.test
* module/language/tree-il.scm (tree-il->scheme):
* module/ice-9/psyntax.scm (build-conditional): Attempt to not generate
  (if #f #f) as the second arm of an if, but it doesn't seem to be
  successful.

* module/ice-9/psyntax-pp.scm (syntax-rules): Regenerate.

* test-suite/tests/syntax.test (exception:unexpected-syntax): Change
  capitalization.
  ("unquote-splicing"): Update test.
  ("begin"): Add in second arms on these ifs, to avoid the strange though
  harmless expansion of `if'.
  (matches?): New helper macro.
  ("lambda"): Match on lexically bound symbols, as they will be
  alpha-renamed.
2009-05-21 22:43:07 +02:00
Andy Wingo
40b36cfbbe catch syntax errors in unquote and unquote-splicing
* module/ice-9/psyntax.scm (quasiquote): Catch syntax errors in unquote
  and unquote-splicing.

* module/ice-9/psytax-pp.scm: Regenerated.
2009-05-21 22:11:48 +02:00
Andy Wingo
ce09ee1989 add tree-il->glil compilation test suite
* module/language/tree-il.scm (parse-tree-il): Fix a number of bugs.
  (unparse-tree-il): Apply takes rest args now.

* module/language/tree-il/analyze.scm (analyze-lexicals)
  (analyze-lexicals): Heap vars shouldn't increment the number of locals.

* module/language/tree-il/optimize.scm (resolve-primitives!): Don't
  resolve public refs to primitives, not at the moment anyway.

* test-suite/Makefile.am (SCM_TESTS): Add tree-il test.

* test-suite/lib.scm (pass-if, expect-fail, pass-if-exception)
  (expect-fail-exception): Rewrite as syntax-rules macros. In a very
  amusing turn of events, it turns out that bindings introduced by
  hygienic macros are not visible inside expansions produced by
  defmacros. This seems to be expected, so go ahead and work around the
  problem.

* test-suite/tests/srfi-31.test ("rec special form"): Expand in eval.

* test-suite/tests/syntax.test ("begin"): Do some more expanding in eval,
  though all is not yet well.

* test-suite/tests/tree-il.test: New test suite, for tree-il->glil
  compilation.
2009-05-18 23:45:35 +02:00
Ludovic Courtès
9ee0f67880 Changes from arch/CVS synchronization 2007-07-18 20:25:38 +00:00
Ludovic Courtès
3dcf33733c Changes from arch/CVS synchronization 2007-05-26 14:30:50 +00:00
Kevin Ryde
6e7d5622ee merge from 1.8 branch 2006-04-16 23:37:40 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Kevin Ryde
2ebe323a15 (while): Tests running in empty environment are
now "unresolved" do to workaround in while implementation.
2005-01-27 21:23:09 +00:00