figure out how reader works
This commit is contained in:
parent
f7b526634a
commit
ac99689463
1
Makefile
1
Makefile
|
@ -1,6 +1,7 @@
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
|
||||||
KSY_FORMATS_REPO="https://github.com/kaitai-io/kaitai_struct_formats"
|
KSY_FORMATS_REPO="https://github.com/kaitai-io/kaitai_struct_formats"
|
||||||
|
KSY_SCHEMA_REPO="https://github.com/kaitai-io/ksy_schema"
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@echo meow
|
@echo meow
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#lang kaitai
|
||||||
|
|
||||||
|
meta:
|
||||||
|
id: hello_world
|
||||||
|
seq:
|
||||||
|
- id: one
|
||||||
|
type: u1
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
(define version "0.0.1")
|
(define version "0.0.1")
|
||||||
(define collection "kaitai")
|
(define collection "kaitai")
|
||||||
(define deps '("base"))
|
(define deps '("base" "yaml"))
|
||||||
(define test-omit-paths '("info.rkt"))
|
(define test-omit-paths '("info.rkt"))
|
||||||
; (define scribblings '(("kaitai.scrbl"))')
|
; (define scribblings '(("kaitai.scrbl"))')
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
;; empty for now
|
(provide (rename-out [kaitai-module-begin #%module-begin]))
|
||||||
|
|
||||||
|
(define-syntax-rule (kaitai-module-begin EXPR ...)
|
||||||
|
(#%module-begin
|
||||||
|
(displayln `(EXPR ...))))
|
||||||
|
|
||||||
|
(module reader syntax/module-reader
|
||||||
|
#:read kaitai-read
|
||||||
|
#:read-syntax kaitai-read
|
||||||
|
#:language "."
|
||||||
|
|
||||||
|
(require yaml)
|
||||||
|
|
||||||
|
(define (kaitai-read path port)
|
||||||
|
(or (read-yaml port) eof))
|
||||||
|
|
||||||
|
(define (kaitai-read-syntax path port)
|
||||||
|
(datum->syntax #f (kaitai-read path port))))
|
||||||
|
|
Loading…
Reference in New Issue