pakmanaged.js
function() {
        var index = 0;
        var value = "";
        var length = this.input.length;
        var char = this.peek(index);
        var bad;
        var isAllowedDigit = isDecimalDigit;
        var base = 10;
        var isLegacy = false;
    
        function isDecimalDigit(str) {
          return (/^[0-9]$/).test(str);
        }
    
        function isOctalDigit(str) {
          return (/^[0-7]$/).test(str);
        }
    
        function isBinaryDigit(str) {
          return (/^[01]$/).test(str);
        }
    
        function isHexDigit(str) {
          return (/^[0-9a-fA-F]$/).test(str);
        }
    
        function isIdentifierStart(ch) {
          return (ch === "$") || (ch === "_") || (ch === "\\") ||
            (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z");
        }
    
        // Numbers must start either with a decimal digit or a point.
    
        if (char !== "." && !isDecimalDigit(char)) {
          return null;
        }
    
        if (char !== ".") {
          value = this.peek(index);
          index += 1;
          char = this.peek(index);
    
          if (value === "0") {
            // Base-16 numbers.
            if (char === "x" || char === "X") {
              isAllowedDigit = isHexDigit;
              base = 16;
    
              index += 1;
              value += char;
            }
    
            // Base-8 numbers.
            if (char === "o" || char === "O") {
              isAllowedDigit = isOctalDigit;
              base = 8;
    
              if (!state.option.esnext) {
                this.trigger("warning", {
                  code: "W119",
                  line: this.line,
                  character: this.char,
                  data: [ "Octal integer literal" ]
                });
              }
    
              index += 1;
              value += char;
            }
    
            // Base-2 numbers.
            if (char === "b" || char === "B") {
              isAllowedDigit = isBinaryDigit;
              base = 2;
    
              if (!state.option.esnext) {
                this.trigger("warning", {
                  code: "W119",
                  line: this.line,
                  character: this.char,
                  data: [ "Binary integer literal" ]
                });
              }
    
              index += 1;
              value += char;
            }
    
            // Legacy base-8 numbers.
            if (isOctalDigit(char)) {
              isAllowedDigit = isOctalDigit;
              base = 8;
              isLegacy = true;
              bad = false;
    
              index += 1;
              value += char;
            }
    
            // Decimal numbers that start with '0' such as '09' are illegal
            // but we still parse them and return as malformed.
    
            if (!isOctalDigit(char) && isDecimalDigit(char)) {
              index += 1;
              value += char;
            }
          }
    
          while (index < length) {
            char = this.peek(index);
    
            if (isLegacy && isDecimalDigit(char)) {
              // Numbers like '019' (note the 9) are not valid octals
              // but we still parse them and mark as malformed.
              bad = true;
            } else if (!isAllowedDigit(char)) {
              break;
            }
            value += char;
            index += 1;
          }
    
          if (isAllowedDigit !== isDecimalDigit) {
            if (!isLegacy && value.length <= 2) { // 0x
              return {
                type: Token.NumericLiteral,
                value: value,
                isMalformed: true
              };
            }
    
            if (index < length) {
              char = this.peek(index);
              if (isIdentifierStart(char)) {
                return null;
              }
            }
    
            return {
              type: Token.NumericLiteral,
              value: value,
              base: base,
              isLegacy: isLegacy,
              isMalformed: false
            };
          }
        }
    
        // Decimal digits.
    
        if (char === ".") {
          value += char;
          index += 1;
    
          while (index < length) {
            char = this.peek(index);
            if (!isDecimalDigit(char)) {
              break;
            }
            value += char;
            index += 1;
          }
        }
    
        // Exponent part.
    
        if (char === "e" || char === "E") {
          value += char;
          index += 1;
          char = this.peek(index);
    
          if (char === "+" || char === "-") {
            value += this.peek(index);
            index += 1;
          }
    
          char = this.peek(index);
          if (isDecimalDigit(char)) {
            value += char;
            index += 1;
    
            while (index < length) {
              char = this.peek(index);
              if (!isDecimalDigit(char)) {
                break;
              }
              value += char;
              index += 1;
            }
          } else {
            return null;
          }
        }
    
        if (index < length) {
          char = this.peek(index);
          if (isIdentifierStart(char)) {
            return null;
          }
        }
    
        return {
          type: Token.NumericLiteral,
          value: value,
          base: base,
          isMalformed: !isFinite(value)
        };
      }
function() {
        var index = 0;
        var value = "";
        var length = this.input.length;
        var char = this.peek(index);
        var bad;
        var isAllowedDigit = isDecimalDigit;
        var base = 10;
        var isLegacy = false;
    
        function isDecimalDigit(str) {
          return (/^[0-9]$/).test(str);
        }
    
        function isOctalDigit(str) {
          return (/^[0-7]$/).test(str);
        }
    
        function isBinaryDigit(str) {
          return (/^[01]$/).test(str);
        }
    
        function isHexDigit(str) {
          return (/^[0-9a-fA-F]$/).test(str);
        }
    
        function isIdentifierStart(ch) {
          return (ch === "$") || (ch === "_") || (ch === "\\") ||
            (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z");
        }
    
        // Numbers must start either with a decimal digit or a point.
    
        if (char !== "." && !isDecimalDigit(char)) {
          return null;
        }
    
        if (char !== ".") {
          value = this.peek(index);
          index += 1;
          char = this.peek(index);
    
          if (value === "0") {
            // Base-16 numbers.
            if (char === "x" || char === "X") {
              isAllowedDigit = isHexDigit;
              base = 16;
    
              index += 1;
              value += char;
            }
    
            // Base-8 numbers.
            if (char === "o" || char === "O") {
              isAllowedDigit = isOctalDigit;
              base = 8;
    
              if (!state.option.esnext) {
                this.trigger("warning", {
                  code: "W119",
                  line: this.line,
                  character: this.char,
                  data: [ "Octal integer literal" ]
                });
              }
    
              index += 1;
              value += char;
            }
    
            // Base-2 numbers.
            if (char === "b" || char === "B") {
              isAllowedDigit = isBinaryDigit;
              base = 2;
    
              if (!state.option.esnext) {
                this.trigger("warning", {
                  code: "W119",
                  line: this.line,
                  character: this.char,
                  data: [ "Binary integer literal" ]
                });
              }
    
              index += 1;
              value += char;
            }
    
            // Legacy base-8 numbers.
            if (isOctalDigit(char)) {
              isAllowedDigit = isOctalDigit;
              base = 8;
              isLegacy = true;
              bad = false;
    
              index += 1;
              value += char;
            }
    
            // Decimal numbers that start with '0' such as '09' are illegal
            // but we still parse them and return as malformed.
    
            if (!isOctalDigit(char) && isDecimalDigit(char)) {
              index += 1;
              value += char;
            }
          }
    
          while (index < length) {
            char = this.peek(index);
    
            if (isLegacy && isDecimalDigit(char)) {
              // Numbers like '019' (note the 9) are not valid octals
              // but we still parse them and mark as malformed.
              bad = true;
            } else if (!isAllowedDigit(char)) {
              break;
            }
            value += char;
            index += 1;
          }
    
          if (isAllowedDigit !== isDecimalDigit) {
            if (!isLegacy && value.length <= 2) { // 0x
              return {
                type: Token.NumericLiteral,
                value: value,
                isMalformed: true
              };
            }
    
            if (index < length) {
              char = this.peek(index);
              if (isIdentifierStart(char)) {
                return null;
              }
            }
    
            return {
              type: Token.NumericLiteral,
              value: value,
              base: base,
              isLegacy: isLegacy,
              isMalformed: false
            };
          }
        }
    
        // Decimal digits.
    
        if (char === ".") {
          value += char;
          index += 1;
    
          while (index < length) {
            char = this.peek(index);
            if (!isDecimalDigit(char)) {
              break;
            }
            value += char;
            index += 1;
          }
        }
    
        // Exponent part.
    
        if (char === "e" || char === "E") {
          value += char;
          index += 1;
          char = this.peek(index);
    
          if (char === "+" || char === "-") {
            value += this.peek(index);
            index += 1;
          }
    
          char = this.peek(index);
          if (isDecimalDigit(char)) {
            value += char;
            index += 1;
    
            while (index < length) {
              char = this.peek(index);
              if (!isDecimalDigit(char)) {
                break;
              }
              value += char;
              index += 1;
            }
          } else {
            return null;
          }
        }
    
        if (index < length) {
          char = this.peek(index);
          if (isIdentifierStart(char)) {
            return null;
          }
        }
    
        return {
          type: Token.NumericLiteral,
          value: value,
          base: base,
          isMalformed: !isFinite(value)
        };
      }
/*
Extract a numeric literal out of the next sequence of
characters or return 'null' if its not possible. This method
supports all numeric literals described in section 7.8.3
of the EcmaScript 5 specification.

This method's implementation was heavily influenced by the
scanNumericLiteral function in the Esprima parser's source code.