parallaxinc / OpenSpin

Spin/PASM compiler for the Parallax Propeller.
56 stars 19 forks source link

Preprocessor directives throw error when child object contains specific pattern of characters #45

Closed avsa242 closed 10 months ago

avsa242 commented 3 years ago

Consider the following objects

top.spin:

#define PREPROC_SYMB

OBJ

    ch : "child"

PUB Main

child.spin:

PUB Null

DAT

alabel  byte "{|}", 0

The compiler aborts with the error:

Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2018 Parallax Inc. DBA Parallax Semiconductor.
Version 1.00.81 Compiled on Sep  3 2018 09:56:10
Compiling...
openspin-preproc-dat-bug.spin
|-child.spin
openspin-preproc-dat-bug.spin(1:8) : error : Expected "," or end of line
Line:
#define PREPROC_SYMB
Offending Item: PREPROC_SYMB

shell returned 1

I narrowed down the source of the issue to the line in the child object that defines the data, specifically the "{|}"

Could this be clashing with OpenSpin's comment processing code somehow?

(for reference, this was first discovered in a derivative of the PS/2 keyboard driver from the original Propeller Tool library's Keyboard.spin, and the problem also manifests in that original version)

avsa242 commented 10 months ago

I hope it was okay to close this...I'm pretty sure OpenSpin isn't really maintained any longer given FlexSpin's current development. I'm just trying to clean up some old stale issues in my list.