Skip to content

Commit 30152ff

Browse files
committed
fix: remove extra brackets
1 parent 6490391 commit 30152ff

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function generateSolution(raw: string[]) {
7474
// console.log("sln:", solution);
7575

7676
return solution.map((t) => {
77-
return t.replaceAll('((', '(').replaceAll('))', ')');
77+
return t.startsWith('(') ? t.slice(1, -1) : t;
7878
});
7979
}
8080

src/interpreter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export function interpret<T extends Node>(
110110
result = interpret(node.argument, scope, solution);
111111

112112
solution.push(`#${++id}`);
113-
solution.push(`(${node.name}(#${id}))`);
113+
solution.push(`${node.name}(#${id})`);
114114

115115
// execute the keyword handler
116116
result = KEYWORDS[node.name](result);

0 commit comments

Comments
 (0)