├── LICENSE.txt ├── README.md ├── galen-tests.YAML-tmLanguage ├── galen-tests.tmLanguage ├── galen.YAML-tmLanguage ├── galen.tmLanguage └── galen.tmPreferences /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 David Rubio Vidal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Syntax Highlighter for Galen Framework v2+ 2 | 3 | Syntax highlighting for [Galen Framework version 2+][galen]. 4 | 5 | ## Installation 6 | 7 | ### Installation via Package Control 8 | 9 | 1. Search for *Galen v2+* in `Package Control: Install Package`. 10 | 2. Install the package. 11 | 12 | ### Manual installation 13 | 14 | 1. Download the [zip archive][zip]. 15 | 2. Go to `/Packages/`. 16 | 3. Create a folder called `Galen` and extract the content of the `zip` file into it. 17 | 4. You may need to restart Sublime Text 18 | 19 | ## Usage 20 | 21 | Highlighting is available for `.gspec` files, assuming no other syntax highlighting plugin is installed for that file extension. In the lower right corner of Sublime Text, there should be "Galen v2" option. 22 | 23 | You can set `Galen v2` syntax hightlighting for all `.gspec` files by going to `View > Syntax > Open all with current extension as... > Galen v2` when you have a `.gspec` file already open. 24 | 25 | ## Contributing 26 | 27 | 1. Fork the repository. 28 | 2. Create your feature branch: `git checkout -b my-new-feature`. 29 | 3. Commit your changes: `git commit -am 'Add some feature'`. 30 | 4. Push to the branch: `git push origin my-new-feature`. 31 | 5. Submit a pull request. 32 | 33 | ## License 34 | 35 | Code copyright 2016. Code released under [the MIT License][license]. 36 | 37 | [galen]: http://galenframework.com 38 | [repository]: https://github.com/davidrv87/syntax-sublime-galen2 39 | [zip]: https://github.com/davidrv87/syntax-sublime-galen2/archive/master.zip 40 | [license]: https://github.com/davidrv87/syntax-sublime-galen2/blob/master/LICENSE.txt 41 | -------------------------------------------------------------------------------- /galen-tests.YAML-tmLanguage: -------------------------------------------------------------------------------- 1 | # [PackageDev] target_format: plist, ext: tmLanguage 2 | name: Galen v2 test 3 | scopeName: text.galen-t 4 | fileTypes: [gtest,test] 5 | 6 | patterns: 7 | - include: '#core' 8 | 9 | repository: 10 | core: 11 | patterns: 12 | - include: '#rule' 13 | - include: '#table' 14 | - include: '#variable' 15 | - include: '#keyword' 16 | - include: '#comments' 17 | 18 | rule: 19 | patterns: 20 | - begin: (@@) 21 | beginCaptures: 22 | '1': {name: keyword.operator.galen-t} 23 | end: (?=(@)) 24 | patterns: 25 | - begin: (?i)(set)(\s*\S*)(\s*.*) 26 | beginCaptures: 27 | '1': {name: support.function.galen-t} 28 | '2': {name: entity.name.function.galen-t} 29 | '3': {name: string.quoted.triple} 30 | end: ^(?=(@|\$|\S)) 31 | patterns: 32 | - begin: ^(?=(\s+*))(\s*\S*)(\s*.*) 33 | beginCaptures: 34 | '2': {name: entity.name.function.galen-t} 35 | '3': {name: string.quoted.triple} 36 | end: ($) 37 | - begin: (?i)(parameterized using|groups|table)(\s*\S*)(\s*.*) 38 | beginCaptures: 39 | '1': {name: support.function.galen-t} 40 | '2': {name: entity.name.function.galen-t} 41 | '3': {name: string.quoted.triple} 42 | end: ($) 43 | - include: '#table' 44 | - include: '#variable' 45 | - include: '#keyword' 46 | - include: '#comments' 47 | - begin: (?i)(disabled) 48 | beginCaptures: 49 | '1': {name: support.function.galen-t} 50 | end: ^\s*$ 51 | patterns: 52 | - name: comment.line.number-sign.galen-t 53 | match: .* 54 | 55 | 56 | table: 57 | patterns: 58 | - begin: (\|) 59 | beginCaptures: 60 | '1': {name: support.function.galen-t} 61 | end: (\|)$ 62 | endCaptures: 63 | '1': {name: support.function.galen-t} 64 | patterns: 65 | - match: (\|) 66 | name: support.function.galen-t 67 | variable: 68 | patterns: 69 | - name: variable.parameter.galen-t 70 | match: (\$|\%)\{[-A-Za-z_]*\} 71 | keyword: 72 | patterns: 73 | - name: keyword.operator.galen-t 74 | match: ^\s*(?i)(wait|inject|check|selenium|jsfactory|open|resize|cookie|run|properties|dump) 75 | comments: 76 | patterns: 77 | - name: comment.line.number-sign-t 78 | match: ^\s*(#).* -------------------------------------------------------------------------------- /galen-tests.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | gtest 8 | test 9 | 10 | name 11 | Galen v2 test 12 | patterns 13 | 14 | 15 | include 16 | #core 17 | 18 | 19 | repository 20 | 21 | comments 22 | 23 | patterns 24 | 25 | 26 | match 27 | ^\s*(#).* 28 | name 29 | comment.line.number-sign-t 30 | 31 | 32 | 33 | core 34 | 35 | patterns 36 | 37 | 38 | include 39 | #rule 40 | 41 | 42 | include 43 | #table 44 | 45 | 46 | include 47 | #variable 48 | 49 | 50 | include 51 | #keyword 52 | 53 | 54 | include 55 | #comments 56 | 57 | 58 | 59 | keyword 60 | 61 | patterns 62 | 63 | 64 | match 65 | ^\s*(?i)(wait|inject|check|selenium|jsfactory|open|resize|cookie|run|properties|dump) 66 | name 67 | keyword.operator.galen-t 68 | 69 | 70 | 71 | rule 72 | 73 | patterns 74 | 75 | 76 | begin 77 | (@@) 78 | beginCaptures 79 | 80 | 1 81 | 82 | name 83 | keyword.operator.galen-t 84 | 85 | 86 | end 87 | (?=(@)) 88 | patterns 89 | 90 | 91 | begin 92 | (?i)(set)(\s*\S*)(\s*.*) 93 | beginCaptures 94 | 95 | 1 96 | 97 | name 98 | support.function.galen-t 99 | 100 | 2 101 | 102 | name 103 | entity.name.function.galen-t 104 | 105 | 3 106 | 107 | name 108 | string.quoted.triple 109 | 110 | 111 | end 112 | ^(?=(@|\$|\S)) 113 | patterns 114 | 115 | 116 | begin 117 | ^(?=(\s+*))(\s*\S*)(\s*.*) 118 | beginCaptures 119 | 120 | 2 121 | 122 | name 123 | entity.name.function.galen-t 124 | 125 | 3 126 | 127 | name 128 | string.quoted.triple 129 | 130 | 131 | end 132 | ($) 133 | 134 | 135 | 136 | 137 | begin 138 | (?i)(parameterized using|groups|table)(\s*\S*)(\s*.*) 139 | beginCaptures 140 | 141 | 1 142 | 143 | name 144 | support.function.galen-t 145 | 146 | 2 147 | 148 | name 149 | entity.name.function.galen-t 150 | 151 | 3 152 | 153 | name 154 | string.quoted.triple 155 | 156 | 157 | end 158 | ($) 159 | 160 | 161 | include 162 | #table 163 | 164 | 165 | include 166 | #variable 167 | 168 | 169 | include 170 | #keyword 171 | 172 | 173 | include 174 | #comments 175 | 176 | 177 | begin 178 | (?i)(disabled) 179 | beginCaptures 180 | 181 | 1 182 | 183 | name 184 | support.function.galen-t 185 | 186 | 187 | end 188 | ^\s*$ 189 | patterns 190 | 191 | 192 | match 193 | .* 194 | name 195 | comment.line.number-sign.galen-t 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | table 204 | 205 | patterns 206 | 207 | 208 | begin 209 | (\|) 210 | beginCaptures 211 | 212 | 1 213 | 214 | name 215 | support.function.galen-t 216 | 217 | 218 | end 219 | (\|)$ 220 | endCaptures 221 | 222 | 1 223 | 224 | name 225 | support.function.galen-t 226 | 227 | 228 | patterns 229 | 230 | 231 | match 232 | (\|) 233 | name 234 | support.function.galen-t 235 | 236 | 237 | 238 | 239 | 240 | variable 241 | 242 | patterns 243 | 244 | 245 | match 246 | (\$|\%)\{[-A-Za-z_]*\} 247 | name 248 | variable.parameter.galen-t 249 | 250 | 251 | 252 | 253 | scopeName 254 | text.galen-t 255 | 256 | 257 | -------------------------------------------------------------------------------- /galen.YAML-tmLanguage: -------------------------------------------------------------------------------- 1 | # [PackageDev] target_format: plist, ext: tmLanguage 2 | name: Galen v2 3 | scopeName: text.galen 4 | fileTypes: [gspec] 5 | uuid: a41f12d9-d823-4cb7-9869-508f9a191632 6 | 7 | patterns: 8 | - include: '#core' 9 | 10 | repository: 11 | core: 12 | patterns: 13 | - include: '#objects' 14 | - include: '#set' 15 | - include: '#groups' 16 | - include: '#punctuation' 17 | - include: '#comments' 18 | - include: '#section' 19 | - include: '#keyword' 20 | - include: '#group' 21 | - include: '#rule' 22 | - include: '#variable' 23 | - include: '#specs' 24 | - include: '#test' 25 | - include: '#objects' 26 | 27 | objects: 28 | patterns: 29 | - begin: (@objects) 30 | beginCaptures: 31 | '1': {name: keyword.operator.galen} 32 | end: (?=(@|=)) 33 | patterns: 34 | - include: '#comments' 35 | - match: (\s*\S*)(\s*.*)\n$ 36 | captures: 37 | '1': {name: variable.parameter.galen} 38 | '2': {name: string.quoted.triple} 39 | 40 | set: 41 | patterns: 42 | - begin: (@set) 43 | beginCaptures: 44 | '1': {name: keyword.operator.galen} 45 | end: (?=(@|=)) 46 | patterns: 47 | - include: '#comments' 48 | - match: (\s*\S*)(\s*.*)\n$ 49 | captures: 50 | '1': {name: variable.parameter.galen} 51 | '2': {name: string.quoted.triple} 52 | 53 | groups: 54 | patterns: 55 | - begin: (@groups)\n$ 56 | beginCaptures: 57 | '1': {name: keyword.operator.galen} 58 | end: (?=(@|=)) 59 | endCaptures: 60 | '1': {name: support.function.galen} 61 | patterns: 62 | - include: '#comments' 63 | - match: (\s*\S*)(\s*.*)\n$ 64 | captures: 65 | '1': {name: constant.language.galen} 66 | '2': {name: variable.parameter.galen} 67 | 68 | punctuation: 69 | patterns: 70 | - name: storage.type.galen 71 | match: \| 72 | - name: entity.name.function.galen 73 | match: (\[|\]) 74 | 75 | comments: 76 | patterns: 77 | - name: comment.line.number-sign.galen 78 | match: ^\s*#.* 79 | 80 | section: 81 | patterns: 82 | - name: support.function.galen 83 | match: ^\s*=\s.*\s=$ 84 | 85 | keyword: 86 | patterns: 87 | - name: keyword.operator.galen 88 | match: ^\s*(@import|@on|@script)\s(.*) 89 | captures: 90 | '1': {name: keyword.operator.galen} 91 | '2': {name: entity.name.function.galen} 92 | 93 | - name: keyword.operator.galen 94 | match: (@objects|@groups|@forEach|@for|@if|@elseif|@else|@die|(next)?\sas\s) 95 | 96 | group: 97 | patterns: 98 | - name: constant.language.galen 99 | match: \s*&[-A-Za-z_0-9]* 100 | 101 | rule: 102 | patterns: 103 | - name: entity.name.function.galen 104 | match: ^\s*@rule.* 105 | 106 | variable: 107 | patterns: 108 | - name: variable.parameter.galen 109 | match: (\$|\%)\{[-A-Za-z_]*\} 110 | 111 | test: 112 | patterns: 113 | - match: \s*([-A-Za-z_\., 0-9\*]*)(:)\n 114 | captures: 115 | '1': {name: variable.parameter.galen} 116 | '2': {name: entity.name.function.galen} 117 | 118 | specs: 119 | patterns: 120 | - name: string.quoted.triple 121 | captures: 122 | '1': {name: string.quoted.triple} 123 | match: (near|below|above|left-of|right-of|(contains|inside)( partly)?|on (top|bottom) (left|right)|^\s*(width) |^\s*(height) |text (is|contains|starts|ends|matches)|aligned (vertically|horizontally) (all|top|right|left|bottom)?|absent|visible|centered (horizontally|vertically|all) (inside|on)|component |color scheme) 124 | - begin: (css) 125 | beginCaptures: 126 | '1': {name: string.quoted.triple} 127 | end: (is|starts|ends|contains|matches) 128 | endCaptures: 129 | '1': {name: string.quoted.triple} 130 | - name: support.function.galen 131 | begin: (^\s*") 132 | end: (") 133 | -------------------------------------------------------------------------------- /galen.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | gspec 8 | 9 | name 10 | Galen v2 11 | patterns 12 | 13 | 14 | include 15 | #core 16 | 17 | 18 | repository 19 | 20 | comments 21 | 22 | patterns 23 | 24 | 25 | match 26 | ^\s*#.* 27 | name 28 | comment.line.number-sign.galen 29 | 30 | 31 | 32 | core 33 | 34 | patterns 35 | 36 | 37 | include 38 | #objects 39 | 40 | 41 | include 42 | #set 43 | 44 | 45 | include 46 | #groups 47 | 48 | 49 | include 50 | #punctuation 51 | 52 | 53 | include 54 | #comments 55 | 56 | 57 | include 58 | #section 59 | 60 | 61 | include 62 | #keyword 63 | 64 | 65 | include 66 | #group 67 | 68 | 69 | include 70 | #rule 71 | 72 | 73 | include 74 | #variable 75 | 76 | 77 | include 78 | #specs 79 | 80 | 81 | include 82 | #test 83 | 84 | 85 | include 86 | #objects 87 | 88 | 89 | 90 | group 91 | 92 | patterns 93 | 94 | 95 | match 96 | \s*&[-A-Za-z_0-9]* 97 | name 98 | constant.language.galen 99 | 100 | 101 | 102 | groups 103 | 104 | patterns 105 | 106 | 107 | begin 108 | (@groups)\n$ 109 | beginCaptures 110 | 111 | 1 112 | 113 | name 114 | keyword.operator.galen 115 | 116 | 117 | end 118 | (?=(@|=)) 119 | endCaptures 120 | 121 | 1 122 | 123 | name 124 | support.function.galen 125 | 126 | 127 | patterns 128 | 129 | 130 | include 131 | #comments 132 | 133 | 134 | captures 135 | 136 | 1 137 | 138 | name 139 | constant.language.galen 140 | 141 | 2 142 | 143 | name 144 | variable.parameter.galen 145 | 146 | 147 | match 148 | (\s*\S*)(\s*.*)\n$ 149 | 150 | 151 | 152 | 153 | 154 | keyword 155 | 156 | patterns 157 | 158 | 159 | captures 160 | 161 | 1 162 | 163 | name 164 | keyword.operator.galen 165 | 166 | 2 167 | 168 | name 169 | entity.name.function.galen 170 | 171 | 172 | match 173 | ^\s*(@import|@on|@script)\s(.*) 174 | name 175 | keyword.operator.galen 176 | 177 | 178 | match 179 | (@objects|@groups|@forEach|@for|@if|@elseif|@else|@die|(next)?\sas\s) 180 | name 181 | keyword.operator.galen 182 | 183 | 184 | 185 | objects 186 | 187 | patterns 188 | 189 | 190 | begin 191 | (@objects) 192 | beginCaptures 193 | 194 | 1 195 | 196 | name 197 | keyword.operator.galen 198 | 199 | 200 | end 201 | (?=(@|=)) 202 | patterns 203 | 204 | 205 | include 206 | #comments 207 | 208 | 209 | captures 210 | 211 | 1 212 | 213 | name 214 | variable.parameter.galen 215 | 216 | 2 217 | 218 | name 219 | string.quoted.triple 220 | 221 | 222 | match 223 | (\s*\S*)(\s*.*)\n$ 224 | 225 | 226 | 227 | 228 | 229 | punctuation 230 | 231 | patterns 232 | 233 | 234 | match 235 | \| 236 | name 237 | storage.type.galen 238 | 239 | 240 | match 241 | (\[|\]) 242 | name 243 | entity.name.function.galen 244 | 245 | 246 | 247 | rule 248 | 249 | patterns 250 | 251 | 252 | match 253 | ^\s*@rule.* 254 | name 255 | entity.name.function.galen 256 | 257 | 258 | 259 | section 260 | 261 | patterns 262 | 263 | 264 | match 265 | ^\s*=\s.*\s=$ 266 | name 267 | support.function.galen 268 | 269 | 270 | 271 | set 272 | 273 | patterns 274 | 275 | 276 | begin 277 | (@set) 278 | beginCaptures 279 | 280 | 1 281 | 282 | name 283 | keyword.operator.galen 284 | 285 | 286 | end 287 | (?=(@|=)) 288 | patterns 289 | 290 | 291 | include 292 | #comments 293 | 294 | 295 | captures 296 | 297 | 1 298 | 299 | name 300 | variable.parameter.galen 301 | 302 | 2 303 | 304 | name 305 | string.quoted.triple 306 | 307 | 308 | match 309 | (\s*\S*)(\s*.*)\n$ 310 | 311 | 312 | 313 | 314 | 315 | specs 316 | 317 | patterns 318 | 319 | 320 | captures 321 | 322 | 1 323 | 324 | name 325 | string.quoted.triple 326 | 327 | 328 | match 329 | (near|below|above|left-of|right-of|(contains|inside)( partly)?|on (top|bottom) (left|right)|^\s*(width) |^\s*(height) |text (is|contains|starts|ends|matches)|aligned (vertically|horizontally) (all|top|right|left|bottom)?|absent|visible|centered (horizontally|vertically|all) (inside|on)|component |color scheme) 330 | name 331 | string.quoted.triple 332 | 333 | 334 | begin 335 | (css) 336 | beginCaptures 337 | 338 | 1 339 | 340 | name 341 | string.quoted.triple 342 | 343 | 344 | end 345 | (is|starts|ends|contains|matches) 346 | endCaptures 347 | 348 | 1 349 | 350 | name 351 | string.quoted.triple 352 | 353 | 354 | 355 | 356 | begin 357 | (^\s*") 358 | end 359 | (") 360 | name 361 | support.function.galen 362 | 363 | 364 | 365 | test 366 | 367 | patterns 368 | 369 | 370 | captures 371 | 372 | 1 373 | 374 | name 375 | variable.parameter.galen 376 | 377 | 2 378 | 379 | name 380 | entity.name.function.galen 381 | 382 | 383 | match 384 | \s*([-A-Za-z_\., 0-9\*]*)(:)\n 385 | 386 | 387 | 388 | variable 389 | 390 | patterns 391 | 392 | 393 | match 394 | (\$|\%)\{[-A-Za-z_]*\} 395 | name 396 | variable.parameter.galen 397 | 398 | 399 | 400 | 401 | scopeName 402 | text.galen 403 | uuid 404 | a41f12d9-d823-4cb7-9869-508f9a191632 405 | 406 | 407 | -------------------------------------------------------------------------------- /galen.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Galen Metadata 7 | scope 8 | text.galen 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | # 18 | 19 | 20 | 21 | 22 | --------------------------------------------------------------------------------