racket / racket/scribble

codeblock reports errors in terms of read-syntax

Open
#273 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Racket
Stars
250
Forks
102
Avg merge
11d 11h
Merged PRs (30d)
1

Description

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
 `@"`"`
}

This inspired @shriram's example in https://github.com/greghendershott/markdown/issues/84. With that example, the srcloc points to the markdown/scrib library:

#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))

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Scribble codeblock example and compare its runtime read-syntax error with the source location shown in the markdown example. Trace the codeblock parsing path and the markdown/scrib path, then verify that malformed block input reports an appropriate error and source location rather than exposing an internal read-syntax message.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.