mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-06-01 05:41:31 +00:00
try to get bbasic listings, fixed highlighting
This commit is contained in:
parent
eb01bdcea0
commit
a7b1fb4f57
|
@ -46,7 +46,7 @@ CodeMirror.defineMode('bataribasic', function(_config, parserConfig) {
|
|||
for (var s of directives_list)
|
||||
directives[s] = 'keyword';
|
||||
|
||||
var numbers = /^([$][0-9a-f]+|[%][01]+|[0-9.]+)\b/i;
|
||||
var numbers = /^([$][0-9a-f]+|[%][01]+|[0-9.]+)/i;
|
||||
|
||||
return {
|
||||
startState: function() {
|
||||
|
@ -68,7 +68,7 @@ CodeMirror.defineMode('bataribasic', function(_config, parserConfig) {
|
|||
return null;
|
||||
|
||||
var w;
|
||||
if (stream.eatWhile(/\w/)) {
|
||||
if (stream.eatWhile(/[$%A-Z0-9]/i)) {
|
||||
w = stream.current();
|
||||
var cur = w.toLowerCase();
|
||||
var style = directives[cur];
|
||||
|
@ -79,9 +79,8 @@ CodeMirror.defineMode('bataribasic', function(_config, parserConfig) {
|
|||
if (style)
|
||||
return style;
|
||||
|
||||
if (state.context == 4 && numbers.test(w)) {
|
||||
return 'number';
|
||||
} else if (stream.match(numbers)) {
|
||||
console.log(w, numbers.test(w));
|
||||
if (numbers.test(w)) {
|
||||
return 'number';
|
||||
} else {
|
||||
return null;
|
||||
|
|
|
@ -290,4 +290,3 @@ export class CodeProject {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -155,8 +155,8 @@ function refreshWindowList() {
|
|||
var lst = listings[lstfn];
|
||||
// TODO: add assembly listings? (lines, macrolines, sourcefile)
|
||||
if (lst.assemblyfile) {
|
||||
addWindowItem(lstfn, getFilenameForPath(lstfn), function(path) {
|
||||
return new Views.ListingView(lstfn);
|
||||
addWindowItem(lstfn, getFilenameForPath(lstfn), (path) => {
|
||||
return new Views.ListingView(path);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -702,4 +702,3 @@ export class MemoryView implements ProjectView {
|
|||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -693,6 +693,13 @@ function assembleDASM(step:BuildStep) {
|
|||
symbolmap[toks[0]] = parseInt(toks[1], 16);
|
||||
}
|
||||
}
|
||||
// for bataribasic (TODO)
|
||||
if (step['bblines']) {
|
||||
let lst = listings[lstpath];
|
||||
lst.asmlines = lst.lines;
|
||||
lst.text = alst;
|
||||
lst.lines = [];
|
||||
}
|
||||
return {
|
||||
output:aout.slice(2),
|
||||
listings:listings,
|
||||
|
@ -1587,7 +1594,8 @@ function compileBatariBasic(step:BuildStep) {
|
|||
nexttool:"dasm",
|
||||
path:destpath,
|
||||
args:[destpath],
|
||||
files:[destpath, "2600basic.h", "2600basic_variable_redefs.h"]
|
||||
files:[destpath, "2600basic.h", "2600basic_variable_redefs.h"],
|
||||
bblines:true,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1689,13 +1697,9 @@ function executeBuildSteps() {
|
|||
}
|
||||
// process with another tool?
|
||||
if (step.result.nexttool) {
|
||||
var asmstep = {
|
||||
tool:step.result.nexttool,
|
||||
platform:platform,
|
||||
files:step.result.files,
|
||||
path:step.result.path,
|
||||
args:step.result.args
|
||||
};
|
||||
var asmstep = step.result;
|
||||
asmstep.tool = step.result.nexttool;
|
||||
asmstep.platform = platform;
|
||||
buildsteps.push(asmstep); // TODO: unshift changes order
|
||||
step.generated = asmstep.files;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user