factored out literal parsing so we can parse the same things in patterns
and terms