1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 09:10:22 +02:00

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.
This commit is contained in:
Andy Wingo 2009-05-21 22:43:07 +02:00
parent 40b36cfbbe
commit 0260421208
4 changed files with 37 additions and 19 deletions

File diff suppressed because one or more lines are too long

View file

@ -368,7 +368,9 @@
(case (fluid-ref *mode*)
((c) ((@ (language tree-il) make-conditional)
source test-exp then-exp else-exp))
(else `(if ,test-exp ,then-exp ,else-exp)))))
(else (if (equal? else-exp '(if #f #f))
`(if ,test-exp ,then-exp)
`(if ,test-exp ,then-exp ,else-exp))))))
(define build-lexical-reference
(lambda (type source name var)

View file

@ -215,7 +215,9 @@
`(,(tree-il->scheme proc) ,@(map tree-il->scheme args)))
((<conditional> test then else)
`(if ,(tree-il->scheme test) ,(tree-il->scheme then) ,(tree-il->scheme else)))
(if (void? else)
`(if ,(tree-il->scheme test) ,(tree-il->scheme then))
`(if ,(tree-il->scheme test) ,(tree-il->scheme then) ,(tree-il->scheme else))))
((<primitive-ref> name)
name)