├── syntax_preview.png ├── license.md ├── readme.md └── Z80 Assembly └── z80.tmLanguage /syntax_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bananattack/rgbds_textmate/HEAD/syntax_preview.png -------------------------------------------------------------------------------- /license.md: -------------------------------------------------------------------------------- 1 | The files contained under the rgbds_textmate repository are hereby released into the public domain. 2 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | rgbds_textmate 2 | ============== 3 | 4 | Some syntax highlighting rules for coding in Z80 assembly as a Textmate language plugin. 5 | It should work in **Sublime Text 2**, or in other editors that support Textmate plugins. 6 | The syntax is particularly designed for [RGBDS](http://www.otakunozoku.com/rednex-gameboy-development-system/) and Gameboy-specific Z80 instructions. 7 | 8 | ![Preview of the syntax rules is here:](https://github.com/Bananattack/rgbds_textmate/raw/master/syntax_preview.png) 9 | 10 | To install for Sublime Text 2 on Windows, copy the **"Z80 Assembly"** folder to here: 11 | 12 | %APPDATA%\Roaming\Sublime Text 2\Packages 13 | 14 | Enjoy! 15 | 16 | The files included with this project are released under the public domain, so feel free to use/modify/whatever. 17 | 18 | -------------------------------------------------------------------------------- /Z80 Assembly/z80.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | z80 8 | 9 | name 10 | Z80 Assembly 11 | patterns 12 | 13 | 14 | match 15 | \s*;.*$ 16 | name 17 | comment.line 18 | 19 | 20 | match 21 | ^\s*(ld|ldi|ldd|ldh|push|pop|add|adc|sub|sbc|and|or|xor|cp|inc|dec|daa|cpl|rlca|rla|rrca|rra|rlc|rl|rrc|rr|sla|swap|sra|srl|bit|res|set|ccf|scf|nop|halt|stop|di|ei|jp|jr|call|ret|reti|rst)\b 22 | name 23 | keyword.other.mnemonic 24 | 25 | 26 | match 27 | \$[0-9a-fA-F]+ 28 | name 29 | constant.numeric.hex 30 | 31 | 32 | match 33 | \b(MACRO|ENDM|IF|ENDC|REPT|ENDR|DB|DW|DS|INCLUDE|INCBIN|SECTION|EQU)\b 34 | name 35 | keyword.control.directive 36 | 37 | 38 | match 39 | \b[0-9]+\b 40 | name 41 | constant.numeric 42 | 43 | 44 | match 45 | \b(a|b|c|d|e|h|af|bc|de|hl|sp)\b 46 | name 47 | support.class.z80 48 | 49 | 50 | captures 51 | 52 | 1 53 | 54 | name 55 | support.class.z80 56 | 57 | 2 58 | 59 | name 60 | keyword.operator.z80 61 | 62 | 63 | match 64 | ^\s*(\.?[a-zA-Z_][a-zA-Z_0-9\\@]*)\s*(\:)\s*$ 65 | name 66 | meta.label.z80 67 | 68 | 69 | captures 70 | 71 | 1 72 | 73 | name 74 | entity.name.tag.z80 75 | 76 | 77 | match 78 | ^\s*([a-zA-Z_][a-zA-Z_0-9\\@]*)\b 79 | name 80 | meta.command.z80 81 | 82 | 83 | captures 84 | 85 | 1 86 | 87 | name 88 | entity.name.function.z80 89 | 90 | 91 | match 92 | \b([a-zA-Z_][a-zA-Z_0-9\\@]*)\b 93 | name 94 | meta.identifier.z80 95 | 96 | 97 | match 98 | !|%|&|\*|\-|\+|~|/|\^|==|=|!=|<=|>=|<>|<|>|&&|\|\||\||\.? 99 | name 100 | keyword.operator.js 101 | 102 | 103 | match 104 | \{|\} 105 | name 106 | meta.brace.curly.js 107 | 108 | 109 | match 110 | \(|\) 111 | name 112 | meta.brace.round.js 113 | 114 | 115 | match 116 | \[|\] 117 | name 118 | meta.brace.square.js 119 | 120 | 121 | begin 122 | ' 123 | beginCaptures 124 | 125 | 0 126 | 127 | name 128 | punctuation.definition.string.begin.js 129 | 130 | 131 | end 132 | ' 133 | endCaptures 134 | 135 | 0 136 | 137 | name 138 | punctuation.definition.string.end.js 139 | 140 | 141 | name 142 | string.quoted.single.js 143 | patterns 144 | 145 | 146 | match 147 | \\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.) 148 | name 149 | constant.character.escape.js 150 | 151 | 152 | 153 | 154 | begin 155 | " 156 | beginCaptures 157 | 158 | 0 159 | 160 | name 161 | punctuation.definition.string.begin.js 162 | 163 | 164 | end 165 | " 166 | endCaptures 167 | 168 | 0 169 | 170 | name 171 | punctuation.definition.string.end.js 172 | 173 | 174 | name 175 | string.quoted.double.js 176 | patterns 177 | 178 | 179 | match 180 | \\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.) 181 | name 182 | constant.character.escape.js 183 | 184 | 185 | 186 | 187 | scopeName 188 | source.z80 189 | uuid 190 | 3A406674-FF3F-4495-BF50-C159AC0245B9 191 | 192 | 193 | --------------------------------------------------------------------------------