Skip to content
This repository was archived by the owner on Sep 13, 2019. It is now read-only.

Commit b4f1065

Browse files
committed
expander: allow serialize of syntax object in srcloc
1 parent 8a204e8 commit b4f1065

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

racket/src/expander/compile/serialize.rkt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@
258258
[(serialize? v)
259259
((serialize-ref v) v
260260
(case-lambda
261-
[(v) (loop v)]
262-
[(kind v) (loop v)])
261+
[(sub-v) (loop sub-v)]
262+
[(kind sub-v) (loop sub-v)])
263263
state)]
264264
[(pair? v)
265265
(loop (car v))
@@ -860,6 +860,8 @@
860860
[(prefab-struct-key v)
861861
(for ([e (in-vector (struct->vector v) 1)])
862862
(loop e))]
863+
[(srcloc? v)
864+
(loop (srcloc-source v))]
863865
[else
864866
(void)])]))
865867

racket/src/expander/syntax/syntax.rkt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@
136136
(reach (syntax-shifted-multi-scopes s))
137137
(for ([(k v) (in-immutable-hash (syntax-props s))]
138138
#:when (preserved-property-value? v))
139-
(reach (plain-property-value v)))))
139+
(reach (plain-property-value v)))
140+
(reach (syntax-srcloc s))))
140141

141142
;; Property to abstract over handling of propagation for
142143
;; serialization; property value takes a syntax object and

racket/src/racket/src/startup.inc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5628,7 +5628,8 @@ static const char *startup_source =
56285628
"(values))))))"
56295629
" for-loop_31)"
56305630
"(unsafe-immutable-hash-iterate-first ht_31))))"
5631-
"(void)))))"
5631+
"(void)"
5632+
"(reach_0(syntax-srcloc s_44))))))"
56325633
"(cons"
56335634
" prop:serialize"
56345635
"(lambda(s_45 ser-push!_1 state_9)"
@@ -17409,13 +17410,13 @@ static const char *startup_source =
1740917410
" v_96)"
1741017411
" v_96"
1741117412
"(case-lambda"
17412-
"((v_98)"
17413+
"((sub-v_0)"
1741317414
"(loop_80"
17414-
" v_98))"
17415+
" sub-v_0))"
1741517416
"((kind_4"
17416-
" v_100)"
17417+
" sub-v_1)"
1741717418
"(loop_80"
17418-
" v_100)))"
17419+
" sub-v_1)))"
1741917420
" state_22))"
1742017421
"(if(pair? v_96)"
1742117422
"(let-values()"
@@ -20226,7 +20227,9 @@ static const char *startup_source =
2022620227
" for-loop_146)"
2022720228
" start*_4)))"
2022820229
"(void)))"
20229-
"(let-values()(void)))))))))))))))))"
20230+
"(if(srcloc? v_156)"
20231+
"(let-values()(loop_81(srcloc-source v_156)))"
20232+
"(let-values()(void))))))))))))))))))"
2023020233
" loop_81)"
2023120234
" v_155)"
2023220235
" reachable-scopes_7)))))))"

0 commit comments

Comments
 (0)