on master help sign in
Add ARM assembly
commitd2d29180a716b0153c1cc4a113c4aad162374ebd authorsharkdp <davidpeter@web.de> dateFri 14 Dec 2018, 22:52 (8 years ago) parent2f263c9
3 files changed+176
.gitmodules+3 assets/syntaxes/Assembly (ARM)+1 assets/syntaxes/Assembly (ARM).sublime-syntax+172
.gitmodules+3
@@ -106,3 +106,6 @@
106106[submodule "assets/syntaxes/Assembly (x86_64)"]
107107 path = assets/syntaxes/Assembly (x86_64)
108108 url = https://github.com/13xforever/x86-assembly-textmate-bundle
109+[submodule "assets/syntaxes/Assembly (ARM)"]
110+ path = assets/syntaxes/Assembly (ARM)
111+ url = https://github.com/tvi/Sublime-ARM-Assembly
assets/syntaxes/Assembly (ARM)new file+1

Submodule changed.

assets/syntaxes/Assembly (ARM).sublime-syntaxnew file+172
@@ -0,0 +1,172 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: ARM Assembly
5+file_extensions:
6+ - s
7+ - S
8+scope: source.asm.arm
9+contexts:
10+ main:
11+ - match: "@.*$"
12+ scope: comment.line
13+ - match: //.*$
14+ scope: comment.line
15+ - match: ;.*$
16+ scope: comment.line
17+ - match: ^\s*\#\s*if\s+0\b
18+ push:
19+ - meta_scope: comment.preprocessor
20+ - match: ^\s*\#\s*endif\b
21+ pop: true
22+ - match: /\*
23+ push:
24+ - meta_scope: comment.block
25+ - match: \*/
26+ pop: true
27+ - match: |-
28+ (?x)
29+ ^\s*\#\s*(define)\s+ # define
30+ ((?<id>[a-zA-Z_][a-zA-Z0-9_]*)) # macro name
31+ (?: # and optionally:
32+ (\() # an open parenthesis
33+ (
34+ \s* \g<id> \s* # first argument
35+ ((,) \s* \g<id> \s*)* # additional arguments
36+ (?:\.\.\.)? # varargs ellipsis?
37+ )
38+ (\)) # a close parenthesis
39+ )?
40+ captures:
41+ 1: keyword.control.import.define.c
42+ 2: entity.name.function.preprocessor.c
43+ 4: punctuation.definition.parameters.c
44+ 5: variable.parameter.preprocessor.c
45+ 7: punctuation.separator.parameters.c
46+ 8: punctuation.definition.parameters.c
47+ push:
48+ - meta_scope: meta.preprocessor.macro.c
49+ - match: (?=(?://|/\*))|$
50+ pop: true
51+ - match: (?>\\\s*\n)
52+ scope: punctuation.separator.continuation.c
53+ - include: $top_level_main
54+ - match: ^\s*#\s*(error|warning)\b
55+ captures:
56+ 1: keyword.control.import.error.c
57+ push:
58+ - meta_scope: meta.preprocessor.diagnostic.c
59+ - match: $
60+ captures:
61+ 1: keyword.control.import.error.c
62+ pop: true
63+ - match: (?>\\\s*\n)
64+ scope: punctuation.separator.continuation.c
65+ - match: ^\s*#\s*(include|import)\b\s+
66+ captures:
67+ 1: keyword.control.import.include.c
68+ push:
69+ - meta_scope: meta.preprocessor.c.include
70+ - match: (?=(?://|/\*))|$
71+ captures:
72+ 1: keyword.control.import.include.c
73+ pop: true
74+ - match: (?>\\\s*\n)
75+ scope: punctuation.separator.continuation.c
76+ - match: '"'
77+ captures:
78+ 0: punctuation.definition.string.begin.c
79+ push:
80+ - meta_scope: string.quoted.double.include.c
81+ - match: '"'
82+ captures:
83+ 0: punctuation.definition.string.end.c
84+ pop: true
85+ - match: <
86+ captures:
87+ 0: punctuation.definition.string.begin.c
88+ push:
89+ - meta_scope: string.quoted.other.lt-gt.include.c
90+ - match: ">"
91+ captures:
92+ 0: punctuation.definition.string.end.c
93+ pop: true
94+ - match: '((?i)([xw][0-9]|[xw]1[0-9]||[xw]2[0-9]|[wx]30|wzr|xzr|wsp|fpsr|fpcr|[rcp]1[0-5]|[rcp][0-9]|a[1-4]|v[1-8]|sl|sb|fp|ip|sp|lr|(c|s)psr(_c)?|pc|[sd]3[0-1]|[sd][12][0-9]|[sd][0-9]|fpsid|fpscr|fpexc|q3[0-1]|q2[0-9]|q1[0-9]|q[0-9]|APSR_nzcv|sy)!?(?-i))?\b'
95+ scope: storage.other.register
96+ - match: \.(?i)(globl|global|macro|endm|purgem|if|elseif|else|endif|section|text|arm|align|balign|irp|rept|endr|req|unreq|error|short|func|endfunc|hidden|type|fpu|arch|code|altmacro|object_arch|word|int|string)(?-i)\b
97+ scope: keyword.control.directive
98+ - match: armv(2a?|3m?|4t?|5t?e?6(j|t2|zk?|-m)?|7v?e?(-(a|r|m))?|8-a(\+crc)?)
99+ scope: keyword.control.arch.arm
100+ - match: ^\s*#\s*(define|defined|elif|else|if|ifdef|ifndef|line|pragma|undef|endif)\b
101+ captures:
102+ 1: keyword.control.import.c
103+ push:
104+ - meta_scope: meta.preprocessor.c
105+ - match: (?=(?://|/\*))|$
106+ captures:
107+ 1: keyword.control.import.c
108+ pop: true
109+ - match: (?>\\\s*\n)
110+ scope: punctuation.separator.continuation.c
111+ - match: |-
112+ (?x)\b((?i)
113+ (
114+ (bf(c|i)|(u|s)bfx|(u|s)xta?(h|b)?) |
115+ (v(add|cvt|sub|mov|trn|cmp|div|qdmulh|mrs|mul|ld1|qadd|qshrun|st[1234]|addw|mull|mlal|rshrn|swp|qmovun)|qmovun)(\.([isup]?8|[isupf]?16|[isuf]?32|[isu]?64))* |
116+ (and|m(rs|sr)|eor|sub|rsb|add|adc|sbc|rsc|tst|teq|cmp|cmn|orr|mov|bic|mvn |
117+ (neg) |
118+ (lsr|lsl|ror|asr) # shift ops either pseudo ops or actual shifts
119+ )s? |
120+ (mul|mla|mull|smlabb) |
121+ (mov(w|t)) |
122+ rev(8|16)? |
123+ (pld|adr|adrl|vswp)
124+ )
125+ (ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))?\b
126+ scope: support.function.mnemonic.arithmetic
127+ - match: |-
128+ (?x)\b((?i)(
129+ swi|svc|wfi|
130+ dmb | clrex | dsb | isb |
131+ v(ldr|str|push|pop) |
132+ (push|pop) |
133+ (st|ld)(
134+ p |
135+ r(ex|s?(h|b)|d)? |
136+ m(
137+ (f|e)(d|a) |
138+ (d|i)(b|a)
139+ )?
140+ ) |
141+ b(l|x|lx|lr|r)? |
142+ (i|e)?ret|
143+ b\.(eq|ne|hs|cs|lo|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|nv)+ |
144+ (c|t)?bn?z|
145+ )+(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))\b
146+ scope: support.function.mnemonic.memory
147+ - match: '\b((?i)(def(b|w|s)|equ|(include|get)(\s+([a-zA-Z_]+[0-9a-zA-Z_]*|[0-9]+[a-zA-Z_]+[0-9a-zA-Z_]*?)\.s)?)?(?-i))\b'
148+ scope: meta.preprocessor.c.include
149+ - match: \b((?i)(align)(?-i))?\b
150+ scope: storage.type.c.memaccess
151+ - match: \s+\".+\"
152+ scope: string
153+ - match: \b((?i)nop(ne|eq|cs|hs|cc|lo|mi|pl|vs|vc|hi|ls|lt|le|gt|ge|al)?(?-i))?\b
154+ scope: comment.nop
155+ - match: '\s\['
156+ push:
157+ - meta_scope: storage.type.c.memaccess
158+ - match: '\]'
159+ pop: true
160+ - match: (?>\\\s*\n)
161+ scope: punctuation.separator.continuation.c
162+ - include: $top_level_main
163+ - match: (\b|\s+)\=\b
164+ scope: keyword.control.evaluation
165+ - match: '(\b|\s+)(\#)?-?(0x|&)[0-9a-fA-F_]+\b'
166+ scope: constant.numeric.hex
167+ - match: '(\b|\s+)\#-?[0-9a-zA-Z_]+\b'
168+ scope: constant.numeric.literal
169+ - match: '(\b|\s+)[0-9]+\b'
170+ scope: constant.numeric.dec
171+ - match: '\b([a-zA-Z_]+[0-9a-zA-Z_]*|[0-9]+[a-zA-Z_]+[0-9a-zA-Z_]*)\b'
172+ scope: meta.function.source.arm.label