My language has something that is similar as the definition for interpolated strings in csharp.
Basically in the interpolated string you should be able to write any expression in the interpolated content.
This would then mean that the "Default" state should be made a child state of the interpolated content state. However since the default state doesn't have a scope (start/end delimiters) this doesn't work. In your example csharp language project you basically make all the children of the default state the children on the interpolated content and then you also duplicate most of the pattern groups.
Besides the fact that this is not really maintainable to have a duplicate set of pattern groups, it actually still isn't correct.
For example:
var xx = $"before { new Class1() { P1 = "test", P2 = true} } after";
Here I use an expression with curly braces inside a interpolated content. As soon as it sees the curly close, it thinks that the interpolated content is closed whereas it should just close the property initializer. This is due to the fact that you have a pattern group that is the same as the end delimiter on the lexical state.
If the "Default" state would be set as a child state, then this curly close should just be in the default state and pop that state and return to the interpolated string state and things should work. Unfortunately since the default state doesn't have a scope and therefor won't be activated as a child state.
Now in other questions in this forum, you mention that a lexer should just do lexing and not structural interpretations. Though I agree with that, I don't see how you can really do that when there is arbitrary text as in this case.
What is the best way of defining such a definition, how can I make it do a state transition to the default state (as a child state) after the open curly brace of the interpolated content state?