-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathHexViewer.sublime-syntax
38 lines (38 loc) · 1.04 KB
/
HexViewer.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
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Hex Viewer
file_extensions: ['hxv']
scope: source.hex
contexts:
main:
- match: '^([a-fA-F\d]{8}\:)([\s]{2})'
captures:
1: keyword.address.hex
2: dump.buffer-start.hex
push:
- meta_scope: dump.hex
- match: '[\s]{2}(\:)'
captures:
0: dump.buffer-end.hex
1: keyword.ascii-start.hex
pop: true
- match: '[\da-fA-F]{1}'
captures:
0: raw.nibble.upper.hex
push:
- meta_scope: raw.byte.hex
- match: '[\da-fA-F]{1}'
captures:
0: raw.nibble.lower.hex
pop: true
- match: '[\w\W]'
scope: invalid.illegal.expected-nibble.hex
- match: '[\s]{1}'
scope: raw.punctuation.hex
- match: '[\w\W]{1}\s*'
scope: invalid.illegal.character.hex
- match: '^[\w\W]*$'
scope: invalid.malformed-line.hex
- match: '[\w\W]*$'
scope: comment.ascii.hex