TAB()/SPC() should have implicit trailing ;

Also add docs.

Fixes #34
This commit is contained in:
Joshua Bell 2020-05-29 20:41:22 -07:00
parent af0a7eb886
commit dca4875d3d
3 changed files with 8 additions and 5 deletions

View File

@ -1895,7 +1895,7 @@ this.basic = (function() {
trailing = false;
args.push('lib.comma()');
} else if (test('reserved', kws.SPC) || test('reserved', kws.TAB)) {
trailing = true;
trailing = false;
keyword = match('reserved');
match("operator", "(");
expr = parseNumericExpression();

View File

@ -89,6 +89,9 @@ This is intended as a quick reference for the <a href="./">Applesoft BASIC in Ja
<dl>
<dt>PRINT <var>expr</var> [ [;,] <var>expr</var> ... ] [;]<dd>Output text. <code>;</code> concatenates,
<code>,</code> advances to next tab stop. A trailing <code>;</code> suppresses line break.
<var>expr</var> can include <code>SPC(<var>aexpr</var>)</code> to advance by
multiple spaces, or <code>TAB(<var>aexpr</var>)</code> to advance by multiple tab stops.
<dt>INPUT [<var>string</var> ;] <var>var</var> [, <var>var</var> ...]<dd>Read line of comma-delimited input, with optional prompt
<dt>GET <var>var</var><dd>Read single key
<dt>HOME<dd>Clear text display

View File

@ -358,15 +358,15 @@
4140 T$ = "SPC Operator" :
: SX = PEEK(36) : SY = PEEK(37)
: VTAB 23 : HTAB 1 : PRINT "abc";SPC(10); : T = PEEK(36)
: VTAB 23 : HTAB 1 : PRINT SPC(40);
: VTAB 23 : HTAB 1 : PRINT "abc";SPC(10) : T = PEEK(36)
: VTAB 23 : HTAB 1 : PRINT SPC(40)
: POKE 36, SX : POKE 37, SY
: S = (T = 13) : GOSUB 1
4150 T$ = "TAB Operator" :
: SX = PEEK(36) : SY = PEEK(37)
: VTAB 23 : HTAB 1 : PRINT "abc";TAB(10); : T = PEEK(36)
: VTAB 23 : HTAB 1 : PRINT SPC(40);
: VTAB 23 : HTAB 1 : PRINT "abc";TAB(10) : T = PEEK(36)
: VTAB 23 : HTAB 1 : PRINT SPC(40)
: POKE 36, SX : POKE 37, SY
: S = (T = 9) : GOSUB 1