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.
beautiful-racket/beautiful-racket-demo/basic-demo/main.rkt

16 lines
523 B
Racket

8 years ago
#lang br/quicklang
8 years ago
(require "parser.rkt" "tokenizer.rkt")
8 years ago
8 years ago
(module+ reader (provide read-syntax))
8 years ago
(define (read-syntax path port)
8 years ago
(define-values (pline pcol ppos) (port-next-location port))
(define port+newline
(input-port-append #f port (open-input-string "\n")))
8 years ago
(port-count-lines! port+newline)
8 years ago
(set-port-next-location! port+newline pline pcol ppos)
(define parse-tree
(parse path (make-tokenizer port+newline path)))
(strip-bindings
#`(module basic-mod basic-demo/expander
#,parse-tree)))