[yaml mode] More precise parsing of mapping keys

Issue #1735