Corrected a few expression parser changes that had adversely affected other debuggers (eg, PCx86)

This commit is contained in:
Jeff 2017-04-03 16:27:52 -07:00 committed by Jeff Parsons
commit 38f709bb7a
8 changed files with 78 additions and 76 deletions

View file

@ -1083,7 +1083,7 @@ class Debugger extends Component
/*
* A feature of MACRO-10 is that any single-digit number is automatically interpreted as base-10.
*/
value = Str.parseInt(sValue, sValue.length > 1? this.nBase : 10);
value = Str.parseInt(sValue, sValue.length > 1 || this.nBase > 10? this.nBase : 10);
}
}
if (value != null) {

View file

@ -148,10 +148,12 @@ class Str {
* a right shift of -(35 - n) is required.
*/
var v, shift = 0;
var match = s.match(/(-?[0-9]+)B([0-9]*)/);
if (match) {
s = match[1];
shift = 35 - ((match[2] || 35) & 0xff);
if (base <= 10) {
var match = s.match(/(-?[0-9]+)B([0-9]*)/);
if (match) {
s = match[1];
shift = 35 - ((match[2] || 35) & 0xff);
}
}
if (Str.isValidInt(s, base) && !isNaN(v = parseInt(s, base))) {
/*