Fixed parsing of expressions with spaces
This commit is contained in:
parent
e3428dd36c
commit
b2a6a06908
11 changed files with 11503 additions and 13 deletions
|
|
@ -1704,9 +1704,9 @@ class DebuggerPDP10 extends Debugger {
|
|||
}
|
||||
/*
|
||||
* MACRO-10 also allows instructions to be assembled without an opcode (ie, just an address reference),
|
||||
* so we'll give that a try next.
|
||||
* so we'll give that a try next (as long as we're not mashing two symbols together).
|
||||
*/
|
||||
if (opCode < 0) {
|
||||
if (opCode < 0 && sOperands && !sOperands.match(/^[0-9A-Z$%.?]/i)) {
|
||||
sOperands = sOpcode + sOperands;
|
||||
sOpcode = "";
|
||||
opCode = 0;
|
||||
|
|
|
|||
|
|
@ -708,6 +708,11 @@ class Debugger extends Component
|
|||
aVals.push(this.truncate(v));
|
||||
if (!sOp) break;
|
||||
|
||||
if (sOp == ' ') {
|
||||
fError = true;
|
||||
break;
|
||||
}
|
||||
|
||||
this.assert(Debugger.aBinOpPrecedence[sOp] != null);
|
||||
if (aOps.length && Debugger.aBinOpPrecedence[sOp] < Debugger.aBinOpPrecedence[aOps[aOps.length - 1]]) {
|
||||
this.evalOps(aVals, aOps, 1);
|
||||
|
|
@ -865,8 +870,8 @@ class Debugger extends Component
|
|||
*
|
||||
* WARNING: Whenever you make changes to this RegExp, make sure you update aBinOpPrecedence as needed, too.
|
||||
*/
|
||||
var regExp = /(\{|}|\|\||&&|\||\^!|\^B|\^O|\^D|\^L|\^-|~|\^_|_|&|!=|!|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*)/;
|
||||
sExp = sExp.replace(/(^|[^A-Z0-9$%.])([0-9]+)B/, "$1$2^_");
|
||||
var regExp = /(\{|}|\|\||&&|\||\^!|\^B|\^O|\^D|\^L|\^-|~|\^_|_|&|!=|!|==|>=|>>>|>>|>|<=|<<|<|-|\+|%|\/|\*| )/;
|
||||
sExp = sExp.replace(/(^|[^A-Z0-9$%.])([0-9]+)B/, "$1$2^_").replace(/\s+/g, ' ');
|
||||
var asValues = sExp.split(regExp);
|
||||
value = this.parseArray(asValues, 0, asValues.length, this.nBase, fQuiet);
|
||||
if (value !== undefined && fQuiet === false) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue