Posted 19 years ago
by Russell Mason
Hi
I want to use BracketHighlighting to match BEGIN and END statements (in SQL).
This is fine except:
BEGIN TRANSACTION X
IF (Somthing)
BEGIN
DoSomthing
END
...
In this situation when on the BEGIN of the BEGIN TRANSACTION it matches with the END of the IF statement.
I thought of doing this manually but then I have to do a load of work relating to nested matches (Ok, so this is not the most complex thing in the world, it just seems a shame to have to write it when you must be doing this already).
So,
1) Is there a way to 'intercept' Bracket Highlighting? I want to basically ignore bracket highlighting if the bracket highlighting start token is followed by a TRANSACTION token.
2) If not, given a token is it possible to find a matching token taking nested matches into account, without this being formally declared in the language definition? e.g. find the next END ignoring any BEGIN/ENDs in between.
Thanks
Russell Mason
I want to use BracketHighlighting to match BEGIN and END statements (in SQL).
This is fine except:
BEGIN TRANSACTION X
IF (Somthing)
BEGIN
DoSomthing
END
...
In this situation when on the BEGIN of the BEGIN TRANSACTION it matches with the END of the IF statement.
I thought of doing this manually but then I have to do a load of work relating to nested matches (Ok, so this is not the most complex thing in the world, it just seems a shame to have to write it when you must be doing this already).
So,
1) Is there a way to 'intercept' Bracket Highlighting? I want to basically ignore bracket highlighting if the bracket highlighting start token is followed by a TRANSACTION token.
2) If not, given a token is it possible to find a matching token taking nested matches into account, without this being formally declared in the language definition? e.g. find the next END ignoring any BEGIN/ENDs in between.
Thanks
Russell Mason