change syntax/loc to leave alone a template that contains just a pattern variable

svn: r3601
This commit is contained in:
Matthew Flatt 2006-07-05 19:32:42 +00:00
parent 96bfdf5101
commit 8fa40a972a
3 changed files with 1258 additions and 1250 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1681,7 +1681,7 @@
EVAL_ONE_STR(
"(module #%stxloc #%kernel"
"(require #%stxcase #%define-et-al)"
"(require-for-syntax #%kernel #%stxcase)"
"(require-for-syntax #%kernel #%stxcase #%sc)"
"(-define-syntax syntax-case*"
"(lambda(stx)"
"(syntax-case** #f #t stx() module-identifier=?"
@ -1705,7 +1705,11 @@
"(lambda(stx)"
"(syntax-case** #f #t stx() module-identifier=?"
"((_ loc pattern)"
"(syntax(relocate loc(syntax pattern)))))))"
"(if(if(symbol?(syntax-e #'pattern))"
"(syntax-mapping?(syntax-local-value #'pattern(lambda() #f)))"
" #f)"
"(syntax(syntax pattern))"
"(syntax(relocate loc(syntax pattern))))))))"
"(provide syntax/loc syntax-case* syntax-case))"
);
EVAL_ONE_STR(

View File

@ -1980,7 +1980,7 @@
(module #%stxloc #%kernel
(require #%stxcase #%define-et-al)
(require-for-syntax #%kernel #%stxcase)
(require-for-syntax #%kernel #%stxcase #%sc)
;; Regular syntax-case
(-define-syntax syntax-case*
@ -2013,7 +2013,11 @@
(lambda (stx)
(syntax-case** #f #t stx () module-identifier=?
[(_ loc pattern)
(syntax (relocate loc (syntax pattern)))])))
(if (if (symbol? (syntax-e #'pattern))
(syntax-mapping? (syntax-local-value #'pattern (lambda () #f)))
#f)
(syntax (syntax pattern))
(syntax (relocate loc (syntax pattern))))])))
(provide syntax/loc syntax-case* syntax-case))