Parse %[] notation

Crazy stuff. This definitely needs some refactoring however, because
there are edgecases galore.