Commit graph

19 commits

Author SHA1 Message Date
Ed Page
52d4ef12a8 fix(parser): Disallow CR in frontmatter
T-lang came back on the stabilization PR asking for CR to be disallowed
to leave room for all stray CRs to be rejected in the future.
At that point, the test can remain but the implementation can be
removed.

If that plan does not go through, we'll need to re-evaluate
- whether this is more lint-like and should defer to the calling tool
  that is managing the frontmatter
- how much Rust should treat the frontmatter as Rust and apply the same
  grammar restrictions of "no stray CR" (like raw string literals)
2026-01-28 13:01:02 -06:00
Ed Page
fb995ef5b3 test(frontmatter): Show behavior for straw cr 2026-01-28 13:01:02 -06:00
Ed Page
70b6d77983 fix(parse): Limit frontmatter fences to 255 dashes
Like raw string literals.
2025-11-26 14:09:18 -06:00
Ed Page
67094fc00a test(frontmatter): Check handling of long code fences 2025-11-26 14:08:38 -06:00
Ed Page
fc5f0f7ee5 test(frontmatter): Rename tests to make coverage more obvious
When working on the stabilization report,
I found it annoying to determine what cases were covered because areas
of the frontmatter feature were either not in the file name or in
inconsistent locations.

This moves the area of frontmatter to the start of the file name and the
moves to more specific the later in the file name so coverage is easier
to see.
2025-10-24 10:51:21 -05:00
Ed Page
bca35effc2 test(frontmatter): Cover spaces between infostring parts
As these characters are specifically called out in the RFC, I felt it
would be important to have a test to cover them.
2025-10-23 11:47:53 -05:00
Guillaume Gomez
a535c7be54 Ignore more failing ui tests for GCC backend 2025-09-26 15:33:48 +02:00
Alex
2d18c886f5 Fix a crash/mislex when more than one frontmatter closing possibility is considered 2025-09-22 15:10:41 -04:00
León Orell Valerian Liehr
7a66925a81
Strip frontmatter in fewer places 2025-09-09 19:49:40 +02:00
Ed Page
9304aa1936 test(lexer): Ensure tabs are accepted for horizontal whitespace 2025-09-01 20:51:31 -05:00
Ed Page
159be09c4f test(lexer): Ensure frontmatter can contain unicode whitespace 2025-09-01 20:51:30 -05:00
Ed Page
b2962c367a test(lexer): Ensure frontmatter w/ crlf works 2025-09-01 20:51:30 -05:00
Ed Page
142e25e356 fix(lexer): Don't require frontmatters to be escaped with indented fences
The RFC only limits hyphens at the beginning of lines and not if they
are indented or embedded in other content.

Sticking to that approach was confirmed by the T-lang liason at
https://github.com/rust-lang/rust/issues/141367#issuecomment-3202217544

There is a regression in error message quality which I'm leaving for
someone if they feel this needs improving.
2025-08-28 14:08:33 -05:00
Jacob Pratt
8cabd61dca
Rollup merge of #145751 - epage:infostring, r=joshtriplett
fix(lexer): Allow '-' in the frontmatter infostring continue set

This more closely matches the RFC and what our T-lang contact has asked
for, see https://github.com/rust-lang/rust/issues/136889#issuecomment-3212715312

Tracking issue: rust-lang/rust#136889
2025-08-22 22:01:00 -04:00
Ed Page
f43f974b9e fix(lexer): Allow '-' in the infostring continue set
This more closely matches the RFC and what our T-lang contact has asked
for, see https://github.com/rust-lang/rust/issues/136889#issuecomment-3212715312
2025-08-22 09:26:19 -05:00
Ed Page
9b0ddec2a8 test(frontmatter): Show current hyphen behavior 2025-08-22 09:17:41 -05:00
Deadbeef
c335d5781d ignore frontmatters in TokenStream::new 2025-08-18 20:28:29 +08:00
Matthew Jasper
55f59fb0e3 Fix parsing of frontmatters with inner hyphens 2025-06-04 15:51:36 +00:00
Deadbeef
662182637e Implement RFC 3503: frontmatters
Supercedes #137193
2025-05-05 23:10:08 +08:00