on 89fcbb2 help sign in
bat/assets/syntaxes/Robot.sublime-syntax
54 lines 2.0 kB history raw
1%YAML 1.2
2---
3# http://www.sublimetext.com/docs/3/syntax.html
4name: Robot Framework syntax highlighting.
5file_extensions:
6 - robot
7scope: source.robot
8contexts:
9 main:
10 - match: '\$\{(\d+|\d+\.\d*|0[bB][01]+|0[oO][0-7]+|0[xX][0-9a-fA-F]+)\}'
11 comment: "Robot Framework numbers, like ${1} or ${12.3}"
12 scope: constant.numeric.robot
13 - match: '(?i)(%\{[\w|\s]+\})'
14 comment: "Robot Framework environment variable, like %{USER}"
15 scope: variable.parameter.robot
16 - match: '((?<!\\)|(?<=\\\\))[$&]{'
17 comment: Robot Framework scalar and dictionary variables
18 push:
19 - meta_scope: entity.name.class
20 - match: '\}'
21 pop: true
22 - match: '((?<!\\)(@{)|(?<=\\\\)(@{))'
23 comment: Robot Framework list variables
24 push:
25 - meta_scope: entity.name.class
26 - match: '(}\[.+])|(})'
27 pop: true
28 - match: '(?i)^(\|\s*)?(\*{1,3} ?)(settings?|variables?|keywords?|test cases?)( ?\*{1,3})?(\s*\|)?'
29 comment: Robot Framework data tables
30 scope: string.robot.header
31 - match: '(?i)(^\|\s*)?\[?Documentation\]?\s+'
32 comment: Test case, keyword and settings table documentation
33 push:
34 - meta_scope: comment
35 - match: ^(?!\s*+\.\.\.)
36 pop: true
37 - match: '(^| {2,}|\t|\\| {1,})(?<!\\\\)#'
38 comment: Comment character
39 push:
40 - meta_scope: comment
41 - match: $
42 pop: true
43 - match: '(?i)\s+\[(Tags|Setup|Teardown|Template|Timeout|Arguments|Return)\]'
44 comment: Tests case and keyword settings
45 scope: storage.type
46 - match: (?i)^(\|\s*)?(Library|Resource|Test Timeout|Test Template|Test Teardown|Test Setup|Default Tags|Force Tags|Metadata|Variables|Suite Setup|Suite Teardown)(?:( )|( \| ))
47 comment: Settings table settings, like Library
48 scope: constant.language
49 - match: '^(\|\s+)?(?!^\.{3})(?![\|$&])\S+'
50 comment: Keywords and test cases
51 push:
52 - meta_scope: keyword.control.robot
53 - match: '($|\||\s{2,})'
54 pop: true