-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
source.agc.js
62 lines (60 loc) · 1.72 KB
/
source.agc.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
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is licensed `isc`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.agc'],
names: ['apollo-guidance-computer'],
patterns: [{include: '#main'}],
repository: {
comment: {
patterns: [
{
begin: '#',
beginCaptures: {0: {name: 'punctuation.definition.comment.agc'}},
end: '$',
name: 'comment.line.number-sign.agc',
patterns: [
{
match: 'TODO|FIXME|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG',
name: 'disable-todo'
}
]
},
{match: '^\\t[-+]\\d+(?=\\t)', name: 'comment.annotation.numeric.agc'}
]
},
identifier: {
match: '^(?!\\$)(?:[^#\\s]{1,7}\\t|[^#\\s]{8})',
name: 'entity.name.identifier.agc'
},
inclusion: {
begin: '^\\$',
beginCaptures: {0: {name: 'punctuation.definition.directive.agc'}},
end: '(?=\\s)',
name: 'meta.preprocessor.include.directive.agc'
},
main: {
patterns: [
{include: '#comment'},
{include: '#number'},
{include: '#inclusion'},
{include: '#identifier'},
{include: '#opcode'}
]
},
number: {match: '[-+]\\d+(?:\\.\\d+)?D?', name: 'constant.numeric.agc'},
opcode: {
begin: '(?<=\\t)([^#\\s]+)(?=\\s|$)',
beginCaptures: {1: {name: 'keyword.function.opcode.agc'}},
end: '$|(?=#)|[^#\\s]+',
endCaptures: {0: {name: 'variable.parameter.operand.agc'}},
name: 'meta.opcode.agc'
}
},
scopeName: 'source.agc'
}
export default grammar