Rename ProcMacroKind::FuncLike to Bang

This commit is contained in:
Lukas Wirth 2024-03-21 09:33:17 +01:00
parent fc0d51ae65
commit 8e324e98a1
18 changed files with 83 additions and 66 deletions

View file

@ -48,7 +48,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
<pre><code><span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="builtin_attr attribute library">allow</span><span class="parenthesis attribute">(</span><span class="none attribute">dead_code</span><span class="parenthesis attribute">)</span><span class="attribute_bracket attribute">]</span>
<span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="tool_module attribute library">rustfmt</span><span class="operator attribute">::</span><span class="tool_module attribute library">skip</span><span class="attribute_bracket attribute">]</span>
<span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="module attribute crate_root library">proc_macros</span><span class="operator attribute">::</span><span class="attribute attribute library">identity</span><span class="attribute_bracket attribute">]</span>
<span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="attribute attribute default_library library">derive</span><span class="parenthesis attribute">(</span><span class="derive attribute default_library library">Copy</span><span class="parenthesis attribute">)</span><span class="attribute_bracket attribute">]</span>
<span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="attribute attribute default_library library">derive</span><span class="parenthesis attribute">(</span><span class="derive attribute default_library library">Default</span><span class="parenthesis attribute">)</span><span class="attribute_bracket attribute">]</span>
<span class="comment documentation">/// This is a doc comment</span>
<span class="comment">// This is a normal comment</span>
<span class="comment documentation">/// This is a doc comment</span>
@ -58,4 +58,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
<span class="comment">// This is another normal comment</span>
<span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="attribute attribute default_library library">derive</span><span class="parenthesis attribute">(</span><span class="derive attribute default_library library">Copy</span><span class="comma attribute">,</span> <span class="unresolved_reference attribute">Unresolved</span><span class="parenthesis attribute">)</span><span class="attribute_bracket attribute">]</span>
<span class="comment">// The reason for these being here is to test AttrIds</span>
<span class="keyword">struct</span> <span class="struct declaration">Foo</span><span class="semicolon">;</span></code></pre>
<span class="keyword">enum</span> <span class="enum declaration">Foo</span> <span class="brace">{</span>
<span class="attribute_bracket attribute">#</span><span class="attribute_bracket attribute">[</span><span class="derive_helper attribute default_library library">default</span><span class="attribute_bracket attribute">]</span>
<span class="enum_variant declaration">Bar</span>
<span class="brace">}</span></code></pre>

View file

@ -22,11 +22,11 @@ fn attributes() {
check_highlighting(
r#"
//- proc_macros: identity
//- minicore: derive, copy
//- minicore: derive, copy, default
#[allow(dead_code)]
#[rustfmt::skip]
#[proc_macros::identity]
#[derive(Copy)]
#[derive(Default)]
/// This is a doc comment
// This is a normal comment
/// This is a doc comment
@ -36,7 +36,10 @@ fn attributes() {
// This is another normal comment
#[derive(Copy, Unresolved)]
// The reason for these being here is to test AttrIds
struct Foo;
enum Foo {
#[default]
Bar
}
"#,
expect_file!["./test_data/highlight_attributes.html"],
false,