-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLinkerScript.sublime-syntax
87 lines (78 loc) · 2.05 KB
/
LinkerScript.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
76
77
78
79
80
81
82
83
84
85
86
87
%YAML 1.2
---
name: Linker Script
file_extensions: [ld]
scope: source.linker
variables:
num_suffix: '[KM]'
contexts:
main:
- include: comments
- include: oct_literals
- include: int_literals
- include: hex_literals
- include: control_keywords
- include: symbol_names # must be included before location_counter
- include: location_counter
comments:
- match: /\*
scope: punctuation.definition.comment.linker
push:
- meta_scope: comment.block.linker
- match: \*/
scope: punctuation.definition.comment.linker
pop: true
oct_literals:
- match: \b0[0-7]*{{num_suffix}}?\b
scope: constant.numeric.octal.linker
int_literals:
- match: \b[1-9][0-9]*{{num_suffix}}?\b
scope: constant.numeric.integer.linker
hex_literals:
- match: \b0[Xx][0-9A-Fa-f]+{{num_suffix}}?\b
scope: constant.numeric.hex.linker
control_keywords:
- match: '(?x)
\b(?:ABSOLUTE
|ADDR
|ALIGN
|AT
|BLOCK
|BYTE
|CREATE_OBJECT_SYMBOLS
|DEFINED
|ENTRY
|FILL
|KEEP
|LENGTH
|LONG
|MEMORY
|NEXT
|ORIGIN
|OUTPUT_FORMAT
|PROVIDE_HIDDEN
|QUAD
|SECTIONS
|SHORT
|SIZEOF
|SIZEOF_HEADERS)\b'
scope: keyword.control.linker
symbol_names:
- match: '(?x)
(?:
\b[A-Za-z_][A-Za-z_\.0-9\-]*
|
\B\.[A-Za-z_\.0-9\-]+
)'
scope: variable.other.linker
- match: '"'
push:
- meta_scope: variable.other.linker
- match: '"'
pop: true
- match: \n
scope: invalid.illegal.linker
pop: true
location_counter:
- match: \B\.\B
scope: variable.language.linker