-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTIMCPU.sublime-syntax
85 lines (80 loc) · 3.22 KB
/
TIMCPU.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
%YAML 1.2
---
file_extensions:
- tc
- timcpu
scope: source.example-c
contexts:
prototype:
- include: comments
main:
- include: keywords
- include: marks
- include: cons
- include: binds
- include: commands
- include: test
- include: reti
- include: errors
keywords:
- match: '\b(CALL|JUMP)\b (\w+)'
scope: keyword.context.example-c
captures:
1: keyword.context.example-c markup.bold.example-c
2: string.other.example-c markup.italic.example-c
reti:
- match: '\b(RETI)\b'
scope: keyword.declaration.example-c
test:
- match: '\b(TEST) (\w+|-?[0-9.]+) (=|!=|<=|>=|<|>) (\w+|-?[0-9.]+) (\w+|\+?[0-9.]+)\b'
scope: keyword.context.example-c
captures:
1: keyword.context.example-c markup.bold.example-c
2: constant.numeric.example-c
3: keyword.operator.example-c
4: constant.numeric.example-c
5: string.other.example-c markup.italic.example-c
marks:
- match: '\b(MARK)\b (\w+)'
scope: keyword.context.example-c
captures:
1: keyword.control.example-c
2: string.other.example-c markup.underline.example-c markup.italic.example-c
cons:
- match: '(CONS) (\w+) (-?[0-9.]+)'
scope: keyword.context.example-c
captures:
1: keyword.context.example-c
2: string.example-c
3: constant.numeric.example-c
binds:
- match: '\b(BIND) (\w+) (REG(\d+)|INP(\d+)|OUT|\w+)'
scope: keyword.context.example-c
captures:
1: keyword.context.example-c
2: keyword.declaration.example-c
3: string.example-c
4: constant.numeric.example-c
5: constant.numeric.example-c
commands:
- match: '\b(SKIP|COPY|ADDI|SUBI|MULI|DIVI|DVRI|EXPI|ANDI|ORII|NOTI|XORI|SLEP|PUSH|POPI|STLN|GETI|SLEN|CUTS|CUTE|ADDS|SRVS|RAND|ABSI|ACOS|ASIN|ATAN|ATN2|CEIL|COSI|COSH|DEGI|EXPO|FLOR|FMOD|FRXP|HUGE|LDXP|LOGI|LG10|MAXI|MINI|MODF|PIII|POWI|RADI|SINI|SINH|SQRT|TANI|TANH|ROND|PRNT|SKIP|RSET|RGET) (-?[0-9.]+|\w+|REG\d+) ?(-?[0-9.]+|\w+|REG\d+)? ?(\-?[0-9.]+|\w+|REG\d+)?'
scope: keyword.context.example-c
captures:
1: keyword.context.example-c markup.bold.example-c
2: keyword.declaration.example-c
3: string.example-c
4: constant.numeric.example-c
- match: 'WAIT'
scope: keyword.context.example-c markup.bold.example-c
comments:
- match: 'COMM|NOPE'
scope: punctuation.definition.comment.example-c
push:
- meta_scope: comment.line.double-slash.example-c
- match: $\n?
pop: true
errors:
- match: '\b(SKIP|COPY|ADDI|SUBI|MULI|DIVI|DVRI|EXPI|ANDI|ORII|NOTI|XORI|SLEP|PUSH|POPI|STLN|GETI|SLEN|CUTS|CUTE|ADDS|SRVS|RAND|ABSI|ACOS|ASIN|ATAN|ATN2|CEIL|COSI|COSH|DEGI|EXPO|FLOR|FMOD|FRXP|HUGE|LDXP|LOGI|LG10|MAXI|MINI|MODF|PIII|POWI|RADI|SINI|SINH|SQRT|TANI|TANH|ROND|PRNT|SKIP|RSET|RGET) ?'
scope: markup.underline.example-c markup.raw.example-c markup.error.example-c keyword.context.example-c
- match: '\b(TEST) (\w+)? ?(=|!=|<=|>=|<|>)? ?(\w+)? ?(\w+|\+?[0-9.]+)?\b'
scope: markup.underline.example-c markup.raw.example-c markup.error.example-c keyword.context.example-c