haxetink / tink_macro

The macro toolkit
MIT License
57 stars 17 forks source link

Add concat() #8

Closed kevinresol closed 7 years ago

kevinresol commented 8 years ago

Would merge the contents of two EBlocks

back2dos commented 7 years ago

How about merging non-blocks too though, i.e. roughly like so:

switch [e1.expr, e2.expr] {
  case [EBlock(e1), EBlock(e2)]: e1.concat(e2);
  case [EBlock(e1), e2]: e1.concat([e2]);
  case [e1, EBlock(e2)]: [e1].concat(e2);
  default: [e1, e2];
}

Or what kind of bug would the error help to protect against?

kevinresol commented 7 years ago

done

back2dos commented 7 years ago

Awesome, thanks :)