Skip to content

Instantly share code, notes, and snippets.

@bfgeek
Created June 3, 2016 23:09
Show Gist options
  • Save bfgeek/28794bc6cfa0b649960ff6fcc73af1b1 to your computer and use it in GitHub Desktop.
Save bfgeek/28794bc6cfa0b649960ff6fcc73af1b1 to your computer and use it in GitHub Desktop.
BlockFlowLayout::layout(Box* box)
{
// START TOP GENERATOR MACRO
switch (m_state) {
case 0:
goto a;
case 1:
goto b;
}
// END TOP GENERATOR MACRO
for (m_i = 0; m_i < box.children.size(); m_i++) { // Would need clang plugin to assert no local vars have bad state.
// START YIELD MACRO
return box.children[m_i];
a:
// END YIELD MACRO
m_fragment.top = 0;
m_fragment.left = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment