When codeblock can't parse its arguments, the error can be raised in terms of read-syntax. For example, the following program produces the error message “:4:4: read-syntax: bad syntax #” at runtime (not at read-time):
#lang scribble/manual
@codeblock{
`@"`"`
A ::= B
| C
| D # which is an E
`@"`"`
}
#lang at-exp racket
(require markdown markdown/scrib scribble/decode)
(define xs
(parameterize ([current-input-port
(open-input-string
@string-append{```
A ::= B
| C
| D # which is an E
```})])
(read-markdown)))
xs
(with-handlers ([exn:fail? (λ (e) e)])
(xexprs->scribble-pres xs))
When:4:4: read-syntax: bad syntax
codeblock
can't parse its arguments, the error can be raised in terms ofread-syntax
. For example, the following program produces the error message “#
” at runtime (not at read-time):This inspired @shriram's example in https://github.com/greghendershott/markdown/issues/84. With that example, the
srcloc
points to themarkdown/scrib
library: