[Lldb-commits] [lldb] [lldb] Support alternatives for scope format entries (PR #137751)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Mon May 5 16:09:39 PDT 2025


Michael137 wrote:

> @Michael137 I looked into adding the diagnostic you asked about and while the implementation is relatively straightforward, I'm even more convinced that I don't think it belongs there because it's a semantic rather than a syntax error.
> 
> We can detect a scope followed by an alternative scope, i.e. something like `{{foo}|bar}` but what about something like `{foo|bar}`. Just like a scope, `foo` will always resolve, so technically `bar` is unreachable. Should we diagnose this too? And what about `{${frame.pc}||bar}`. The empty string between the two pipes will always resolve. In other words, I don't think this warrants special casing as there are plenty of other scenarios that trigger similar behavior that would be much harder to diagnose.

Ok thanks for giving it a shot. I agree it doesn't quite fit the existing syntax diagnostics. We can always choose to revisit if this becomes a big point of confusion for people

https://github.com/llvm/llvm-project/pull/137751


More information about the lldb-commits mailing list