The standard scopes being used in the core requires meta scopes to stack, this is problematic if you try to give different colors for e.g. function/class punctuation, because in languages like javascript, you can declare a class inside a function and that would make the class having the meta.function scope too.
A simple example:
class MyClass {
myMethod() {
}
}
The scopes for opening brace for that method is:
source.js.fjsx15
meta.class.js.fjsx15
meta.block.js.fjsx15
meta.function.js.fjsx15
meta.block.js.fjsx15
punctuation.section.block.begin.js.fjsx15
The proposed solution would be to have some sort of operator to match the scopes sequentially and from the bottom up, so that you could do something like:
Match the deepest element as punctuation.section
Directly preceded by meta.block
Directly preceded by meta.function
And in the case of classes:
Match the deepest element as punctuation.section
Directly preceded by meta.block
Directly preceded by meta.class