Added patterns and function declarations to parser