File tree Expand file tree Collapse file tree 2 files changed +32
-3
lines changed
typed-racket-test/unit-tests Expand file tree Collapse file tree 2 files changed +32
-3
lines changed Original file line number Diff line number Diff line change 18
18
(Pair Symbol (Pair (Listof XExpr-Attribute) (Listof XExpr)))
19
19
(Pair Symbol (Listof XExpr))))
20
20
21
- (require/typed/provide xml
21
+ (require/typed xml
22
22
[#:struct location
23
23
([line : (U False Exact-Nonnegative-Integer)]
24
24
[char : (U False Exact-Nonnegative-Integer)]
25
- [offset : Exact-Nonnegative-Integer])
26
- #:type-name Location]
25
+ [offset : Exact-Nonnegative-Integer])])
26
+
27
+ (define-type Location
28
+ (U location Symbol False))
29
+
30
+ (require/typed/provide xml
27
31
[#:struct source
28
32
([start : Location]
29
33
[stop : Location])
Original file line number Diff line number Diff line change
1
+ #lang typed/racket/base
2
+
3
+ (module+ test
4
+
5
+ (require typed/rackunit
6
+ "../../typed-racket-more/typed/xml.rkt " )
7
+
8
+ (let ([xml-p-i
9
+ (p-i #f #f 'xml "version=\"1.0\" encoding=\"UTF-8\" " )])
10
+ (check-eq?
11
+ (source-start xml-p-i)
12
+ #f )
13
+ (check-eq?
14
+ (source-stop xml-p-i)
15
+ #f ))
16
+
17
+ (let ([xml-p-i
18
+ (p-i 'racket 'racket 'xml "version=\"1.0\" encoding=\"UTF-8\" " )])
19
+ (check-eq?
20
+ (source-start xml-p-i)
21
+ 'racket )
22
+ (check-eq?
23
+ (source-stop xml-p-i)
24
+ 'racket )))
25
+
You can’t perform that action at this time.
0 commit comments