fix certificates with syntax/loc
svn: r1203
This commit is contained in:
parent
f5addba2df
commit
724296a2c7
File diff suppressed because it is too large
Load Diff
|
@ -100,6 +100,8 @@ static Scheme_Object *read_resolve_prefix(Scheme_Object *obj);
|
|||
|
||||
static void skip_certain_things(Scheme_Object *o, Scheme_Close_Custodian_Client *f, void *data);
|
||||
|
||||
int scheme_is_module_begin_env(Scheme_Comp_Env *env);
|
||||
|
||||
#ifdef MZ_PRECISE_GC
|
||||
static void register_traversers(void);
|
||||
#endif
|
||||
|
|
|
@ -1680,15 +1680,18 @@
|
|||
"(syntax-case** #f #t stx() module-identifier=?"
|
||||
"((_ stxe kl clause ...)"
|
||||
"(syntax(syntax-case** _ #f stxe kl module-identifier=? clause ...))))))"
|
||||
"(-define loc-insp(current-code-inspector))"
|
||||
"(-define(relocate loc stx)"
|
||||
"(let((new-stx(datum->syntax-object"
|
||||
" stx"
|
||||
"(syntax-e stx)"
|
||||
" loc)))"
|
||||
"(syntax-recertify new-stx stx loc-insp #f)))"
|
||||
"(-define-syntax syntax/loc"
|
||||
"(lambda(stx)"
|
||||
"(syntax-case** #f #t stx() module-identifier=?"
|
||||
"((_ loc pattern)"
|
||||
"(syntax(let((stx(syntax pattern)))"
|
||||
"(datum->syntax-object"
|
||||
" stx"
|
||||
"(syntax-e stx)"
|
||||
" loc)))))))"
|
||||
"(syntax(relocate loc(syntax pattern)))))))"
|
||||
"(provide syntax/loc syntax-case* syntax-case))"
|
||||
);
|
||||
EVAL_ONE_STR(
|
||||
|
|
|
@ -1984,6 +1984,14 @@
|
|||
[(_ stxe kl clause ...)
|
||||
(syntax (syntax-case** _ #f stxe kl module-identifier=? clause ...))])))
|
||||
|
||||
(-define loc-insp (current-code-inspector))
|
||||
(-define (relocate loc stx)
|
||||
(let ([new-stx (datum->syntax-object
|
||||
stx
|
||||
(syntax-e stx)
|
||||
loc)])
|
||||
(syntax-recertify new-stx stx loc-insp #f)))
|
||||
|
||||
;; Like syntax, but also takes a syntax object
|
||||
;; that supplies a source location for the
|
||||
;; resulting syntax object.
|
||||
|
@ -1991,11 +1999,7 @@
|
|||
(lambda (stx)
|
||||
(syntax-case** #f #t stx () module-identifier=?
|
||||
[(_ loc pattern)
|
||||
(syntax (let ([stx (syntax pattern)])
|
||||
(datum->syntax-object
|
||||
stx
|
||||
(syntax-e stx)
|
||||
loc)))])))
|
||||
(syntax (relocate loc (syntax pattern)))])))
|
||||
|
||||
(provide syntax/loc syntax-case* syntax-case))
|
||||
|
||||
|
|
|
@ -3019,6 +3019,8 @@ quote_syntax_syntax(Scheme_Object *form, Scheme_Comp_Env *env, Scheme_Compile_In
|
|||
if (len != 2)
|
||||
bad_form(form, len);
|
||||
|
||||
scheme_rec_add_certs(rec, drec, form);
|
||||
|
||||
stx = SCHEME_STX_CDR(form);
|
||||
stx = SCHEME_STX_CAR(stx);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user