Skip to content

Commit c4318e9

Browse files
committed
debug stop
1 parent ed020b3 commit c4318e9

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

dist/easycoder.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,18 @@ const EasyCoder_Core = {
346346
name
347347
});
348348
return true;
349-
} else if (compiler.tokenIs(`step`)) {
350-
compiler.next();
351-
compiler.addCommand({
352-
domain: `core`,
353-
keyword: `debug`,
354-
lino,
355-
item: `step`
356-
});
357-
return true;
349+
} else {
350+
const item = compiler.getToken();
351+
if ([`step`, `stop`].includes(item)) {
352+
compiler.next();
353+
compiler.addCommand({
354+
domain: `core`,
355+
keyword: `debug`,
356+
lino,
357+
item
358+
});
359+
return true;
360+
}
358361
}
359362
return false;
360363
},
@@ -376,6 +379,9 @@ const EasyCoder_Core = {
376379
case `step`:
377380
program.debugStep = true;
378381
break;
382+
case `stop`:
383+
program.debugStep = false;
384+
break;
379385
case `program`:
380386
console.log(`Debug program: ${JSON.stringify(program, null, 2)}`);
381387
break;

js/easycoder/Core.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -346,15 +346,18 @@ const EasyCoder_Core = {
346346
name
347347
});
348348
return true;
349-
} else if (compiler.tokenIs(`step`)) {
350-
compiler.next();
351-
compiler.addCommand({
352-
domain: `core`,
353-
keyword: `debug`,
354-
lino,
355-
item: `step`
356-
});
357-
return true;
349+
} else {
350+
const item = compiler.getToken();
351+
if ([`step`, `stop`].includes(item)) {
352+
compiler.next();
353+
compiler.addCommand({
354+
domain: `core`,
355+
keyword: `debug`,
356+
lino,
357+
item
358+
});
359+
return true;
360+
}
358361
}
359362
return false;
360363
},
@@ -376,6 +379,9 @@ const EasyCoder_Core = {
376379
case `step`:
377380
program.debugStep = true;
378381
break;
382+
case `stop`:
383+
program.debugStep = false;
384+
break;
379385
case `program`:
380386
console.log(`Debug program: ${JSON.stringify(program, null, 2)}`);
381387
break;

0 commit comments

Comments
 (0)