Skip to content

Commit 7775163

Browse files
committed
fix: add release permissions, improve syntax colour spread
- Fix GitHub Actions 403 by adding contents:write permission - Remap scopes for Ayu Dark colour variety: sensors (purple), regions (pink), events (gold), modifiers (cyan), verbs (green)
1 parent 126550d commit 7775163

3 files changed

Lines changed: 101 additions & 15 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches: [main]
66

7+
permissions:
8+
contents: write
9+
710
jobs:
811
release:
912
runs-on: ubuntu-latest

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "quale-lang",
33
"displayName": "Quale",
44
"description": "Syntax highlighting and snippets for the Quale neuroevolution language",
5-
"version": "0.2.1",
5+
"version": "0.2.2",
66
"publisher": "Provant",
77
"license": "MIT",
88
"repository": {

syntaxes/quale.tmLanguage.json

Lines changed: 97 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@
55
"patterns": [
66
{ "include": "#comments" },
77
{ "include": "#constructs" },
8-
{ "include": "#keywords" },
9-
{ "include": "#types" },
8+
{ "include": "#io" },
9+
{ "include": "#brain" },
10+
{ "include": "#events" },
11+
{ "include": "#control" },
12+
{ "include": "#modifiers" },
13+
{ "include": "#builtins" },
1014
{ "include": "#verbs" },
15+
{ "include": "#types" },
16+
{ "include": "#config" },
1117
{ "include": "#strings" },
1218
{ "include": "#numbers" },
1319
{ "include": "#operators" },
@@ -38,43 +44,105 @@
3844
"constructs": {
3945
"patterns": [
4046
{
41-
"match": "\\b(body|item|world|fitness|evolve|dynamics|perception|action|machine)\\s+([A-Za-z_][A-Za-z0-9_]*)",
47+
"match": "\\b(body|world|fitness|evolve|dynamics|perception|action|machine)\\s+([A-Za-z_][A-Za-z0-9_]*)",
4248
"captures": {
43-
"1": { "name": "storage.type.quale" },
44-
"2": { "name": "entity.name.type.quale" }
49+
"1": { "name": "keyword.control.quale" },
50+
"2": { "name": "entity.name.quale" }
4551
}
4652
}
4753
]
4854
},
49-
"keywords": {
55+
"io": {
56+
"comment": "Sensors and actuators - purple (variable.parameter)",
57+
"patterns": [
58+
{
59+
"name": "variable.parameter.quale",
60+
"match": "\\b(sensor|actuator)\\b"
61+
}
62+
]
63+
},
64+
"brain": {
65+
"comment": "Brain architecture - red/pink (support.function)",
66+
"patterns": [
67+
{
68+
"name": "support.function.quale",
69+
"match": "\\b(region|plasticity|hebbian|decay|homeostatic)\\b"
70+
}
71+
]
72+
},
73+
"events": {
74+
"comment": "Entity interactions and events - gold (entity.name.function)",
75+
"patterns": [
76+
{
77+
"name": "entity.name.function.quale",
78+
"match": "\\b(on_cross|on_enter|on_pass|on_exit|on_consume|record|consume|entity|spawn)\\b"
79+
}
80+
]
81+
},
82+
"control": {
83+
"comment": "Control flow - orange (keyword)",
5084
"patterns": [
5185
{
5286
"name": "keyword.control.quale",
53-
"match": "\\b(sensor|actuator|properties|on_consume|spawn|region|plasticity|hebbian|decay|homeostatic|hidden|per_tick|rules|death|clamp|state|scope|initial|transition|on_cross|on_enter|on_pass|on_exit|let|when|else|match|for|in|record|gate|metric|aggregate|transform|consume|query|import|include|topology)\\b"
87+
"match": "\\b(when|else|match|for|in|let|if|transition|import|include)\\b"
88+
}
89+
]
90+
},
91+
"modifiers": {
92+
"comment": "Declarative modifiers - cyan (support.type)",
93+
"patterns": [
94+
{
95+
"name": "support.type.quale",
96+
"match": "\\b(scope|initial|state|hidden|properties|topology|query)\\b"
97+
}
98+
]
99+
},
100+
"builtins": {
101+
"comment": "Built-in functions - red/pink (support.function)",
102+
"patterns": [
103+
{
104+
"name": "support.function.quale",
105+
"match": "\\b(min|max|clamp|abs|sqrt|nearest_ahead|speed_zone_at|nearest|at|winner_take_all|grid_move|neighbors|connected|shortest_path)\\b"
106+
}
107+
]
108+
},
109+
"verbs": {
110+
"comment": "Fitness verbs - green (entity.name.import)",
111+
"patterns": [
112+
{
113+
"name": "entity.name.import.quale",
114+
"match": "\\b(maximize|reward|penalize)\\b"
54115
},
55116
{
56-
"name": "keyword.other.quale",
57-
"match": "\\b(category|size|walls|item_respawn|population|generations|scenarios|ticks|seed|every|keep|plateau|threshold|stagnation|target_species|range|directions|weight_shift|bias_shift|add_connection|remove_connection|add_node|remove_node|rewire|change_activation|mutation|speciation|convergence|checkpoint|seed_from|agents|nodes|density|activation|recurrent|rate|max_weight|min_weight|target_activity|adjustment_rate)\\b"
117+
"comment": "Fitness structure - cyan (support.type)",
118+
"name": "support.type.quale",
119+
"match": "\\b(gate|metric|aggregate|transform)\\b"
58120
}
59121
]
60122
},
61123
"types": {
124+
"comment": "Sensor/actuator types - cyan (support.type)",
62125
"patterns": [
63126
{
64127
"name": "support.type.quale",
65128
"match": "\\b(internal|directional|item_property|social|trigger)\\b"
66129
},
67130
{
68131
"name": "constant.language.quale",
69-
"match": "\\b(border|true|false)\\b"
132+
"match": "\\b(border|true|false|none)\\b"
70133
}
71134
]
72135
},
73-
"verbs": {
136+
"config": {
137+
"comment": "Config keys - light orange (keyword.operator) and default",
74138
"patterns": [
75139
{
76-
"name": "keyword.operator.verb.quale",
77-
"match": "\\b(maximize|reward|penalize)\\b"
140+
"name": "keyword.operator.quale",
141+
"match": "\\b(population|generations|scenarios|ticks|seed|agents|every|keep|mutation|speciation|convergence|checkpoint|seed_from)\\b"
142+
},
143+
{
144+
"name": "variable.other.property.quale",
145+
"match": "\\b(category|size|walls|item_respawn|range|directions|weight_shift|bias_shift|add_connection|remove_connection|add_node|remove_node|rewire|change_activation|nodes|density|activation|recurrent|rate|max_weight|min_weight|target_activity|adjustment_rate|length|max_speed|tick|respawn|plateau|threshold|stagnation|target_species|per_tick|rules|death|clamp)\\b"
78146
}
79147
]
80148
},
@@ -130,6 +198,14 @@
130198
{
131199
"name": "keyword.operator.logical.quale",
132200
"match": "\\b(and|or|not)\\b"
201+
},
202+
{
203+
"name": "keyword.operator.arrow.quale",
204+
"match": "->"
205+
},
206+
{
207+
"name": "keyword.operator.ternary.quale",
208+
"match": "\\?"
133209
}
134210
]
135211
},
@@ -141,10 +217,17 @@
141217
"1": { "name": "variable.parameter.quale" }
142218
}
143219
},
220+
{
221+
"comment": "Namespace prefixes - cyan italic (variable.language)",
222+
"match": "\\b(agent|world|actuator|engine|evolve)\\.",
223+
"captures": {
224+
"1": { "name": "variable.language.quale" }
225+
}
226+
},
144227
{
145228
"match": "(?<=\\[|,\\s*)([A-Z][A-Za-z0-9_]*)",
146229
"captures": {
147-
"1": { "name": "variable.other.quale" }
230+
"1": { "name": "entity.name.quale" }
148231
}
149232
}
150233
]

0 commit comments

Comments
 (0)