Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hanshasselberg/381921 to your computer and use it in GitHub Desktop.
Save hanshasselberg/381921 to your computer and use it in GitHub Desktop.
{ scopeName = 'assembler.otx';
fileTypes = ( 'otx' );
foldingStartMarker = '/\*\*|\{\s*$';
foldingStopMarker = '\*\*/|^\s*\}';
patterns = (
{ name = 'keyword.control.untitled';
match = '\b(if|while|for|return)\b';
},
{ name = 'support.numeric.offset.local';
match = '^\s*\+\d+';
},
{ name = 'constant.numeric.hex';
match = '\$0x[\d\w]+';
},
{ name = 'constant.numeric.hex';
match = '0x[\d\w]+';
},
{ name = 'constant.numeric.offset.global';
match = '000[\d\w]{5}';
},
{ name = 'keyword.control.assembler';
match = '\b((mov|push|sub|call|test|cmp|and|jmp|jne|je|jl|jg|add|inc|lea|shl|hlt|cmove|movzbl|pop|adcb|nop|leave|ret|ja|ucomis|xor|set)\w{0,2})\b';
},
{ name = 'entity.register';
match = '\%((ea|eb|ec|ed)x|[abcd][hl]|esi|edi|esp|ebp|)';
},
{ name = 'meta.function.otx';
match = '^(((\_|\w)+\:)|([\+\-]\(\w+\)\[(\w|\s|\:|\(|\))+\])|(\_(\w|\.|\_|\%|\<|\>)+\:))';
},
{ name = 'meta.verbatim.numeric.opcode';
match = '[abcdef0-9]{2,16}\s';
},
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment