Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5f3002e

Browse files
Add eBNF and documentation on TagIterator
1 parent 7681f63 commit 5f3002e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/librustdoc/html/markdown.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,36 @@ pub(crate) enum Ignore {
855855
Some(Vec<String>),
856856
}
857857

858+
/// This is the parser for fenced codeblocks attributes. It implements the following eBNF:
859+
///
860+
/// ```eBNF
861+
/// lang-string = *(token-list / delimited-attribute-list / comment)
862+
///
863+
/// bareword = CHAR *(CHAR)
864+
/// quoted-string = QUOTE *(NONQUOTE) QUOTE
865+
/// token = bareword / quoted-string
866+
/// sep = COMMA/WS *(COMMA/WS)
867+
/// attribute = (DOT token)/(token EQUAL token)
868+
/// attribute-list = [sep] attribute *(sep attribute) [sep]
869+
/// delimited-attribute-list = OPEN-CURLY-BRACKET attribute-list CLOSE-CURLY-BRACKET
870+
/// token-list = [sep] token *(sep token) [sep]
871+
/// comment = OPEN_PAREN *(all characters) CLOSE_PAREN
872+
///
873+
/// OPEN_PAREN = "("
874+
/// CLOSE_PARENT = ")"
875+
/// OPEN-CURLY-BRACKET = "{"
876+
/// CLOSE-CURLY-BRACKET = "}"
877+
/// CHAR = ALPHA / DIGIT / "_" / "-" / ":"
878+
/// QUOTE = %x22
879+
/// NONQUOTE = %x09 / %x20 / %x21 / %x23-7E ; TAB / SPACE / all printable characters except `"`
880+
/// COMMA = ","
881+
/// DOT = "."
882+
/// EQUAL = "="
883+
///
884+
/// ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
885+
/// DIGIT = %x30-39
886+
/// WS = %x09 / " "
887+
/// ```
858888
pub(crate) struct TagIterator<'a, 'tcx> {
859889
inner: Peekable<CharIndices<'a>>,
860890
data: &'a str,

0 commit comments

Comments
 (0)