fix check variadic input/output

This commit is contained in:
codetypes committed 2025-03-17 10:01:32 +08:00
1 parent 82379131df
commit 90d2e30ff7
6 files changed
+20 -11

No files matched your search

+2 -6
View File
@@ -239,10 +239,6 @@ export const Editor: FC<EditorProps> = ({ onUpdate: updateState, data: editor, .
}
};
const parseExpr = (expr: string) => {
return expr.split(/[^a-zA-Z0-9_]/);
};
const findHightlight = (node: TreeGraphData, highlight: string[], changed?: TreeGraphData[]) => {
changed ||= [];
if (node.highlightInput || node.highlightOutput || node.highlightArgs) {
@@ -276,7 +272,7 @@ export const Editor: FC<EditorProps> = ({ onUpdate: updateState, data: editor, .
if (isExprType(arg.type)) {
const expr: string | string[] = node.args?.[arg.name];
if (typeof expr === "string") {
for (const v of parseExpr(expr)) {
for (const v of b3util.parseExpr(expr)) {
if (highlight.includes(v)) {
node.highlightArgs = true;
changed.push(node);
@@ -285,7 +281,7 @@ export const Editor: FC<EditorProps> = ({ onUpdate: updateState, data: editor, .
}
} else if (expr instanceof Array) {
loop: for (const str of expr) {
for (const v of parseExpr(str)) {
for (const v of b3util.parseExpr(str)) {
if (highlight.includes(v)) {
node.highlightArgs = true;
changed.push(node);
+1
View File
@@ -172,6 +172,7 @@ const TreeInspector: FC = () => {
flexDirection: "row",
gap: 8,
rowGap: 0,
marginLeft: 16,
flexWrap: "wrap",
}}
>