Assemble kernel on the client #1

Merged
cdo merged 72 commits from client-side-assembler into main 2026-03-18 15:21:33 +00:00
Showing only changes of commit 9fb3910a16 - Show all commits

19
asm.js
View File

@@ -560,18 +560,15 @@ class Parser {
this.state = State.TOP; this.state = State.TOP;
return; return;
} }
const value = this.integer(token);
if (value == null) {
console.error(
`ERROR: Unexpected token ${token}, expected value`);
this.def_name = undefined;
this.state = State.TOP;
return;
}
const action = { const action = {
type: Action.DEF, type: Action.DEF,
def: { name: this.def_name, value }, def: { name: this.def_name },
}; };
const value = this.integer(token);
if (value != null)
action.def.value = value;
else
action.def.symbol = token;
this.def_name = undefined; this.def_name = undefined;
this.state = State.TOP; this.state = State.TOP;
return action; return action;
@@ -742,7 +739,9 @@ export class Assembler {
} }
action_def(action) { action_def(action) {
this.defs[action.def.name] = action.def.value; const value = action.def.value
?? this.lookup_def(action.def.symbol);
this.defs[action.def.name] = value;
} }
action_label(action) { action_label(action) {