Skip to content

Commit c142f5a

Browse files
committed
🐛 デモ表示のbugfix
1 parent 5fa3e46 commit c142f5a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/calculator.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class Cursor {
168168
node.parent = this.parent;
169169

170170
// 関数系なら子スロットのどこかにカーソル潜り込ませたい
171-
if ((node.type === "func" || node.type === "struct-func") && node.children?.length > 0) {
171+
if ((node.type === "func" || node.type === "struct-func" || node.type === "bracket") && node.children?.length > 0) {
172172
for (let i = 0; i < node.children.length; i++) {
173173
const childSlot = node.children[i];
174174
if (childSlot.length === 0) {
@@ -320,8 +320,8 @@ class Calculator {
320320
// 1行目
321321
nodeDataDict.gamma.clone(),
322322
nodeDataDict.rand.clone(),
323-
nodeDataDict.pi.clone(),
324323
nodeDataDict.tau.clone(),
324+
nodeDataDict.pi.clone(),
325325
nodeDataDict.e.clone(),
326326
{ label: "AC", type: "clear", func: () => this._calcInit() },
327327
{ label: "BS", key: "Backspace", type: "clear", func: () => this._key_BS() },
@@ -717,7 +717,7 @@ class Calculator {
717717
let count = 0;
718718

719719
const findCursor = (node) => {
720-
if (node.type === "func" || node.type === "struct-func") {
720+
if (node.type === "func" || node.type === "struct-func" || node.type === "bracket") {
721721
for (let i = 0; i < node.children.length; i++) {
722722
const slot = node.children[i];
723723
if (count === displayIndex) {
@@ -927,6 +927,10 @@ class Calculator {
927927
return args[0].atan();
928928
case "factorial":
929929
return args[0].factorial();
930+
case "log2":
931+
return args[0].log2();
932+
case "log10":
933+
return args[0].log10();
930934

931935
// 2引数以上の関数
932936
case "pow":

0 commit comments

Comments
 (0)