File tree 2 files changed +26
-4
lines changed
redex-pict-lib/redex/private
2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 610
610
611
611
;; split-out : number pict (listof line) -> (listof line)
612
612
(define (split-out col pict lines)
613
- (let ([new-token (make-pict-token col 0 pict)])
613
+ (let ([new-token (make-pict-token col 0 ( pict-convertible->pict pict) )])
614
614
(let loop ([lines lines])
615
615
(cond
616
616
[(null? lines)
768
768
(define (atom->tokens col span atom all-nts unquoted?)
769
769
(cond
770
770
[(pict-convertible? atom)
771
- (list (make-pict-token col span atom))]
771
+ (list (make-pict-token col span (pict-convertible->pict atom) ))]
772
772
[unquoted?
773
773
(list (make-pict-token col span
774
774
(pink-background
828
828
(define str/pict/sym (apply-atomic-rewrite e))
829
829
(cond
830
830
[(string? str/pict/sym) (make-string-token col span str/pict/sym (get-style))]
831
- [(pict-convertible? str/pict/sym) (make-pict-token col span str/pict/sym)]
831
+ [(pict-convertible? str/pict/sym) (make-pict-token col span (pict-convertible->pict str/pict/sym) )]
832
832
[(symbol? str/pict/sym) #f ]))
833
833
834
834
(define (parse-subscript after-underscore)
Original file line number Diff line number Diff line change 1
1
#lang racket
2
+ #|
3
+
4
+ This file exports functions that have the same interface as the functions
5
+ in racket's pict library but, if rhombus is available, actually build
6
+ rhombus picts. No other file in redex should depend on the racket
7
+ pict library.
8
+
9
+ |#
10
+
2
11
(require (for-syntax syntax/parse racket/syntax)
3
12
(only-in pict/convert pict-convertible?)
4
13
(prefix-in p: pict)
5
- pict)
14
+ pict/convert )
6
15
7
16
(define-syntax (define-rhombus stx)
8
17
(syntax-parse stx
50
59
(define (to-rhm-pict p)
51
60
(choose p (r:from_handle p)))
52
61
62
+ ;; we need this function to make sure that, when we're in rhombus mode
63
+ ;; we actually work only with rhombus picts, as rhombus pict functions
64
+ ;; don't implicitly do pict-convertible conversion
65
+ (provide pict-convertible->pict)
66
+ (define (pict-convertible->pict p)
67
+ (choose
68
+ (pict-convert p)
69
+ (cond
70
+ [(p:pict? p)
71
+ (to-rhm-pict p)]
72
+ [(pict-convertible? p)
73
+ (to-rhm-pict (pict-convert p))])))
74
+
53
75
(provide dc
54
76
blank
55
77
text
You can’t perform that action at this time.
0 commit comments