1
Fork 0

[librustdoc] Reform lang string token splitting

Only split doctest lang strings on `,`, ` `, and `\t`. Additionally, to
preserve backwards compatibility with pandoc-style langstrings, strip a
surrounding `{}`, and remove leading `.`s from each token.

Prior to this change, doctest lang strings were split on all
non-alphanumeric characters except `-` or `_`, which limited future
extensions to doctest lang string tokens, for example using `=` for
key-value tokens.

This is a breaking change, although it is not expected to be disruptive,
because lang strings using separators other than `,` and ` ` are not
very common
This commit is contained in:
Casey Rodarmor 2020-10-26 19:08:42 -07:00
parent e9920ef774
commit 66f4883308
No known key found for this signature in database
GPG key ID: 556186B153EC6FE0
6 changed files with 84 additions and 20 deletions

View file

@ -2,7 +2,7 @@ Multiple candidate files were found for an out-of-line module.
Erroneous code example:
```ignore (multiple source files required for compile_fail)
```ignore (Multiple source files are required for compile_fail.)
// file: ambiguous_module/mod.rs
fn foo() {}