added directive parser, and missing library pattern