bass icon indicating copy to clipboard operation
bass copied to clipboard

Incrementing symbol does not work

Open sasq64 opened this issue 1 year ago • 4 comments

x = 1
x = x + 1

Fails after max passes. Should work.

sasq64 avatar May 06 '23 14:05 sasq64

On second thought -- it probably should not be supported...

sasq64 avatar Jun 10 '23 14:06 sasq64

FYI: Trying to access a label that is later defined and then trying to redefine results in fail after max passes.

    jsr plot
    rts

plot:
    nop
    rts

plot:   ; -> fails; expected "error: already defined label 'plot'"
    rts

Note: Addressing this in PR #39

antis81 avatar Jun 12 '23 15:06 antis81

In the PR I have added both tests. Now it becomes pretty clear that the undefined.insert() line in SymbolTyble::set() is the actual issue. Maybe we can make use of std::any::has_value()…?

antis81 avatar Jun 19 '23 12:06 antis81

Following ACME as a de-facto standard changing the description slightly will make this goal achievable:

X = 1
!set X = X +1

(obviously ACME also defines symbols constant by default)

Now the bug turns into a feature (request)… :slightly_smiling_face:

antis81 avatar Jul 27 '23 10:07 antis81