boot2

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

10-full-parity.M1pp (416B)


      1 # Exercises actual macro expansion parity for the P1-oriented m1m subset.
      2 
      3 %macro PASTE(a, b)
      4 a ## b
      5 %endm
      6 
      7 %macro EMIT_WORD(x)
      8 x
      9 %endm
     10 
     11 %macro CHAIN(x)
     12 %EMIT_WORD(x)
     13 %endm
     14 
     15 %macro CHOOSE(flag, yes, no)
     16 %select(flag, yes, no)
     17 %endm
     18 
     19 %PASTE(HELLO, _WORLD)
     20 %CHAIN(recursed)
     21 %((+ 1 (<< 2 8)))
     22 $((| 0x1122 (<< 0x33 16)))
     23 %CHOOSE((= 4 4), selected_true, selected_false)
     24 %CHOOSE((!= 4 4), selected_bad, selected_else)
     25 END