Added pattern parsing into main parser