assembly-yasm-helper 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/.claude/settings.local.json +7 -0
  2. package/.vscodeignore +10 -0
  3. package/.vsixmanifest +44 -0
  4. package/LICENSE +21 -0
  5. package/Themes/tasmDark.tmTheme.json +134 -0
  6. package/Themes/tasmHC.tmTheme.json +136 -0
  7. package/Themes/tasmLight.tmTheme.json +137 -0
  8. package/bin/assembly-yasm-lsp.js +2 -0
  9. package/changelog.md +130 -0
  10. package/configs/language-configuration.json +49 -0
  11. package/icon.png +0 -0
  12. package/lsp/server.js +423 -0
  13. package/out/core/compilerEngine.js +77 -0
  14. package/out/core/completionEngine.js +259 -0
  15. package/out/core/diagnosticEngine.js +305 -0
  16. package/out/core/foldingEngine.js +55 -0
  17. package/out/core/hoverEngine.js +62 -0
  18. package/out/core/referencesEngine.js +39 -0
  19. package/out/core/semanticEngine.js +64 -0
  20. package/out/data/enums.js +35 -0
  21. package/out/data/instructionSignatures.js +422 -0
  22. package/out/data/keywords.js +359 -0
  23. package/out/data/operandTypes.js +10 -0
  24. package/out/data/structs.js +132 -0
  25. package/out/engine/memoryAddressParser.js +45 -0
  26. package/out/engine/memoryState.js +38 -0
  27. package/out/engine/memoryTokenizer.js +28 -0
  28. package/out/extension.js +146 -0
  29. package/out/instructionRegistry.js +27 -0
  30. package/out/providers/compilerProvider.js +77 -0
  31. package/out/providers/completionProvider.js +73 -0
  32. package/out/providers/definitionProvider.js +41 -0
  33. package/out/providers/diagnosticProvider.js +32 -0
  34. package/out/providers/foldingProvider.js +18 -0
  35. package/out/providers/hoverProvider.js +25 -0
  36. package/out/providers/referencesProvider.js +28 -0
  37. package/out/providers/renameProvider.js +70 -0
  38. package/out/providers/semanticTokensProvider.js +29 -0
  39. package/out/providers/signatureHelpProvider.js +125 -0
  40. package/out/providers/symbolProvider.js +66 -0
  41. package/out/registry.js +167 -0
  42. package/out/scanner.js +174 -0
  43. package/out/tokenizer.js +67 -0
  44. package/out/utils.js +89 -0
  45. package/out/vsc/fileData.js +21 -0
  46. package/package.json +241 -0
  47. package/readme.md +80 -0
  48. package/snippets.json +141 -0
  49. package/syntaxes/assembly.tmLanguage.json +315 -0
