This repository has been archived by the owner on Jul 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ada.sublime-syntax
75 lines (75 loc) · 2.81 KB
/
Ada.sublime-syntax
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
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Ada
comment: 'Ada Lanaguage sublime-syntax for use with bat. See: https://github.com/wiremoons/ada-sublime-syntax'
file_extensions:
- adb
- ads
- gpr
scope: source.ada
contexts:
main:
- include: comments
- include: strings
- include: labels
- match: \b(?i:(function|procedure))\b\s+(\w+(\.\w+)?|"(?:\+|-|=|\*|/)")
scope: meta.function.ada
captures:
1: keyword.other.ada
2: entity.name.function.ada
- match: \b(?i:(package)(?:\b\s+(body))?)\b\s+(\w+(\.\w+)*|"(?:\+|-|=|\*|/)")
scope: meta.function.ada
captures:
1: keyword.other.ada
2: keyword.other.ada
3: entity.other.attribute-name
- match: \b((?i:(end))\s*(\s+(?i:if|loop|record|case|select)\s*)(\w+)?);
scope: meta.function.ada
captures:
1: keyword.other.ada
4: entity.other.attribute-name
- match: \b(?i:(end))\b\s+(\w+(\.\w+)*|"(\+|-|=|\*|/)")\s?;
scope: meta.function.ada
captures:
1: keyword.other.ada
2: entity.other.attribute-name
- match: '(^|[\r\n])((?i:((limited[ \t]*)?(private[ \t]*)?with))[ \t]+(\w+(\.\w+)*);[ \t]*)+'
scope: meta.function.ada
captures:
1: keyword.control.import.ada
2: string.unquoted.import.ada
- match: \b(?i:(begin|end|package))\b
scope: keyword.control.ada
- match: \b(?i:(\=>|abort|abs|abstract|accept|access|aliased|all|and|array|at|body|case|constant|declare|delay|delta|digits|do|else|elsif|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor))\b
scope: keyword.other.ada
- match: '\b(?i:([0-9](_?[0-9])*((#[0-9a-f](_?[0-9a-f])*#((e(\+|-)?[0-9](_?[0-9])*\b)|\B))|((\.[0-9](_?[0-9])*)?(e(\+|-)?[0-9](_?[0-9])*)?\b))))'
scope: constant.numeric.ada
comments:
- match: (--).*$\n?
scope: comment.line.double-dash.ada
captures:
1: punctuation.definition.comment.ada
labels:
- match: "<<(.+)>>"
scope: keyword.operator.label.ada
captures:
1: entity.other.attribute-name
- match: '^\s*\b(\w+?)\s*:'
scope: keyword.operator.label.ada
captures:
1: entity.other.attribute-name
strings:
- match: "'.'"
scope: string.quoted.single.ada
- match: '"'
captures:
0: punctuation.definition.string.begin.ada
push:
- meta_scope: string.quoted.double.ada
- match: '"'
captures:
0: punctuation.definition.string.end.ada
pop: true
- match: \n
scope: invalid.illegal.lf-in-string.ada