1#lang racket/base
2(require stepper/private/xml-snip-helpers
3         mzlib/class
4         mred)
5
6(provide snip-class scheme-snip%)
7
8(define scheme-snip%
9  (class* editor-snip% (scheme-snip<%> readable-snip<%>)
10    (init-field splice?)
11    (define/public (get-splice?) splice?)
12
13    (define/public (read-special file line col pos)
14      (scheme-read-special this
15                           file
16                           line
17                           col
18                           pos))
19
20    (super-instantiate ())))
21
22(define scheme-snipclass%
23  (class snip-class%
24    (define/override (read stream-in)
25      (let* ([splice? (zero? (send stream-in get-exact))]
26             [snip (instantiate scheme-snip% ()
27                                (splice? splice?))])
28        (send (send snip get-editor) read-from-file stream-in #f)
29        snip))
30    (super-instantiate ())))
31
32(define snip-class (make-object scheme-snipclass%))
33(send snip-class set-version 1)
34(send snip-class set-classname (format "~s" '(lib "scheme-snipclass.rkt" "xml")))
35(send (get-the-snip-class-list) add snip-class)
36