@@ -0,0 +1,315 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3
+ "name": "Assembly",
4
+ "scopeName": "source.asm",
5
+
6
+ "patterns": [
7
+ { "include": "#comments" },
8
+ { "include": "#preprocessor" },
9
+ { "include": "#strings" },
10
+ { "include": "#macro_params" },
11
+ { "include": "#labels" },
12
+ { "include": "#globals" },
13
+ { "include": "#call_targets" },
14
+ { "include": "#directives" },
15
+ { "include": "#sections" },
16
+ { "include": "#instructions" },
17
+ { "include": "#registers" },
18
+ { "include": "#numbers" },
19
+ { "include": "#punctuation" },
20
+ { "include": "#operators" },
21
+ { "include": "#variables" }
22
+ ],
23
+ "repository": {
24
+
25
+ "comments": {
26
+ "patterns": [
27
+ {
28
+ "name": "comment.line.asm",
29
+ "match": ";.*$"
30
+ },
31
+ {
32
+ "name": "comment.block.asm",
33
+ "begin": "/\\*",
34
+ "end": "\\*/"
35
+ }
36
+ ]
37
+ },
38
+
39
+ "preprocessor": {
40
+ "patterns": [
41
+ {
42
+ "comment": "%macro name N — color macro name as function",
43
+ "match": "(?i)^\\s*(%macro|%imacro)\\s+([A-Za-z_.$?][\\w.$?]*)",
44
+ "captures": {
45
+ "1": { "name": "keyword.control.preprocessor.asm" },
46
+ "2": { "name": "entity.name.function.asm" }
47
+ }
48
+ },
49
+ {
50
+ "comment": "%define NAME — color defined name as constant",
51
+ "match": "(?i)^\\s*(%define|%redefine|%xdefine|%idefine|%ixdefine|%assign|%undef)\\s+([A-Za-z_.$?][\\w.$?]*)",
52
+ "captures": {
53
+ "1": { "name": "keyword.control.preprocessor.asm" },
54
+ "2": { "name": "entity.name.constant.asm" }
55
+ }
56
+ },
57
+ {
58
+ "comment": "%include — color path as string",
59
+ "match": "(?i)^\\s*(%include)\\s+(\"[^\"]*\"|'[^']*')",
60
+ "captures": {
61
+ "1": { "name": "keyword.control.preprocessor.asm" },
62
+ "2": { "name": "string.quoted.asm" }
63
+ }
64
+ },
65
+ {
66
+ "comment": "all other preprocessor directives",
67
+ "name": "keyword.control.preprocessor.asm",
68
+ "match": "(?i)^\\s*(%endmacro|%unmacro|%if|%ifdef|%ifndef|%elif|%elifdef|%elifndef|%else|%endif|%rep|%endrep|%exitrep|%rotate|%local|%error|%warning|%use|%push|%pop|%repl|%line)\\b"
69
+ }
70
+ ]
71
+ },
72
+
73
+ "strings": {
74
+ "patterns": [
75
+ {
76
+ "name": "string.quoted.double.asm",
77
+ "begin": "\"",
78
+ "end": "\"|\\n",
79
+ "patterns": [
80
+ { "name": "constant.character.escape.asm", "match": "\\\\." }
81
+ ]
82
+ },
83
+ {
84
+ "name": "string.quoted.single.asm",
85
+ "begin": "'",
86
+ "end": "'|\\n",
87
+ "patterns": [
88
+ { "name": "constant.character.escape.asm", "match": "\\\\." }
89
+ ]
90
+ },
91
+ {
92
+ "name": "string.quoted.other.asm",
93
+ "begin": "`",
94
+ "end": "`|\\n",
95
+ "patterns": [
96
+ { "name": "constant.character.escape.asm", "match": "\\\\." }
97
+ ]
98
+ }
99
+ ]
100
+ },
101
+
102
+ "macro_params": {
103
+ "comment": "%1..%9 and %0 macro parameters inside macro body",
104
+ "patterns": [
105
+ {
106
+ "name": "variable.language.asm",
107
+ "match": "%[0-9]+"
108
+ }
109
+ ]
110
+ },
111
+
112
+ "labels": {
113
+ "patterns": [
114
+ {
115
+ "comment": "%%local_label: inside macros",
116
+ "match": "^\\s*(%%[A-Za-z_.$?][\\w.$?]*)\\s*:",
117
+ "captures": {
118
+ "1": { "name": "support.function.label.asm" }
119
+ }
120
+ },
121
+ {
122
+ "comment": "regular label:",
123
+ "match": "^\\s*([A-Za-z_.$?][\\w.$?]*)\\s*:",
124
+ "captures": {
125
+ "1": { "name": "support.function.label.asm" }
126
+ }
127
+ }
128
+ ]
129
+ },
130
+
131
+ "globals": {
132
+ "patterns": [
133
+ {
134
+ "match": "(?i)\\b(global|extern)\\s+([A-Za-z_.$?][\\w.$?]*)",
135
+ "captures": {
136
+ "1": { "name": "keyword.control.asm" },
137
+ "2": { "name": "entity.name.function.asm" }
138
+ }
139
+ },
140
+ {
141
+ "match": "(?i)^\\s*\\b(bits|default|cpu|org|absolute|use16|use32|use64)\\b",
142
+ "name": "keyword.control.asm"
143
+ }
144
+ ]
145
+ },
146
+
147
+ "call_targets": {
148
+ "patterns": [
149
+ {
150
+ "comment": "jump/call to %%local_label",
151
+ "match": "(?i)\\b(jmp|je|jne|jz|jnz|jg|jge|jl|jle|ja|jae|jb|jbe|jc|jnc|js|jns|jo|jno|jp|jnp|jcxz|jecxz|jrcxz|loop|loope|loopne|loopz|loopnz|call)\\s+(%%[A-Za-z_.$?][\\w.$?]*)",
152
+ "captures": {
153
+ "1": { "name": "keyword.control.asm" },
154
+ "2": { "name": "support.function.label.asm" }
155
+ }
156
+ },
157
+ {
158
+ "comment": "jump/call to regular label or procedure",
159
+ "match": "(?i)\\b(jmp|je|jne|jz|jnz|jg|jge|jl|jle|ja|jae|jb|jbe|jc|jnc|js|jns|jo|jno|jp|jnp|jcxz|jecxz|jrcxz|loop|loope|loopne|loopz|loopnz|call)\\s+([A-Za-z_.$?][\\w.$?]*)",
160
+ "captures": {
161
+ "1": { "name": "keyword.control.asm" },
162
+ "2": { "name": "entity.name.function.asm" }
163
+ }
164
+ }
165
+ ]
166
+ },
167
+
168
+ "directives": {
169
+ "patterns": [
170
+ {
171
+ "match": "(?i)\\b(db|dw|dd|dq|dt|resb|resw|resd|resq|equ|times|align)\\b",
172
+ "name": "storage.type.asm"
173
+ },
174
+ {
175
+ "match": "(?i)\\b(byte|word|dword|qword|tbyte|tword|oword|yword|zword|ptr|near|far|short|rel)\\b",
176
+ "name": "storage.modifier.asm"
177
+ }
178
+ ]
179
+ },
180
+
181
+ "sections": {
182
+ "patterns": [
183
+ {
184
+ "begin": "(?i)\\b(section|segment)\\b",
185
+ "beginCaptures": {
186
+ "1": { "name": "keyword.control.asm" }
187
+ },
188
+ "end": "$",
189
+ "patterns": [
190
+ {
191
+ "match": "\\.[A-Za-z_][A-Za-z0-9_]*",
192
+ "name": "entity.name.section.asm"
193
+ }
194
+ ]
195
+ }
196
+ ]
197
+ },
198
+
199
+ "instructions": {
200
+ "patterns": [
201
+ {
202
+ "name": "keyword.control.asm",
203
+ "match": "(?i)\\b(mov|movzx|movsx|movsxd|lea|push|pop|add|sub|mul|imul|div|idiv|inc|dec|and|or|xor|not|neg|test|cmp|xchg|xadd|cmpxchg|cmpxchg8b|cmpxchg16b|nop|hlt|int|int3|syscall|sysret|cpuid|rdtsc|rdtscp|lfence|mfence|sfence|pause|enter|leave|ret|retn|retf|iret|iretd|iretq|pushf|popf|pushfd|popfd|pushfq|popfq|lahf|sahf|clc|stc|cmc|cld|std|cli|sti|cbw|cwde|cdqe|cwd|cdq|cqo|bswap|bt|bts|btr|btc|bsr|bsf|popcnt|lzcnt|tzcnt|shr|shl|sar|sal|ror|rol|rcr|rcl|shld|shrd)\\b"
204
+ },
205
+ {
206
+ "name": "keyword.control.asm",
207
+ "match": "(?i)\\b(rep|repe|repne|repz|repnz|stosb|stosw|stosd|stosq|lodsb|lodsw|lodsd|lodsq|movsb|movsw|movsd|movsq|scasb|scasw|scasd|scasq|cmpsb|cmpsw|cmpsd|cmpsq)\\b"
208
+ },
209
+ {
210
+ "name": "keyword.control.asm",
211
+ "match": "(?i)\\b(jmp|je|jne|jz|jnz|jg|jge|jl|jle|ja|jae|jb|jbe|jc|jnc|js|jns|jo|jno|jp|jnp|jcxz|jecxz|jrcxz|loop|loope|loopne|loopz|loopnz|call)\\b"
212
+ },
213
+ {
214
+ "name": "keyword.control.asm",
215
+ "match": "(?i)\\b(cmova|cmovae|cmovb|cmovbe|cmovc|cmove|cmovg|cmovge|cmovl|cmovle|cmovnc|cmovne|cmovng|cmovnge|cmovnl|cmovnle|cmovno|cmovnp|cmovns|cmovnz|cmovo|cmovp|cmovs|cmovz)\\b"
216
+ },
217
+ {
218
+ "name": "keyword.control.asm",
219
+ "match": "(?i)\\b(seta|setae|setb|setbe|setc|sete|setg|setge|setl|setle|setnc|setne|setng|setnge|setnl|setnle|setno|setnp|setns|setnz|seto|setp|sets|setz)\\b"
220
+ },
221
+ {
222
+ "name": "keyword.control.asm",
223
+ "match": "(?i)\\b(fld|fst|fstp|fild|fist|fistp|fadd|faddp|fsub|fsubp|fsubr|fsubrp|fmul|fmulp|fdiv|fdivp|fdivr|fdivrp|fcom|fcomp|fcompp|fucom|fucomp|fabs|fchs|fsqrt|fxch|finit|fninit|fclex|fnclex|fldz|fld1|fldpi|fsin|fcos|fptan|fpatan)\\b"
224
+ }
225
+ ]
226
+ },
227
+
228
+ "registers": {
229
+ "patterns": [
230
+ {
231
+ "name": "variable.other.register.asm",
232
+ "match": "(?i)\\b(rax|rbx|rcx|rdx|rsi|rdi|rbp|rsp|rip|r8|r9|r10|r11|r12|r13|r14|r15)\\b"
233
+ },
234
+ {
235
+ "name": "variable.other.register.asm",
236
+ "match": "(?i)\\b(eax|ebx|ecx|edx|esi|edi|ebp|esp|eip)\\b"
237
+ },
238
+ {
239
+ "name": "variable.other.register.asm",
240
+ "match": "(?i)\\b(ax|bx|cx|dx|si|di|bp|sp)\\b"
241
+ },
242
+ {
243
+ "name": "variable.other.register.asm",
244
+ "match": "(?i)\\b(al|bl|cl|dl|ah|bh|ch|dh|sil|dil|bpl|spl)\\b"
245
+ },
246
+ {
247
+ "name": "variable.other.register.asm",
248
+ "match": "(?i)\\b(r8b|r9b|r10b|r11b|r12b|r13b|r14b|r15b|r8w|r9w|r10w|r11w|r12w|r13w|r14w|r15w|r8d|r9d|r10d|r11d|r12d|r13d|r14d|r15d)\\b"
249
+ },
250
+ {
251
+ "name": "variable.other.register.asm",
252
+ "match": "(?i)\\b(xmm([0-9]|1[0-5])|ymm([0-9]|1[0-5])|zmm([0-9]|[12][0-9]|3[01]))\\b"
253
+ },
254
+ {
255
+ "name": "variable.other.register.asm",
256
+ "match": "(?i)\\b(cs|ds|es|fs|gs|ss)\\b"
257
+ },
258
+ {
259
+ "name": "variable.other.register.asm",
260
+ "match": "(?i)\\b(cr[02348]|dr[0-367])\\b"
261
+ },
262
+ {
263
+ "name": "variable.other.register.asm",
264
+ "match": "(?i)\\b(eflags|rflags)\\b"
265
+ }
266
+ ]
267
+ },
268
+
269
+ "numbers": {
270
+ "patterns": [
271
+ {
272
+ "name": "constant.numeric.asm",
273
+ "match": "\\b0x[0-9A-Fa-f]+\\b"
274
+ },
275
+ {
276
+ "name": "constant.numeric.asm",
277
+ "match": "\\b[0-9][0-9A-Fa-f]*[hH]\\b"
278
+ },
279
+ {
280
+ "name": "constant.numeric.asm",
281
+ "match": "\\b[01]+[bB]\\b"
282
+ },
283
+ {
284
+ "name": "constant.numeric.asm",
285
+ "match": "\\b[0-9]+\\b"
286
+ }
287
+ ]
288
+ },
289
+
290
+ "punctuation": {
291
+ "patterns": [
292
+ {
293
+ "match": "[\\[\\]\\(\\)\\{\\}]",
294
+ "name": "punctuation.separator.asm"
295
+ },
296
+ {
297
+ "match": "[,:]",
298
+ "name": "punctuation.separator.asm"
299
+ }
300
+ ]
301
+ },
302
+
303
+ "operators": {
304
+ "match": "[+\\-*/<>|&^=~]",
305
+ "name": "keyword.operator.asm"
306
+ },
307
+
308
+ "variables": {
309
+ "match": "\\b[A-Za-z_.$?][\\w.$?]*\\b",
310
+ "name": "variable.name.asm"
311
+ }
312
+
313
+ }
314
+
315
+ }