Your syntax makes the semicolon the end-of-statement mark.
Naive approach assuming the statements are processed as entered:
- Keep a statement buffer.
- When the user presses Enter copy the line onto the end of the buffer.
- Look at the last non-space in the buffer, if it is ';' then process the buffer and empty it.
If terminating semicolons can appear mid-line then you have to process only the whole statements in the buffer and keep whatever remains afterwards.
Bookmarks