-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathsource.c.linker.js
64 lines (62 loc) · 2.17 KB
/
source.c.linker.js
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
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/donno2048/Linker.tmLanguage>
// and licensed `mit`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.ld', '.lds', '.x'],
names: ['linker-script'],
patterns: [
{
match:
'\\b(?:S(?:E(?:ARCH_DIR|CTIONS)|IZEOF(?:_HEADERS)?|TARTUP)|IN(?:HIBIT_COMMON_ALLOCATION|CLUDE|PUT)|D(?:ATA_SEGMENT_(?:ALIGN|END)|EFINED)|O(?:UTPUT(?:_(?:FORMAT|ARCH))?|RIGIN)|C(?:REATE_OBJECT_SYMBOL|ONSTRUCTOR)S|(?:FORCE_COMMON_ALLOCATIO|HIDDE)N|E(?:X(?:CLUDE_FILE|TERN)|NTRY)|P(?:ROVIDE(?:_HIDDEN)?|HDRS)|A(?:BSOLUTE|SSERT|LIGN|DDR)|N(?:OCROSSREFS|EXT)|L(?:OADADDR|ENGTH)|M(?:EMORY|AX|IN)|sizeof_headers|l(?:en)?|o(?:rg)?|TARGET|BLOCK|GROUP)\\b',
name: 'support.function.ld'
},
{
captures: {
1: {name: 'storage.type.ld'},
2: {name: 'constant.numeric.ld'}
},
match: '(BYTE|SHORT|LONG|S?QUAD)\\s*\\(([^\\)]*)\\)'
},
{
captures: {
1: {name: 'variable.other.source.ld'},
2: {name: 'constant.other.section.ld'}
},
match: '((?=.*[^A-Z])[^\\s\\(;\\:\\{\\}]*)\\s*\\(([^\\),"]*)\\)'
},
{
captures: {
1: {name: 'constant.other.section.ld'},
2: {name: 'constant.numeric.address.ld'},
3: {name: 'keyword.other.at.ld'}
},
match:
'([^\\s\\(;\\:\\{\\}]*)(\\s+[^\\(\\s\\:\\}]+|\\s*\\([^\\)]*\\))?\\s*\\:\\s*(AT\\s*\\([^\\)]*\\))?'
},
{
captures: {
1: {name: 'constant.numeric.memory.ld'},
2: {name: 'keyword.other.at.ld'},
4: {name: 'constant.numeric.memory.ld'},
5: {name: 'constant.numeric.address.ld'}
},
match:
'\\}\\s*\\>\\s*([^\\s\\>\\:]*)\\s*(AT\\s*)?(?:\\>\\s*)?([^\\=\\>]*)?\\=\\s*([^\\s;\\}]*)'
},
{
captures: {
1: {name: 'constant.numeric.memory.ld'},
2: {name: 'support.constant.permissions.ld'}
},
match: '([^\\s\\(;\\{\\}]*)\\s*\\(\\s*([RrWwXx\\!]{,4})\\s*\\)'
}
],
scopeName: 'source.c.linker'
}
export default grammar