Expand description
Comments, and the rule that decides where one starts.
A comment starts at a # written where a line or a token starts and runs to
the end of the line, unless the # opens a value:
- at the start of a line, after any indentation, a
#always starts one; - later on a line, after a space or a tab, a
#starts one only when no character that could continue a bare reference follows it, that is when whitespace, the end of the document,(,)or:comes next. Soa: b # whyanda: b #hold a comment, whiletag #releaseis the link oftagand#release(issue #444): a value is never silently dropped.
A # written inside a token (issue#1047) or inside a delimited reference
("# not a comment") is an ordinary character. The parser never sees it: strip_comments replaces
every byte of every comment with a space before the document is parsed, so
the notation itself stays exactly as it was and a position reported by the
parser still points at the same character of the document the caller wrote.
Constants§
- COMMENT
- The character that opens a comment.
Functions§
- strip_
comments - Blanks out every comment in
document, keeping every other byte where it was.