Skip to content

Commit 7da294d

Browse files
committed
Add and move comments
1 parent 12b54bc commit 7da294d

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

packages/tailwindcss/src/utils/segment.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/* Supports up to 256 levels of nesting. This should be more than enough for any reasonable usage */
2+
const closingBracketStack = new Uint8Array(256)
3+
const OPEN_PAREN = '('.charCodeAt(0)
4+
const OPEN_BRACKET = '['.charCodeAt(0)
5+
const OPEN_BRACE = '{'.charCodeAt(0)
6+
const CLOSE_PAREN = ')'.charCodeAt(0)
7+
const CLOSE_BRACKET = ']'.charCodeAt(0)
8+
const CLOSE_BRACE = '}'.charCodeAt(0)
9+
const BACKSLASH = '\\'.charCodeAt(0)
10+
111
/**
212
* This splits a string on a top-level character.
313
*
@@ -10,15 +20,6 @@
1020
* x x x ╰──────── Split because top-level
1121
* ╰──────────────┴──┴───────────── Ignored b/c inside >= 1 levels of parens
1222
*/
13-
const closingBracketStack = new Uint8Array(256)
14-
const OPEN_PAREN = '('.charCodeAt(0)
15-
const OPEN_BRACKET = '['.charCodeAt(0)
16-
const OPEN_BRACE = '{'.charCodeAt(0)
17-
const CLOSE_PAREN = ')'.charCodeAt(0)
18-
const CLOSE_BRACKET = ']'.charCodeAt(0)
19-
const CLOSE_BRACE = '}'.charCodeAt(0)
20-
const BACKSLASH = '\\'.charCodeAt(0)
21-
2223
export function segment(input: string, separator: string) {
2324
// Since JavaScript is single-threaded, using a shared buffer
2425
// is more efficient and should still be safe.

0 commit comments

Comments
 (0)