<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def literal(x):
 """ Create a PEG function to consume a literal. """

    xlen = len(x)
    msg = 'Expected: "{}"'.format(x)
    def match_literal(s, grm=None, pos=0):
        if s[:xlen] == x:
            return PegreResult(s[xlen:], x, (pos, pos+xlen))
        raise PegreError(msg, pos)
    return match_literal