!3 解决堆栈信息中变量名和变量尾多>符号问题

Merge pull request !3 from 黑熊怪/rab
This commit is contained in:
黑熊怪 2024-06-27 08:09:21 +00:00 committed by Gitee
commit 6c921a0e9f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 7 additions and 1 deletions

View File

@ -12,6 +12,7 @@ const charRegex = /^(\d+) ['"]/;
const numberRegex = /^(-)?\d+(\.\d+)?(e-\d+)?/; const numberRegex = /^(-)?\d+(\.\d+)?(e-\d+)?/;
const pointerCombineChar = "."; const pointerCombineChar = ".";
const nullTupleRegex = /^(0x[0-9a-fA-F]+)}/; const nullTupleRegex = /^(0x[0-9a-fA-F]+)}/;
const logger = require('./log');
export function isExpandable(value: string): number { export function isExpandable(value: string): number {
let match; let match;
@ -146,6 +147,11 @@ export function expandValue(variableCreate: Function, value: string, root: strin
stack.push("[0]"); stack.push("[0]");
let val = parseValue(); let val = parseValue();
stack.pop(); stack.pop();
if(val.endsWith('>')){
val = val.substring(0, val.length-2);
}
values.push(createValue("[0]", val)); values.push(createValue("[0]", val));
const remaining = value; const remaining = value;
let i = 0; let i = 0;
@ -272,7 +278,7 @@ export function expandValue(variableCreate: Function, value: string, root: strin
} }
value = value.substring(variableMatch[0].length).trim(); value = value.substring(variableMatch[0].length).trim();
var name = variable = variableMatch[1]; var name = variable = variableMatch[1].trim();
if (name.charAt(name.length - 1) === ">") { if (name.charAt(name.length - 1) === ">") {
name = name.slice(0, -1); name = name.slice(0, -1);
} }