diff --git a/Pluto.tmbundle/Syntaxes/Pluto.tmLanguage b/Pluto.tmbundle/Syntaxes/Pluto.tmLanguage index 201b630..691e3eb 100644 --- a/Pluto.tmbundle/Syntaxes/Pluto.tmLanguage +++ b/Pluto.tmbundle/Syntaxes/Pluto.tmLanguage @@ -725,6 +725,12 @@ name meta.classoperator.pluto + + match + \$(?:if|elseif|else|end)\b + name + keyword.control.pluto + match \b(?<![.:])(break|continue|do|else|for|if|elseif|goto|return|switch|pluto_switch|then|repeat|while|until|end|in|as|case|default|begin|pluto_use|pluto_try|pluto_catch|try|catch)\b diff --git a/test.js b/test.js index 2bcf9c2..b0ad9ed 100644 --- a/test.js +++ b/test.js @@ -313,6 +313,21 @@ async function main() ` ------ storage.type.primitive.pluto` ); + checkClassification( + `$if true then`, + `--- keyword.control.pluto`, + ` ---- constant.language.pluto`, + ` ---- keyword.control.pluto` + ); + checkClassification( + `$else`, + `----- keyword.control.pluto` + ); + checkClassification( + `$end`, + `---- keyword.control.pluto` + ); + const langConfig = JSON.parse( fs.readFileSync(path.join(__dirname, "language-config.json"), "utf8").replace(/\/\/.*$/gm, "") );