-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathassembly.py
33 lines (29 loc) · 1.14 KB
/
assembly.py
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
from .plugin import *
import sublime
import sublime_plugin
import json
import os
import sys
if sys.version_info < (3, 3):
raise RuntimeError('NASM Syntax works with Sublime Text 3 only')
def plugin_loaded():
set_syntax_path(os.path.join(os.path.dirname(__file__), "Assembly x86.tmLanguage"))
json_data = open(os.path.join(os.path.dirname(__file__), 'instructions.json'), encoding='utf-8-sig')
data = json.load(json_data)
json_data.close()
for instruction in data:
if instruction['Name'] in instruction_set:
print(instruction['Name'])
instruction_set[instruction['Name']] = instruction
for alias in instruction["Alias"]:
instruction_set[alias] = instruction
print("Loaded instruction set")
json_data = open(os.path.join(os.path.dirname(__file__), 'support.json'), encoding='utf-8-sig')
data = json.load(json_data)
json_data.close()
for support in data:
support_set[support["Name"]] = support
if "Alias" in support:
for alias in support["Alias"]:
support_set[alias.format(support["Name"])] = support
print("Loaded support set")