I've written my SyntaxLanguage and parsers in C#, including a custom Token class, all modelled after the SimpleScript example. Instead of curly braces, our language uses keywords to denote blocks, similar to VB.
One example is PROC and ENDPROC. These are easy because PROC is always a PairedStart and ENDPROC is always a PairedEnd and they always match each other. However, we also have IF/ELIF/ELSE/ENDIF and CASE/BREAK/DEFAULT/FALLTHRU (with implied fallthrus meaning you don't need the keyword FALLTHRU). For example:Is there a way, in the above example, to get IF and ELIF paired together, say, when the caret is anywhere on IF or on the first half of ELIF? Then get ELIF and the bottom ENDIF paired if the caret is on the second half of ELIF or anywhere on ENDIF? Similar goes for the IF-ELSE-ENDIF block inside the ELIF block.
I've tried using the SemanticParseData to determine each token's MatchingTokenID but because a token's MatchingTokenID is context-sensitive, there's no way (I know of) that I can return the right value at the right time.
Thank you.
One example is PROC and ENDPROC. These are easy because PROC is always a PairedStart and ENDPROC is always a PairedEnd and they always match each other. However, we also have IF/ELIF/ELSE/ENDIF and CASE/BREAK/DEFAULT/FALLTHRU (with implied fallthrus meaning you don't need the keyword FALLTHRU). For example:
IF ( TRUE )
// block of code
ELIF ( FALSE )
IF ( FALSE )
// do something
ELSE
// do something else
ENDIF
ENDIF
I've tried using the SemanticParseData to determine each token's MatchingTokenID but because a token's MatchingTokenID is context-sensitive, there's no way (I know of) that I can return the right value at the right time.
Thank you.