summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/node_modules/acorn-jsx/node_modules/acorn/src/whitespace.js
blob: ee1214a2180438e80e04c5399e117be091b2d701 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Matches a whole line break (where CRLF is considered a single
// line break). Used to count lines.

export const lineBreak = /\r\n?|\n|\u2028|\u2029/
export const lineBreakG = new RegExp(lineBreak.source, "g")

export function isNewLine(code) {
  return code === 10 || code === 13 || code === 0x2028 || code == 0x2029
}

export const nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/

export const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g