-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsoar.YAML-tmLanguage
118 lines (106 loc) · 3.86 KB
/
soar.YAML-tmLanguage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# [PackageDev] target_format: plist, ext: tmLanguage
name: Soar
scopeName: source.soar
fileTypes: [soar]
uuid: f4b14934-e34e-4a57-80b0-576e298cb1e7
patterns:
- comment: production container
name: keyword.operator.soar
begin: ([sg]p)\s+{([A-z0-9][A-z0-9*=$%?_/@:&><-]*)
beginCaptures:
'1': {name: support.function.soar}
'2': {name: variable.parameter.soar}
end: \}
patterns:
- include: '#production'
- comment: other braced containers, like smem --add {}
name: keyword.operator.soar
begin: \{
end: \}
patterns:
- include: '#production'
- comment: other functions
match: (add-wme|alias|allocate|capture-input|cd|chunk-name-format|cli|clog|command-to-file|default-wme-depth|dirs|echo-commands|echo|edit-production|epmem|excise|explain-backtraces|firing-counts|gds-print|gp-max|help|indifferent-selection|init-soar|internal-symbols|learn|load-library|ls|matches|max-chunks|max-dc-time|max-elaborations|max-goal-depth|max-memory-usage|max-nil-output-cycles|memories|multi-attributes|numeric-indifferent-mode|o-support-mode|pbreak|popd|port|predict|preferences|print|production-find|pushd|pwatch|pwd|rand|remove-wme|replay-input|rete-net|rl|run|save-backtraces|select|set-library-location|set-stop-phase|smem|soarnews|source|srand|stats|stop-soar|svs|timers|time|unalias|verbose|version|waitsnc|warnings|watch-wmes|watch|wma)\s+([^{]*)
captures:
'1': {name: support.function.soar}
'2': {name: variable.parameter.soar}
- comment: default aliases
match: (a|aw|chdir|ctf|set-default-depth|ex|eb|fc|gds_print|h|man|\?|inds|init|is|l|dir|pr|p|pc|wmes|varprint|topd|pw|step|d|e|rw|rn|sn|st|stop|ss|interrupt|un|w)\s+([^{]*)
captures:
'1': {name: support.function.soar}
'2': {name: variable.parameter.soar}
- include: source.soardoc
- include: '#comment'
repository:
production:
patterns:
- comment: docstring
name: string.quoted.double.soar
begin: '"'
end: '"'
patterns:
- include: '#escaped-character'
- comment: quoted strings
name: string.quoted.other.soar
begin: \|
end: \|
patterns:
- include: '#escaped-character'
- comment: standard and scientific floats
name: constant.numeric.soar
match: '[+-]?[0-9]\.[0-9]+[eE][-+]?[0-9]+[dDfF]?|[+-]?[0-9]*\.[0-9]*[dDfF]?'
- comment: integers
name: constant.numeric.soar
match: -?[0-9]+
- comment: flags
name: support.type.soar
match: :(?:o-support|i-support|chunk|default|interrupt|template)
- comment: arrow
name: keyword.operator.soar
match: -->
- comment: math ops
name: keyword.operator.soar
match: \+-\*/
- comment: variables
name: variable.parameter.soar
match: <[A-Za-z0-9$%&*+/:=?_<>-]+>
- comment: attributes
name: variable.other.soar
match: \^
- comment: all braces, prefs, and minus
name: keyword.control.soar
match: '[()<>.=&+|!~@-]'
- comment: curly braces nest conditions; need this to prevent from ending a production
begin: \{
end: \}
patterns:
- include: '#production'
- comment: condition type
name: keyword.operator.soar
match: state|impasse
- comment: nil
name: constant.language.soar
match: nil
- comment: non-quoted string
name: string.unquoted.soar
match: '[A-Za-z0-9$%&*+/:=?_><-]+'
- include: '#comment'
comment:
comment: end of line comment
name: comment.line.number-sign.soar
match: (;\s*)?\#.*$
escaped-character:
name: constant.character.escape.soar
match: \\.
int-constant:
name: constant.numeric.soar
match: -?[0-9]+
scientific-float-constant:
name: constant.numeric.soar
match: '[+-]?[0-9]\.[0-9]+[eE][-+]?[0-9]+[dDfF]?'
standard-float-constant:
comment: standard|scientific
name: constant.numeric.soar
match: '[-+]?[0-9]*\.[0-9]*[dDfF]?'
foldingStartMarker: \{
foldingStopMarker: \}