|
|
|
@ -538,6 +538,7 @@ Here's the definition for
|
|
|
|
|
brag/examples/simple-line-drawing/semantics
|
|
|
|
|
#:read my-read
|
|
|
|
|
#:read-syntax my-read-syntax
|
|
|
|
|
#:info my-get-info
|
|
|
|
|
#:whole-body-readers? #t
|
|
|
|
|
|
|
|
|
|
(require brag/examples/simple-line-drawing/lexer
|
|
|
|
@ -548,6 +549,13 @@ Here's the definition for
|
|
|
|
|
|
|
|
|
|
(define (my-read-syntax src ip)
|
|
|
|
|
(list (parse src (tokenize ip))))
|
|
|
|
|
|
|
|
|
|
(define (my-get-info key default default-filter)
|
|
|
|
|
(case key
|
|
|
|
|
[(color-lexer)
|
|
|
|
|
(dynamic-require 'syntax-color/default-lexer 'default-lexer)]
|
|
|
|
|
[else
|
|
|
|
|
(default-filter key default)]))
|
|
|
|
|
}|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -577,19 +585,19 @@ compilation:
|
|
|
|
|
(begin-for-syntax
|
|
|
|
|
(define (compile-drawing drawing-stx)
|
|
|
|
|
(syntax-parse drawing-stx
|
|
|
|
|
[({~literal drawing} rows-stxs ...)
|
|
|
|
|
[({~literal drawing} row-stxs ...)
|
|
|
|
|
|
|
|
|
|
(syntax/loc drawing-stx
|
|
|
|
|
(begin rows-stxs ...))]))
|
|
|
|
|
(begin row-stxs ...))]))
|
|
|
|
|
|
|
|
|
|
(define (compile-rows rows-stx)
|
|
|
|
|
(syntax-parse rows-stx
|
|
|
|
|
(define (compile-rows row-stx)
|
|
|
|
|
(syntax-parse row-stx
|
|
|
|
|
[({~literal rows}
|
|
|
|
|
({~literal repeat} repeat-number)
|
|
|
|
|
chunks ...
|
|
|
|
|
";")
|
|
|
|
|
|
|
|
|
|
(syntax/loc rows-stx
|
|
|
|
|
(syntax/loc row-stx
|
|
|
|
|
(for ([i repeat-number])
|
|
|
|
|
chunks ...
|
|
|
|
|
(newline)))]))
|
|
|
|
|