-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathModelica.YAML-tmLanguage
100 lines (69 loc) · 2.52 KB
/
Modelica.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
# [PackageDev] target_format: plist, ext: tmLanguage
name: Modelica
scopeName: source.modelica
fileTypes: [mo]
uuid: 43df6fac-7928-42e2-9890-f5073aaddb14
patterns:
- name: comment.block
begin: /\*
end: \*/
- name: comment.line
match: (//).*$\n?
- name: constant.language
match: \b(true|false)\b
- name: constant.numeric
match: \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b
- name: storage.type
match: \b(Real|Integer|Boolean|String)\b
- name: storage.modifier
match: \b(constant|final|parameter|expandable|replaceable|redeclare|constrainedby|import|flow|stream|input|output|discrete|connector)\b
- name: keyword
match: \b\s*([A-Z])(?:([^ ;$]+)(;)?)([.]([A-Z])(?:([^ ;$]+)(;)?)?)++\b
- name: keyword.control
match: \b(for|if|when|while|then|loop|end if|end when|end for|end while|else|elsewhen|and|break|each|elseif)\b
- name: keyword.operator.logical
match: \b(and|or|not)\b
- name: keyword.operator.comparison
match: <|<\=|>|>\=|\=\=|<>
- name: keyword.operator.arithmetic
match: \+|\-|\.\+|\.\-|\*|\.\*|/|\./|\^
- name: keyword.operator.assignment
match: \=|\:\=
- name: keyword
match: \b(algorithm|equation|initial equation|protected|public|register|end)\b
- name: support.function.mathematical
match: \b(acos|asin|atan|atan2|cos|cosh|exp|log|log10|sin|sinh|tan|tanh|abs|sign|sqrt|max|min|product|sum)\b
- name: support.function.array
match: \b(scalar|vector|matrix|identity|diagonal|zeros|ones|fill|linspace|transpose|outerProduct|symmetric|cross|skew)\b
- name: support.function.event
match: \b(ceil|div|fill|floor|integer|max|min|mod|rem|pre|noEvent|change|edge|initial|terminal|reinit|sample|smooth|terminate)\b
- name: support.function.special
match: \b(connect|der|inStream|actualStream|semiLinear|spatialDistribution|getInstanceName|homotopy|delay|assert|ndims|size|cardinality|isPresent)\b
- name: support.type
match: \b(extends|partial|within)\b
- match: \b((model|class|record|block|package)\s+\w+\s*(".*")*)
captures:
'1': {name: entity.name.type}
'2': {name: keyword}
'3': {name: comment.line}
- match: ((function)\s+\w+\s*(".*")*)
captures:
'1': {name: entity.name.function}
'2': {name: keyword}
'3': {name: comment.line}
- name: comment.block
begin: annotation
end: ;\s*\n
patterns:
- name: comment.block
begin: '"'
end: '"'
- match: '["\w\)](\s+".*"\s*);'
captures:
'1': {name: constant.string}
- name: constant.string
begin: '"'
end: '"'
patterns:
- name: constant.character.escaped
match: '\\.'