Sublime Forum

Syntax color

#1

Hi,

I’m writing a new language syntax and having issue on changing colors. How do I manage changing colors according to the language functions I’ll using? Indeed every command have the same color may it be control flow, conditional or functional…
Is there a scopename keywords list? (source, keyword, keywords, support, string, punctuation…). I’m a bit lost here.

I had a look at this but still cloudy

Here a sample of my work :

[quote]{ “name”: “Essbase calc script”,
“scopeName”: “source.esscalcscript”,
“fileTypes”: “csc”],
“patterns”:

{ "match": "(?i:(fix|endfix|exclude|endexclude|loop|endloop))",
    "name": "keyword.commands.controlflow.csc",
    "comment": "control flow commands"
},

{ "match": "(?i:(if|endif|else|elseif))"
    "name": "keyword.commands.conditional.csc",
    "comment": "conditional commands"
},

{ "match": "(?i:(agg|calc all|calc average|calc dim|calc first|calc last|calc twopass|cconv|clearblock|clearcctrack|cleardata|datacopy|dataexport|dataexportcond|dataimportbin|set dataexportoptions|set dataimportignoretimestamp|set aggmissg|set cache|set cctrackcalc|set clearupdatestatus|set frmlbottomup|set frmlrtdynamic|set lockblock|set msg|set notice|set remotecalc|set updatecalc|set uptolocal))",
    "name": "keyword.commands.functional.csc",
    "comment": "functional commands"
}

],
“uuid”: “e87a28e6-94e5-49f2-8acd-caab0198e602”
}
[/quote]

Many thanks for your help!

0 Likes

#2

[quote=“sroux”]Hi,
How do I manage changing colors according to the language functions I’ll using? Indeed every command have the same color may it be control flow, conditional or functional…
Is there a scopename keywords list? (source, keyword, keywords, support, string, punctuation…).[/quote]

Have a look at: manual.macromates.com/en/language_grammars

The relevant part is:

That said, you can use whatever naming convention you like in your syntax file and create or edit a colour scheme to style said syntax as you like.

Hope this helps,
Alex

0 Likes

#3

I don’t know if ST-regex recognises (?i: for case-insensitivity - it might be worth checking. But you are not alternating case-sensitivity so you might just use the modifier **/i **instead.

0 Likes

#4

What does this have to do with anything?

0 Likes

#5

[quote=“nick.”]

What does this have to do with anything?[/quote]

spam

0 Likes