Commit fd82527
authored
This reduces the places where content in the comment causes DocC to
silently mis-parse the comment and content after it.
The markdown parser for DocC first parses plain markdown syntax, and
then identifies places where the `@Comment { }` syntax delimits blocks.
That means it tries to parse the content of a comment as markdown first,
and then later it gets turned into a comment. The parsing of HTML style
comments happens as part of the first stage, which makes it less
fragile.
Using the DocC syntax for comments, a lot of the issues seem to come
from `}` appearing in commented-out in code listings, or from other
places where part of the comment is being interpreted as markdown and
preventing the later DocC parsing pass from treating that content as a
comment, or in some causes causing content after it to be missing. Using
the HTML comment syntax, the `-->` arrow used in comment-out formal
grammar conflicts with the end-of-comment marker, which I worked around
by changing them to a `->` arrow. We can probably delete most or all of
the commented-out formal grammar blocks, which seem to date back to the
original drafting of the book's grammar.
Some of the comment-parsing issues appear to be related to a known issue
in Swift-Markdown: swiftlang/swift-markdown#84
File tree
42 files changed
+3041
-3047
lines changed- Sources/TSPL/TSPL.docc
- GuidedTour
- LanguageGuide
- ReferenceManual
- RevisionHistory
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
42 files changed
+3041
-3047
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
0 commit comments