boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

030-struct-comma-fields.M1pp (669B)


      1 # %struct / %enum field separators: doc says fields may be separated by
      2 # whitespace, commas, or newlines. Other fixtures cover whitespace and
      3 # newlines; this one exercises the comma-separated form, plus the mixed
      4 # "commas and whitespace and newlines all at once" case.
      5 
      6 %struct comma_only { a, b, c, d }
      7 %comma_only.a
      8 %comma_only.b
      9 %comma_only.c
     10 %comma_only.d
     11 %comma_only.SIZE
     12 
     13 %enum comma_enum { red, green, blue }
     14 %comma_enum.red
     15 %comma_enum.green
     16 %comma_enum.blue
     17 %comma_enum.COUNT
     18 
     19 # Mixed separators — commas adjacent to whitespace and newlines.
     20 %struct mixed {
     21     f0, f1
     22     f2,f3,
     23     f4
     24 }
     25 %mixed.f0
     26 %mixed.f1
     27 %mixed.f2
     28 %mixed.f3
     29 %mixed.f4
     30 %mixed.SIZE
     31 END