pakmanaged.js
function(checks) {
        /*jshint loopfunc:true */
        var quote = this.peek();
    
        // String must start with a quote.
        if (quote !== "\"" && quote !== "'") {
          return null;
        }
    
        // In JSON strings must always use double quotes.
        this.triggerAsync("warning", {
          code: "W108",
          line: this.line,
          character: this.char // +1?
        }, checks, function() { return state.jsonMode && quote !== "\""; });
    
        var value = "";
        var startLine = this.line;
        var startChar = this.char;
        var allowNewLine = false;
    
        this.skip();
    
        while (this.peek() !== quote) {
          if (this.peek() === "") { // End Of Line
    
            // If an EOL is not preceded by a backslash, show a warning
            // and proceed like it was a legit multi-line string where
            // author simply forgot to escape the newline symbol.
            //
            // Another approach is to implicitly close a string on EOL
            // but it generates too many false positives.
    
            if (!allowNewLine) {
              this.trigger("warning", {
                code: "W112",
                line: this.line,
                character: this.char
              });
            } else {
              allowNewLine = false;
    
              // Otherwise show a warning if multistr option was not set.
              // For JSON, show warning no matter what.
    
              this.triggerAsync("warning", {
                code: "W043",
                line: this.line,
                character: this.char
              }, checks, function() { return !state.option.multistr; });
    
              this.triggerAsync("warning", {
                code: "W042",
                line: this.line,
                character: this.char
              }, checks, function() { return state.jsonMode && state.option.multistr; });
            }
    
            // If we get an EOF inside of an unclosed string, show an
            // error and implicitly close it at the EOF point.
    
            if (!this.nextLine()) {
              this.trigger("error", {
                code: "E029",
                line: startLine,
                character: startChar
              });
    
              return {
                type: Token.StringLiteral,
                value: value,
                startLine: startLine,
                startChar: startChar,
                isUnclosed: true,
                quote: quote
              };
            }
    
          } else { // Any character other than End Of Line
    
            allowNewLine = false;
            var char = this.peek();
            var jump = 1; // A length of a jump, after we're done
                          // parsing this character.
    
            if (char < " ") {
              // Warn about a control character in a string.
              this.trigger("warning", {
                code: "W113",
                line: this.line,
                character: this.char,
                data: [ "<non-printable>" ]
              });
            }
    
            // Special treatment for some escaped characters.
            if (char === "\\") {
              var parsed = this.scanEscapeSequence(checks);
              char = parsed.char;
              jump = parsed.jump;
              allowNewLine = parsed.allowNewLine;
            }
    
            value += char;
            this.skip(jump);
          }
        }
    
        this.skip();
        return {
          type: Token.StringLiteral,
          value: value,
          startLine: startLine,
          startChar: startChar,
          isUnclosed: false,
          quote: quote
        };
      }
function(checks) {
        /*jshint loopfunc:true */
        var quote = this.peek();
    
        // String must start with a quote.
        if (quote !== "\"" && quote !== "'") {
          return null;
        }
    
        // In JSON strings must always use double quotes.
        this.triggerAsync("warning", {
          code: "W108",
          line: this.line,
          character: this.char // +1?
        }, checks, function() { return state.jsonMode && quote !== "\""; });
    
        var value = "";
        var startLine = this.line;
        var startChar = this.char;
        var allowNewLine = false;
    
        this.skip();
    
        while (this.peek() !== quote) {
          if (this.peek() === "") { // End Of Line
    
            // If an EOL is not preceded by a backslash, show a warning
            // and proceed like it was a legit multi-line string where
            // author simply forgot to escape the newline symbol.
            //
            // Another approach is to implicitly close a string on EOL
            // but it generates too many false positives.
    
            if (!allowNewLine) {
              this.trigger("warning", {
                code: "W112",
                line: this.line,
                character: this.char
              });
            } else {
              allowNewLine = false;
    
              // Otherwise show a warning if multistr option was not set.
              // For JSON, show warning no matter what.
    
              this.triggerAsync("warning", {
                code: "W043",
                line: this.line,
                character: this.char
              }, checks, function() { return !state.option.multistr; });
    
              this.triggerAsync("warning", {
                code: "W042",
                line: this.line,
                character: this.char
              }, checks, function() { return state.jsonMode && state.option.multistr; });
            }
    
            // If we get an EOF inside of an unclosed string, show an
            // error and implicitly close it at the EOF point.
    
            if (!this.nextLine()) {
              this.trigger("error", {
                code: "E029",
                line: startLine,
                character: startChar
              });
    
              return {
                type: Token.StringLiteral,
                value: value,
                startLine: startLine,
                startChar: startChar,
                isUnclosed: true,
                quote: quote
              };
            }
    
          } else { // Any character other than End Of Line
    
            allowNewLine = false;
            var char = this.peek();
            var jump = 1; // A length of a jump, after we're done
                          // parsing this character.
    
            if (char < " ") {
              // Warn about a control character in a string.
              this.trigger("warning", {
                code: "W113",
                line: this.line,
                character: this.char,
                data: [ "<non-printable>" ]
              });
            }
    
            // Special treatment for some escaped characters.
            if (char === "\\") {
              var parsed = this.scanEscapeSequence(checks);
              char = parsed.char;
              jump = parsed.jump;
              allowNewLine = parsed.allowNewLine;
            }
    
            value += char;
            this.skip(jump);
          }
        }
    
        this.skip();
        return {
          type: Token.StringLiteral,
          value: value,
          startLine: startLine,
          startChar: startChar,
          isUnclosed: false,
          quote: quote
        };
      }
/*
Extract a string out of the next sequence of characters and/or
lines or return 'null' if its not possible. Since strings can
span across multiple lines this method has to move the char
pointer.

This method recognizes pseudo-multiline JavaScript strings:

var str = "hello\
world";