From 13f4401259e3716b237f72f53199e38b8d6b2c5a Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Sun, 28 Jul 2013 22:28:39 -0400 Subject: [PATCH] nasm improvements --HG-- branch : pmacs2 --- mode/nasm.py | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/mode/nasm.py b/mode/nasm.py index c4c4f4d..34bbf5a 100644 --- a/mode/nasm.py +++ b/mode/nasm.py @@ -51,20 +51,52 @@ class NasmDisassembleFile(Method): w.application.data_buffer(bufname, output, switch_to=True, modename=modename) +# white is for delimiters, operators, numbers +default = ('default', 'default') + +# magenta is for keywords/builtins +lo_magenta = ('magenta202', 'default') +hi_magenta = ('magenta414', 'default') + +# red is for comments +lo_red = ('red300', 'default') +hi_red = ('red511', 'default') + +# orange is for macro definitions, headers and constants +hi_orange = ('yellow531', 'default') +lo_orange = ('yellow520', 'default') + +# yellow is for parts of macros +hi_yellow = ('yellow551', 'default') +lo_yellow = ('yellow330', 'default') + +# green is for strings and characters +lo_green = ('green030', 'default') +hi_green = ('green050', 'default') + +# cyan is for types +lo_cyan = ('cyan033', 'default') +hi_cyan = ('cyan155', 'default') + +# blue is definitions, functions and some macros +lo_blue = ('blue113', 'default') +hi_blue = ('blue225', 'default') + class Nasm(Fundamental): name = 'nasm' extensions = ['.s'] grammar = NasmGrammar commentc = ';' colors = { - 'nasm.address': ('cyan', 'default'), - 'nasm.pseudo': ('cyan', 'default'), - 'nasm.keyword': ('cyan', 'default'), - 'nasm.macro': ('blue', 'default'), - 'nasm.register': ('yellow', 'default'), - 'nasm.instruction': ('magenta', 'default'), - 'nasm.label': ('blue', 'default'), - 'nasm.integer': ('green', 'default'), + 'nasm.address': hi_cyan, + 'nasm.pseudo': hi_cyan, + 'nasm.keyword': hi_cyan, + 'nasm.macro': hi_blue, + 'nasm.register': hi_yellow, + 'nasm.instruction': hi_magenta, + 'nasm.label': hi_blue, + 'nasm.integer': hi_green, + 'nasm.identifier': hi_orange, } _bindings = { 'close-paren': (')',),