bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61303: 29.0.60; rust-ts-mode does not consistently fontify nested ma


From: Jostein Kjønigsen
Subject: bug#61303: 29.0.60; rust-ts-mode does not consistently fontify nested macro-invocations
Date: Sun, 05 Feb 2023 23:26:32 +0100
User-agent: Cyrus-JMAP/3.9.0-alpha0-107-g82c3c54364-fm-20230131.002-g82c3c543


On Sun, Feb 5, 2023, at 23:22, Theodor Thornhill wrote:
Jostein Kjønigsen <jostein@secure.kjonigsen.net> writes:

> Hey there.
>

Hi!

> Thanks for another tree-sitter based mode to hack at :D
>
> I think I've found an error/lacking in rust-ts-mode where we may have to move
> upstream to fix it.
>
> Consider the following contrived (and yes, not very idiomatic) rust-code:
>
> let result = format!("{}{}",
>     "Well yes",
>     format!("Or {} no?", "possibly"));
>
> With rust-ts-mode first format! invocation will get highlighted as a
> macro-invocation, while the second will not.
>
> Inspecting this using treesit-explore-mode, I get the following tree:
>
> (let_declaration let pattern: (identifier) =
>   value:
>    (macro_invocation macro: (identifier) !
>     (token_tree (
>      (string_literal " ")
>      (string_literal " ")
>      (identifier)
>      (token_tree (
>       (string_literal " ")
>       (string_literal " ")
>       ))
>      )))
>   ;)
>
> Notice the lack of a second/nested "macro_invocation"-node. Instead the second
> macro is just denoted as a "identifier".
>
> To fix this, we'll probably need to upstream some bug-reports and PRs?

Sounds like it!  Just in case - the code compiles, right?

Theo


Yes. This is compilable, runnable rust-code. 


Jostein

reply via email to

[Prev in Thread] Current Thread [Next in Thread]