Assemble kernel on the client #1
19
asm.js
19
asm.js
@@ -560,18 +560,15 @@ class Parser {
|
||||
this.state = State.TOP;
|
||||
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 = {
|
||||
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.state = State.TOP;
|
||||
return action;
|
||||
@@ -742,7 +739,9 @@ export class Assembler {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user