Hi Andrew, I'm trying to improve the syntax parsing of our domain-specific language. Specifically, I have an identifier, which should be some colour, but a different colour if it comes right after a separator. I have a syntax graph in a JPG here:
I believe the blue boxes to be different states, and FIELDSEP to have a leave state of IDENT, and FIELD to have a leave state of FIELDSEP, and so on.
I want to do this for correct coloring, but also because I want to inspect the current state when a key is pressed (i.e. I want to know when the user is editing a FIELD).
Is it possible to do this with the Syntax Scheme system?
Many thanks for any hints.
PS: That drawing has some minor errors (like that the number of array digits currently would always be odd). Sloppy, but immaterial to the big picture

Could you send us examples of various identifiers/fields with separators, so we can provide an example of syntax scheme for it.
Every syntax structure (like identifier or field in your case), will be associated with its own lexer style, which means that you will be able to get style at the caret position and determine if it's identifier, field or something else.
Here are three examples of code:
field.sub = 4;
message.|Some other Sub field| = 5;
other.|something|[3].|else|[0].final = 6;
field, message and other are idents. sub and the things in pipes are what I call fields. The period is the fieldsep.
In a complete regex, I would write it as:
PS: I've got the styles set up, but all my syntax blocks are in the "normal" state. I don't know how to transition to a different state.
I have uploaded sample demo should cover your needs:
Please try it and let me know whether it was useful.