Skip to content

Commit

Permalink
Simplify INPUT rule, document missing prompt string.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsc committed Jul 16, 2022
1 parent 5816497 commit 89e61b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ Console Print and Input Statements
**INPUT _var_ / I.**
**INPUT "prompt"; _var_**
**INPUT "prompt", _var_**
**INPUT ; _var_**

Reads from keyboard/screen and stores
the value in _var_.
Expand All @@ -965,7 +966,9 @@ Console Print and Input Statements
after the prompt, spaces are printed
to align to a column multiple of 10
(similar to how a comma works in
PRINT).
`PRINT`). In the case you don't want
any prompt, you can use a semicolon
alone.

If the value can't be read because
input errors, the error is stored in
Expand Down
2 changes: 1 addition & 1 deletion src/syntax/basic.syn
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ DIM_MORE: comma
# INPUT
INPUT_STR:
"\"" emit TOK_CSTRING E_CONST_STRING emit TOK_PRINT_STR PRINT_SEP_EOL # Prints a given string
PRINT_SEP_EOL # If starts with ',' or ';', don't print anyting
";" # If starts with ';' don't print anyting
emit { TOK_BYTE_PUT, 63 } # Prints a '?' by default

INPUT_VAR_LIST:
Expand Down

0 comments on commit 89e61b6

Please sign in to comment.