-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFortran.YAML-tmLanguage
More file actions
102 lines (100 loc) · 3.62 KB
/
Fortran.YAML-tmLanguage
File metadata and controls
102 lines (100 loc) · 3.62 KB
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
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Fortran
scopeName: source.fortran
fileTypes: [f90,f95,F90,F95]
uuid: 70ebde89-7743-4e5a-96ce-8b0be2ca6025
patterns:
- name: comment.line.exclamation-mark.fortran
match: (?i)\!.*$
- match: (?i)\b(program|module|function|subroutine)\s+(\w+)
captures:
'1': {name: storage.type.function.fortran}
'2': {name: entity.name.function.fortran}
- match: (?i)^\s*(end)\s*(program|module|function|subroutine)(?:\s+(\w+))?
captures:
'1': {name: keyword.control.fortran}
'2': {name: storage.type.type.fortran}
'3': {name: comment.fortran}
- name: meta.interface.fortran
begin: (?i)\b(interface)\b
beginCaptures:
'1': {name: keyword.other.fortran}
end: (?i)^\s*(end)\s*(interface)
endCaptures:
'1': {name: keyword.control.fortran}
'2': {name: keyword.other.fortran}
patterns:
- match: (?i)^\s*(module\s+procedure)\s+(\w+)
captures:
'1': {name: storage.type.type.fortran}
'2': {name: support.function.fortran}
- match: (?i)\b(program|module|function|subroutine)\s+(\w+)
captures:
'1': {name: storage.type.function.fortran}
'2': {name: support.function.fortran}
- include: $self
- name: constant.numeric.float.fortran
match: (?i)\b\d+\.\d*([de][+-]?\d+)?\b
- name: constant.numeric.integer.fortran
match: (?i)\b([1-9][0-9]*|0)\b
- name: constant.language.fortran
match: (?i)\.(true|false)\.
- name: keyword.other.fortran
match: (?i)\b(use|only|contains|call|result)\b
- match: (?i)\b(len|kind)\s*\=
captures:
'1': {name: keyword.other.fortran}
- name: keyword.control.fortran
match: (?i)\b(if|then|else|endif|select|case|default|endselect|do|while|enddo|end|where)\b
- name: keyword.control.fortran
match: (?i)\b(|exit|cycle|return|stop|go\s+to|end|forall|endforall)\b
- name: keyword.operator.logical.fortran
match: (?i)\.(and|or|not)\.
- name: keyword.operator.comparison.fortran
match: (?i)\.(eq|gt|lt|ge|le|ne)\.
- name: keyword.operator.comparison.fortran
match: (?i)\=\=|>\=|<\=|>|<|/\=
- name: keyword.operator.arithmetic.fortran
match: (?i)\+|\-|\*|\*\*|/
- name: keyword.operator.other.fortran
match: (?i)\=|\=>|(\:)|(\:\:)|//|%
- name: string.quoted.double.fortran
match: (?i)\"([^"]*)\"
- name: string.quoted.single.fortran
match: (?i)\'([^']*)\'
- match: (?i)(?<=\()(in|out|inout)(?=\))
captures:
'1': {name: keyword.other.fortran}
- match: (?i)(&)\s*\n
captures:
'1': {name: keyword.other.fortran}
- match: (?i)^\s*(&)
captures:
'1': {name: keyword.other.fortran}
- name: support.function.fortran
match: (?i)\b(present|allocate|deallocate|write|size|nullify|open|close|inquire)(?=\s*\()
- name: support.function.fortran
match: (?i)\b(print)\b
- name: support.function.fortran
match: (?i)\b(selected_real_kind|allocated|shape)(?=\s*\()
- name: support.function.fortran
match: (?i)\b(sum|product|count|matmul|merge|ceiling|cmplx|real)(?=\s*\()
- name: support.function.fortran
match: (?i)\b(d?(sqrt|abs|erf|log|exp))(?=\s*\()
- name: support.function.fortran
match: (?i)\b(trim|adjustl|dot_product|all|any|reshape|transpose)(?=\s*\()
- name: storage.modifier.fortran
match: (?i)\b(implicit|none)\b
- name: storage.modifier.fortran
match: (?i)\b(private|public|parameter|optional|allocatable|dimension|pointer|target|intent)\b
- name: storage.modifier.fortran
match: (?i)\b(recursive|pure|elemental)\b
- name: storage.type.fortran
match: (?i)\b(integer|real|complex|logical|character|type|double precision)\b
- match: (?i)^\s*(end)\s*(type)
captures:
'1': {name: keyword.control.fortran}
'2': {name: storage.type.type.fortran}
- name: support.constant
match: \(|\)|,