You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
Racket
38 lines
1.1 KiB
Racket
3 years ago
|
#lang debug racket/base
|
||
3 years ago
|
(require "layout.rkt"
|
||
|
"render.rkt"
|
||
|
"quad.rkt"
|
||
|
"compile.rkt"
|
||
|
"atomize.rkt"
|
||
|
"layout.rkt"
|
||
|
"draw.rkt"
|
||
|
racket/string
|
||
|
racket/match)
|
||
|
|
||
|
(define-pass (bootstrap x)
|
||
3 years ago
|
#:pre values
|
||
|
#:post quad?
|
||
3 years ago
|
(match x
|
||
3 years ago
|
[(or (? quad? q) (list (? quad? q))) q]
|
||
|
[(and (list (? quad?) ...) qs) (make-quad #:elems qs)]
|
||
|
[other (make-quad #:elems (list other))]))
|
||
3 years ago
|
|
||
|
(define quad-compile (make-compiler (list
|
||
|
bootstrap
|
||
|
atomize
|
||
|
layout
|
||
|
make-drawing-insts)))
|
||
|
|
||
|
(define quad-compile-to-stack (compiler-append quad-compile
|
||
|
(list stackify)))
|
||
3 years ago
|
|
||
3 years ago
|
(define drawing-insts (parameterize ([current-wrap-width 13])
|
||
3 years ago
|
(quad-compile-to-stack "Hello this is the earth")))
|
||
|
|
||
3 years ago
|
(displayln drawing-insts)
|
||
3 years ago
|
|
||
3 years ago
|
(render drawing-insts #:using text-renderer)
|
||
|
(render drawing-insts #:using drr-renderer)
|
||
3 years ago
|
|
||
3 years ago
|
#;(render-to-html drawing-insts)
|
||
|
#;(render-to-pdf drawing-insts)
|