fix check variadic input/output
This commit is contained in:
1 parent
82379131df
commit
90d2e30ff7
6 files changed
+20
-11
No files matched your search
@@ -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);
|
||||
|
||||
@@ -172,6 +172,7 @@ const TreeInspector: FC = () => {
|
||||
flexDirection: "row",
|
||||
gap: 8,
|
||||
rowGap: 0,
|
||||
marginLeft: 16,
|
||||
flexWrap: "wrap",
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user