-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
source.gdb.js
98 lines (96 loc) · 4.25 KB
/
source.gdb.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
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
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/quarnster/SublimeGDB>
// and licensed `zlib`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.gdb', '.gdbinit'],
names: ['gdb'],
patterns: [
{
captures: {1: {name: 'punctuation.definition.comment.gdb'}},
match: '^\\s*(#).*$\\n?',
name: 'comment.line.number-sign.gdb'
},
{
begin: '^\\s*(define)\\ +(.*)?',
beginCaptures: {
0: {name: 'meta.function'},
1: {name: 'keyword.other.gdb'},
2: {name: 'entity.name.function.gdb'}
},
end: '^(end)$',
endCaptures: {1: {name: 'keyword.other.gdb'}},
patterns: [{include: '$self'}]
},
{
begin: '^\\s*(document)\\ +(?:.*)?',
beginCaptures: {1: {name: 'keyword.other.gdb'}},
end: '^(end)$',
endCaptures: {1: {name: 'keyword.other.gdb'}},
patterns: [{match: '.', name: 'comment.block.documentation.gdb'}]
},
{
begin: '\\"',
beginCaptures: {0: {name: 'punctuation.definition.string.begin.gdb'}},
end: '\\"',
endCaptures: {0: {name: 'punctuation.definition.string.end'}},
name: 'string.quoted.double.gdb',
patterns: [{include: '#stringEscapedChar'}]
},
{
begin: "\\'",
beginCaptures: {0: {name: 'punctuation.definition.string.begin.gdb'}},
end: "\\'",
endCaptures: {0: {name: 'punctuation.definition.string.end'}},
name: 'string.quoted.single.gdb',
patterns: [{include: '#stringEscapedChar'}]
},
{
begin: '^\\s*(echo)',
beginCaptures: {1: {name: 'keyword.other.gdb'}},
end: '(?<!\\\\)\\n',
patterns: [
{include: '#stringEscapedChar'},
{match: '\\\\$', name: 'constant.character.escape.gdb'},
{match: '.', name: 'string.other.gdb'}
]
},
{match: '\\b(?:[0-9_]+|0x[0-9a-fA-F_]+)\\b', name: 'constant.numeric.gdb'},
{match: '\\$[@_a-zA-Z][@_a-zA-Z0-9]*', name: 'variable.other.gdb'},
{
match:
'\\b(?:address|architecture|args|breakpoints|catch|common|copying|dcache|display|files|float|frame|functions|handle|line|locals|program|registers|scope|set|sharedlibrary|signals|source|sources|stack|symbol|target|terminal|threads|syn|keyword|tracepoints|types|udot)\\b',
name: 'storage.type.gdb'
},
{
match:
'^\\s*(?:actions|apply|apropos|attach|awatch|backtrace|break|bt|call|catch|cd|clear|collect|commands|complete|condition|continue|delete|detach|directory|disable|disassemble|display|down|dump|else|enable|end|file|finish|frame|handle|hbreak|help|if|ignore|inspect|jump|kill|list|load|maintenance|make|next|n|nexti|ni|output|overlay|passcount|path|po|print|p|printf|ptype|pwd|quit|rbreak|remote|return|run|r|rwatch|search|section|set|sharedlibrary|shell|show|si|signal|source|step|s|stepi|stepping|stop|target|tbreak|tdump|tfind|thbreak|thread|tp|trace|tstart|tstatus|tstop|tty|undisplay|unset|until|up|watch|whatis|where|while|ws|x|add-shared-symbol-files|add-symbol-file|core-file|dont-repeat|down-silently|exec-file|forward-search|reverse-search|save-tracepoints|select-frame|symbol-file|up-silently|while-stepping)\\b',
name: 'keyword.other.gdb'
},
{
match:
'\\b(?:annotate|architecture|args|check|complaints|confirm|editing|endian|environment|gnutarget|height|history|language|listsize|print|prompt|radix|remotebaud|remotebreak|remotecache|remotedebug|remotedevice|remotelogbase|remotelogfile|remotetimeout|remotewritesize|targetdebug|variable|verbose|watchdog|width|write|auto-solib-add|solib-absolute-prefix|solib-search-path|stop-on-solib-events|symbol-reloading|input-radix|demangle-style|output-radix)\\b',
name: 'support.constant.gdb'
},
{match: '^\\s*info', name: 'constant.language.gdb'}
],
repository: {
stringEscapedChar: {
patterns: [
{
match:
'\\\\(?:\\\\|[abefnprtv\'"?]|[0-3]\\d{0,2}|[4-7]\\d?|x[a-fA-F0-9]{0,2}|u[a-fA-F0-9]{0,4}|U[a-fA-F0-9]{0,8})',
name: 'constant.character.escape.gdb'
},
{match: '\\\\.', name: 'invalid.illegal.gdb'}
]
}
},
scopeName: 'source.gdb'
}
export default grammar