"use strict"; var hex = function (c){ switch (c){ case "0": return 0; case "1": return 1; case "2": return 2; case "3": return 3; case "4": return 4; case "5": return 5; case "6": return 6; case "7": return 7; case "8": return 8; case "9": return 9; case "a": case "A": return 10; case "b": case "B": return 11; case "c": case "C": return 12; case "d": case "D": return 13; case "e": case "E": return 14; case "f": case "F": return 15; } }; module.exports = function (data, options, handlers, control){ var c; var code; var escape; var skipSpace = true; var isCommentLine; var isSectionLine; var newLine = true; var multiLine; var isKey = true; var key = ""; var value = ""; var section; var unicode; var unicodeRemaining; var escapingUnicode; var keySpace; var sep; var ignoreLine; var line = function (){ if (key || value || sep){ handlers.line (key, value); key = ""; value = ""; sep = false; } }; var escapeString = function (key, c, code){ if (escapingUnicode && unicodeRemaining){ unicode = (unicode << 4) + hex (c); if (--unicodeRemaining) return key; escape = false; escapingUnicode = false; return key + String.fromCharCode (unicode); } //code 117: u if (code === 117){ unicode = 0; escapingUnicode = true; unicodeRemaining = 4; return key; } escape = false; //code 116: t //code 114: r //code 110: n //code 102: f if (code === 116) return key + "\t"; else if (code === 114) return key + "\r"; else if (code === 110) return key + "\n"; else if (code === 102) return key + "\f"; return key + c; }; var isComment; var isSeparator; if (options._strict){ isComment = function (c, code, options){ return options._comments[c]; }; isSeparator = function (c, code, options){ return options._separators[c]; }; }else{ isComment = function (c, code, options){ //code 35: # //code 33: ! return code === 35 || code === 33 || options._comments[c]; }; isSeparator = function (c, code, options){ //code 61: = //code 58: : return code === 61 || code === 58 || options._separators[c]; }; } for (var i=~~control.resume; i