neilsf / xc-basic3

A BASIC cross compiler for MOS 6502-based machines
MIT License
45 stars 5 forks source link

Wrong syntax accepted #245

Open neilsf opened 1 year ago

neilsf commented 1 year ago

Although it's invalid, the compiler does not complain about the following syntax:

DIM x, y AS LONG

One would assume that both x and y are defined as LONG, but this is not the case as x is defined as INT (because it is not followed by the AS keyword).

The correct syntax is

DIM x AS LONG, y AS LONG

The compiler should display an error in the first case.

neilsf commented 1 year ago

Actually, the behaviour is the same in QB (where the type defaults to SINGLE)... a warning may be sufficient.