Replaced parser error for 'function' with shell-aware check.