syntax: support back-references in grammar end expressions.

Somewhat trickier than expected because we do want to match the
likes of \2, while not accidentally expanding \\2 (not a back-
reference, just an escaped backslash followed by a plain 2):
* lib/zile/bundle.lua (compile_rex): Now a global function.
(has_backrefs): New function to check for back-references, being
careful of unbalanced escapes.
(compile_grammar): Don't precompile `end' expressions with un-
resolved back-references.
* lib/zile/syntax.lua (expand): New function to expand back-
references in expressions using a reference string and capture
offsets, and then compile on demand; again being careful of
unbalanced escapes.
(parse): Pass capture offsets to expression matches, and use
them to expand back-references on demand.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>