CodeMirror tokenizer keeps ">" as a separate token. So you don't need to check this at all and you also need to remove the else block.