The OpenQASM3 spec uses the word subroutine for user-defined procedures. This parser, in both identifiers and docs and comments, is not consistent in using this language. We frequently use def and Def because def is the keyword used to introduce a subroutine definition.
Def is a bit too short and not really descriptive.
We should definitely expurgate the use of function for subroutine.