Implement a proper parser for format strings