ISSOtm / rgbds-structs

A macro pack adding struct-like functionality to RGBDS
MIT License
21 stars 3 forks source link

Parenthesize and unparenthesize field initializers instead of escaping commas #19

Closed Rangi42 closed 1 month ago

Rangi42 commented 1 month ago

Fixes #18

Test case:

INCLUDE "structs.inc"

SECTION "test", ROM0

    struct Dialog
        bytes 16, TextLine1
        bytes 16, TextLine2
    end_struct

    dstruct Dialog, Greeting, \
        .TextLine1=$20\,"Hel"\,"lo, again,"\,$10, \
        .TextLine2="world!"\,$ff
$ ./rgbasm -o - foo.asm | ./rgblink -x -o - - | xxd
00000000: 2048 656c 6c6f 2c20 6167 6169 6e2c 1000   Hello, again,..
00000010: 776f 726c 6421 ff00 0000 0000 0000 0000  world!..........