mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-11-25 18:33:11 +00:00
This commit is contained in:
parent
eabcd5e8b0
commit
92f246edd0
@ -22,8 +22,8 @@ CodeMirror.defineMode('6502', function(_config, parserConfig) {
|
||||
'include','seg','dc','ds','dv','hex','err','org','rorg','echo','rend',
|
||||
'align','subroutine','equ','eqm','set','mac','endm','mexit','ifconst',
|
||||
'ifnconst','if','else','endif','eif','repeat','repend'];
|
||||
var directives = {};
|
||||
directives_list.forEach(function(s) { directives[s] = 'keyword'; });
|
||||
var directives = new Map();
|
||||
directives_list.forEach(function(s) { directives.set(s, 'keyword'); });
|
||||
|
||||
var opcodes = /^[a-z][a-z][a-z]\b/i;
|
||||
var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+d?)\b/i;
|
||||
@ -47,7 +47,7 @@ CodeMirror.defineMode('6502', function(_config, parserConfig) {
|
||||
if (stream.eatWhile(/\w/)) {
|
||||
w = stream.current();
|
||||
var cur = w.toLowerCase();
|
||||
var style = directives[cur];
|
||||
var style = directives.get(cur);
|
||||
if (style)
|
||||
return style;
|
||||
|
||||
|
@ -43,7 +43,7 @@ CodeMirror.defineMode('bataribasic', function(_config, parserConfig) {
|
||||
"cyclescore","cycles","legacy"
|
||||
];
|
||||
var directives = {};
|
||||
directives_list.forEach(function(s) { directives[s] = 'keyword'; });
|
||||
directives_list.forEach(function(s) { directives.set(s, 'keyword'); });
|
||||
|
||||
var numbers = /^([$][0-9a-f]+|[%][01]+|[0-9.]+)/i;
|
||||
|
||||
@ -70,7 +70,7 @@ CodeMirror.defineMode('bataribasic', function(_config, parserConfig) {
|
||||
if (stream.eatWhile(/[$%A-Z0-9]/i)) {
|
||||
w = stream.current();
|
||||
var cur = w.toLowerCase();
|
||||
var style = directives[cur];
|
||||
var style = directives.get(cur);
|
||||
if (cur == 'rem') {
|
||||
stream.eatWhile(/./);
|
||||
return 'comment';
|
||||
|
Loading…
Reference in New Issue
Block a user