1. fix argc and argv parse faile issue

This commit is contained in:
xuhong 2024-08-07 17:42:17 +08:00
parent 09fb4bbbaa
commit f6022aff81
2 changed files with 7 additions and 2 deletions

View File

@ -139,6 +139,8 @@ export function expandValue(variableCreate: Function, value: string, root: strin
}
}
const eqPos = value.indexOf("=");
const eqPosNum = value.split("=").length - 1;
const newValPos1 = value.indexOf("{");
const newValPos2 = value.indexOf(",");
const newValPos3 = value.indexOf("}")
@ -147,8 +149,10 @@ export function expandValue(variableCreate: Function, value: string, root: strin
if (newValPos2 != -1 && newValPos2 < newValPos1){
newValPos = newValPos2;
}
logger.debug(`parseTupleOrList: newValPos:${newValPos}, newValPos2:${newValPos2}, eqPos:${eqPos}`)
if (newValPos != -1 && eqPos > newValPos || eqPos == -1 || eqPos > newValPos3) { // is value list
logger.debug(`xh:parseTupleOrList: value:${value}`);
logger.debug(`xh:parseTupleOrList: eqPosNum:${eqPosNum}, newValPos:${newValPos}, newValPos2:${newValPos2}, eqPos:${eqPos}`)
if (newValPos != -1 && eqPos > newValPos || eqPos == -1 || eqPos > newValPos3 && !value.endsWith(")")) { // is value list
const values = [];
stack.push("[0]");
let val = parseValue();

View File

@ -995,6 +995,7 @@ export class MI2 extends EventEmitter implements IBackend {
const key = MINode.valueOf(element, "name");
const value = MINode.valueOf(element, "value");
const type = MINode.valueOf(element, "type");
logger.debug(`xh:getStackVariables: name:${key}, value:${value}, type:${type}`);
ret.push({
name: key,
valueStr: value,