refactor(frontends/lean/parser): use std::function

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
refactor(frontends/lean/parser): use std::function