@@ -309,11 +309,14 @@ The hope would be that we could get buy-in from other languages.
309
309
- Future evolution: Allow any ` info ` string with cargo checking for ` content.starts_with(["cargo", "cargo,"]) `
310
310
- Future evolution: Allow ` frontmatter ` attribute on any module
311
311
312
- If we dropped future possibilities for additional content, we could remove the opening/closing syntax and tweak it to avoid attribute ambiguity,
313
- greatly reducing the minimum syntax needed in some cases .
312
+ Syntactically, this avoids confusion with attributes by being stripped before lexing.
313
+ We could make this less ambiguous by using a double hash .
314
314
```` rust
315
315
#! / usr / bin / env cargo
316
- ## package . edition = " 2018"
316
+ ## ```cargo
317
+ ## [dependencies ]
318
+ ## foo = " 1.2.3"
319
+ ## ```
317
320
318
321
fn main () {}
319
322
````
@@ -326,11 +329,20 @@ Benefits
326
329
- Maybe we can get others on board with this syntax
327
330
328
331
Downsides
332
+ - ` # ` prefix plus a TOML ` [heading] ` looks too much like a Rust ` #[attribute] ` .
329
333
- More syntactically heavy than the frontmatter solution
330
334
- Visually
331
- - More work to type it out / copy-paste
335
+ - More work to type it out or copy-paste between cargo scripts and regular manifests
332
336
- More to get wrong
333
- - Requires users to deal with leading characters when editing/copying/pasting the manifest
337
+
338
+ If we dropped future possibilities for additional content, we could remove the opening/closing syntax,
339
+ greatly reducing the minimum syntax needed in some cases.
340
+ ```` rust
341
+ #! / usr / bin / env cargo
342
+ ## package . edition = " 2018"
343
+
344
+ fn main () {}
345
+ ````
334
346
335
347
### Alternative 3: Doc-comment
336
348
0 commit comments