make parse-rules a function