zybino/old-code/main.rkt
2020-06-09 14:50:42 +12:00

22 lines
566 B
Racket

#lang racket/base
(require "parser.rkt" "tokenizer.rkt")
(require syntax/strip-context)
(module+ reader
(provide read-syntax get-info))
(define (read-syntax path port)
(define parse-tree (parse path (make-tokenizer port path)))
(strip-context
#`(module zybino-mod zybino/expander
#,parse-tree)))
(define (get-info port src-mod src-line src-col src-pos)
(define (handle-query key default)
(case key
[(colour-lexer)
(dynamic-require 'zybino/colourer 'zybino-colourer)]
[else default]))
handle-query)