Refactor placeholder parser

This is to allow yield and await everywhere.

Also, restructure the code to reduce code size.