diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-07-16 07:26:12 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-07-16 07:30:43 -0400 |
| commit | 2914519108341ae4f28fc8a633929462a24ff244 (patch) | |
| tree | 7ff4f16a4171664b9e9868630808514059c46e75 /bqn.js | |
| parent | b4dc8e155b3f10891d15143bb57b690d0456fc14 (diff) | |
Don't execute empty lines in the interactive REPL
Diffstat (limited to 'bqn.js')
| -rwxr-xr-x | bqn.js | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -147,7 +147,9 @@ if (!module.parent) { let e = exec(s=>show(repl(str(s)))); stdin.on('end', () => { process.exit(); }); stdin.on('readable', () => { - let inp; while ((inp=stdin.read())!==null) { e(inp.toString()); } + let inp; while ((inp=stdin.read())!==null) { + if (!/^[ \t]*[#\n]/.test(inp)) e(inp.toString()); + } }); } else if (arg0[0] !== '-' || (arg0==='-f'&&(arg0=(args=args.slice(1))[0],1))) { let f=arg0, a=list(args.slice(1).map(str)); |
