QBASIC to BASIC Transformer

InputOutput

About

This tiny app transforms QBASIC-like sources to regular BASIC.
Supported features:

Any REM statements or strings are ignored. Any bare labels at the end that are used as a target will result in an additional END statement.
The transformation is case-agnostic, the case of any inserted REM commands will be determined heuristically.

Example:
the source text

'test
[label] print "hello world ";
        goto [label]

will be transformed to

10 rem test
20 print "hello world ";
30 goto 20

Compatibility: This should work with any dialect that doesn’t use single quotes in normal program text, other than for comments, and that doesn’t use square brackets for syntax. In order to work with BBC BASIC-like inline assembly, any unclosed square brackets will trigger a warning, but the transformation will still succeed.

(This is generally the same implementation as built-in into the PET 2001 emulator.)