File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010(define (symbol->data-label s)
1111 (to-label "data_ " s))
1212
13+ ;; Char -> String
14+ (define (char-encode c)
15+ (if (or (char<=? #\a c #\z )
16+ (char<=? #\A c #\Z )
17+ (char<=? #\0 c #\9 )
18+ (memq c '(#\_ #; #\$ #\# #\@ #\~ #\. #\? )))
19+ (make-string 1 c)
20+ (string-append "$ " (number->string (char->integer c) 16 ))))
21+
1322(define (to-label prefix s)
1423 (string->symbol
15- (string-append
16- prefix
17- (apply string-append
18- (map (λ (c)
19- (if (or (char<=? #\a c #\z )
20- (char<=? #\A c #\Z )
21- (char<=? #\0 c #\9 )
22- (memq c '(#\_ #; #\$ #\# #\@ #\~ #\. #\? )))
23- (make-string 1 c)
24- (string-append "$ " (number->string (char->integer c) 16 ))))
25- (string->list (symbol->string s)))))))
24+ (string-append prefix
25+ (apply string-append
26+ (map char-encode
27+ (string->list (symbol->string s)))))))
2628
2729;; Id CEnv -> [Maybe Integer]
2830(define (lookup x cenv)
You can’t perform that action at this time.
0 commit comments