fastspin and .spin2 files
David Betz
Posts: 14,516
in Propeller 2
At first I was going to report this as a bug but then I realized that it is technically correct behavior but somewhat unexpected.
I tried this:
I tried this:
dbetz@Davids-Mac-mini-2 synth % fastspin saw-wave.spin2 Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2020 Total Spectrum Software Inc. Version 4.1.12-beta-c55cda81 Compiled on: May 23 2020 saw-wave.spin2 saw-wave.spin2:17: error: syntax error, unexpected '#' saw-wave.spin2:26: error: syntax error, unexpected identifier `sawwave'and I was surprised that it failed because this worked:
dbetz@Davids-Mac-mini-2 synth % fastspin -2 saw-wave.spin2 Propeller Spin/PASM Compiler 'FastSpin' (c) 2011-2020 Total Spectrum Software Inc. Version 4.1.12-beta-c55cda81 Compiled on: May 23 2020 saw-wave.spin2 saw-wave.spin2 Done. Program size is 68 bytesI figured that fastspin would compile for P2 if the file extension was ".spin2". That, of course, is incorrect. The ".spin2" extension just tells fastspin to compile the Spin2 dialect instead of standard P1 Spin. However, since most people will probably use Spin2 for P2 development I'm wondering if ".spin2" should default to compiling for P2 and require a command line option of -1 to force it to compile for P1. Something similar could be done for ".spin" files where they would default to -1 but allow -2 to force compilation for P2. Does that make sense?
Comments
I think the rule "if -2 is given, compile for P2, otherwise compile for P1" is pretty straightforward.