Sha256: b5ae71bf61f6a6804ca33802dfc009de234aaff8451a973428610e4941e4dc06

Contents?: true

Size: 1.39 KB

Versions: 61

Compression:

Stored size: 1.39 KB

Contents

// Copyright 2014, 2015, 2016, 2017 Simon Lydell
// License: MIT. (See LICENSE.)

Object.defineProperty(exports, "__esModule", {
  value: true
})

// This regex comes from regex.coffee, and is inserted here by generate-index.js
// (run `npm run build`).
exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g

exports.matchToToken = function(match) {
  var token = {type: "invalid", value: match[0]}
       if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4])
  else if (match[ 5]) token.type = "comment"
  else if (match[ 6]) token.type = "comment", token.closed = !!match[7]
  else if (match[ 8]) token.type = "regex"
  else if (match[ 9]) token.type = "number"
  else if (match[10]) token.type = "name"
  else if (match[11]) token.type = "punctuator"
  else if (match[12]) token.type = "whitespace"
  return token
}

Version data entries

61 entries across 61 versions & 11 rubygems

Version Path
immosquare-cleaner-0.1.40 node_modules/js-tokens/index.js
ilog-0.4.1 node_modules/babel-code-frame/node_modules/js-tokens/index.js
ilog-0.4.0 node_modules/babel-code-frame/node_modules/js-tokens/index.js
ilog-0.3.3 node_modules/babel-code-frame/node_modules/js-tokens/index.js
govuk_publishing_components-18.0.0 node_modules/js-tokens/index.js
govuk_publishing_components-17.21.0 node_modules/js-tokens/index.js
govuk_publishing_components-17.20.0 node_modules/js-tokens/index.js
govuk_publishing_components-17.19.1 node_modules/js-tokens/index.js
govuk_publishing_components-17.19.0 node_modules/js-tokens/index.js
govuk_publishing_components-17.18.0 node_modules/js-tokens/index.js
govuk_publishing_components-17.17.0 node_modules/js-tokens/index.js
govuk_publishing_components-17.16.0 node_modules/js-tokens/index.js
govuk_publishing_components-17.15.0 node_modules/js-tokens/index.js
govuk_publishing_components-17.14.0 node_modules/js-tokens/index.js
govuk_publishing_components-17.13.0 node_modules/js-tokens/index.js
govuk_publishing_components-17.12.2 node_modules/js-tokens/index.js
govuk_publishing_components-17.12.1 node_modules/js-tokens/index.js
govuk_publishing_components-17.12.0 node_modules/js-tokens/index.js
govuk_publishing_components-17.11.0 node_modules/js-tokens/index.js
govuk_publishing_components-17.10.0 node_modules/js-tokens/index.js