Skip to content

Commit f899873

Browse files
refactor(css,html): name token types, quotes and namespaces with enums (#22640)
* refactor(css,html): name token types, quotes and namespaces with enums CSS token types become TokenType, HTML quote kinds Quote and namespaces Namespace, like NodeType. Character codes and the minifier's list states the printers share become private exports; six unused ones are removed. * perf(css,html): keep the lexer and tree builder on plain constants Reading TokenType, Quote and Namespace members on the hot paths cost CodSpeed's readToken benchmark 25% more instructions. The parsers read the TT_*, QUOTE_* and NS_* constants again and build the enums from them.
1 parent cf97e07 commit f899873

15 files changed

Lines changed: 355 additions & 385 deletions

‎lib/css/syntax-parser.js‎

Lines changed: 63 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ const CC_EQUALS_SIGN = "=".charCodeAt(0);
310310

311311
// Lexer token types (CSS Syntax Level 3 §4) plus the `<eof-token>`, numeric so
312312
// the `type` slot stays compact and the consume algorithms dispatch on integer
313-
// `===`. Exported with `readToken`, the lexer primitive, for the unit test.
313+
// `===`. Plain constants, not `TokenType` reads, keep the lexer's hot path cheap.
314314
const TT_COMMENT = 1;
315315
const TT_WHITESPACE = 2;
316316
const TT_STRING = 3;
@@ -340,6 +340,40 @@ const TT_CDO = 24;
340340
const TT_CDC = 25;
341341
const TT_EOF = 26;
342342

343+
/**
344+
* The lexer token types by spec name, as `readToken` and `TokenStream` callers
345+
* read them.
346+
* @type {{ Comment: 1, Whitespace: 2, String: 3, BadString: 4, Hash: 5, Delim: 6, LeftParenthesis: 7, LeftSquareBracket: 8, LeftCurlyBracket: 9, RightParenthesis: 10, RightSquareBracket: 11, RightCurlyBracket: 12, Comma: 13, Colon: 14, Semicolon: 15, AtKeyword: 16, Function: 17, Url: 18, BadUrl: 19, Ident: 20, Number: 21, Percentage: 22, Dimension: 23, CDO: 24, CDC: 25, EOF: 26 }}
347+
*/
348+
const TokenType = {
349+
Comment: TT_COMMENT,
350+
Whitespace: TT_WHITESPACE,
351+
String: TT_STRING,
352+
BadString: TT_BAD_STRING_TOKEN,
353+
Hash: TT_HASH,
354+
Delim: TT_DELIM,
355+
LeftParenthesis: TT_LEFT_PARENTHESIS,
356+
LeftSquareBracket: TT_LEFT_SQUARE_BRACKET,
357+
LeftCurlyBracket: TT_LEFT_CURLY_BRACKET,
358+
RightParenthesis: TT_RIGHT_PARENTHESIS,
359+
RightSquareBracket: TT_RIGHT_SQUARE_BRACKET,
360+
RightCurlyBracket: TT_RIGHT_CURLY_BRACKET,
361+
Comma: TT_COMMA,
362+
Colon: TT_COLON,
363+
Semicolon: TT_SEMICOLON,
364+
AtKeyword: TT_AT_KEYWORD,
365+
Function: TT_FUNCTION,
366+
Url: TT_URL,
367+
BadUrl: TT_BAD_URL_TOKEN,
368+
Ident: TT_IDENTIFIER,
369+
Number: TT_NUMBER,
370+
Percentage: TT_PERCENTAGE,
371+
Dimension: TT_DIMENSION,
372+
CDO: TT_CDO,
373+
CDC: TT_CDC,
374+
EOF: TT_EOF
375+
};
376+
343377
// The opening bracket types (7..9) and their closers (10..12) are laid out so a
344378
// closer is always `opener + 3`, which `consumeASimpleBlock` uses directly. The
345379
// block char is a dense array indexed by the offset from `TT_LEFT_PARENTHESIS`.
@@ -806,7 +840,7 @@ const _consumeTheRemnantsOfABadUrl = (input, pos) => {
806840
* by `tokenToNode` for the matching type. Pass a fresh one per `readToken` call
807841
* to collect the raw token list (e.g. tests).
808842
* @typedef {object} MutableToken
809-
* @property {number} type one of the `TT_*` constants
843+
* @property {number} type a `TokenType`
810844
* @property {number} start byte offset of the token's first code point
811845
* @property {number} end byte offset just past the token's last code point
812846
* @property {boolean} isId hash tokens: starts an ident sequence
@@ -832,7 +866,7 @@ const createToken = () => ({
832866
* Populate `out`'s common fields and return it — the lexer functions' return
833867
* statement (kept tiny so V8 can inline it).
834868
* @param {MutableToken} out token to populate
835-
* @param {number} type one of the `TT_*` constants
869+
* @param {number} type a `TokenType`
836870
* @param {number} start byte offset of the token's first code point
837871
* @param {number} end byte offset just past the token's last code point
838872
* @returns {MutableToken} `out`
@@ -19042,65 +19076,40 @@ const _collectRuleSpans = (spans, item, text, at, path, inner) => {
1904219076
};
1904319077

1904419078
module.exports.A = A;
19045-
module.exports.CC_0 = CC_0;
19046-
module.exports.CC_APOSTROPHE = CC_APOSTROPHE;
19047-
module.exports.CC_COMMA = CC_COMMA;
19048-
module.exports.CC_FULL_STOP = CC_FULL_STOP;
19049-
module.exports.CC_GREATER_THAN_SIGN = CC_GREATER_THAN_SIGN;
19050-
module.exports.CC_HYPHEN_MINUS = CC_HYPHEN_MINUS;
19051-
module.exports.CC_LEFT_PARENTHESIS = CC_LEFT_PARENTHESIS;
19052-
module.exports.CC_LEFT_SQUARE = CC_LEFT_SQUARE;
19053-
module.exports.CC_LOWER_D = CC_LOWER_D;
19054-
module.exports.CC_LOW_LINE = CC_LOW_LINE;
19055-
module.exports.CC_NUMBER_SIGN = CC_NUMBER_SIGN;
19056-
module.exports.CC_PLUS_SIGN = CC_PLUS_SIGN;
19057-
module.exports.CC_QUOTATION_MARK = CC_QUOTATION_MARK;
19058-
module.exports.CC_REVERSE_SOLIDUS = CC_REVERSE_SOLIDUS;
19059-
module.exports.CC_RIGHT_PARENTHESIS = CC_RIGHT_PARENTHESIS;
19060-
module.exports.CC_RIGHT_SQUARE = CC_RIGHT_SQUARE;
19061-
module.exports.CC_SPACE = CC_SPACE;
19062-
module.exports.CC_TILDE = CC_TILDE;
19063-
module.exports.CC_UPPER_A = CC_UPPER_A;
19064-
module.exports.CC_UPPER_Z = CC_UPPER_Z;
1906519079
module.exports.DARK_PROPERTY = DARK_PROPERTY;
1906619080
module.exports.KEYFRAMES_AT_RULE_RE = KEYFRAMES_AT_RULE_RE;
1906719081
module.exports.LIGHT_PROPERTY = LIGHT_PROPERTY;
19068-
module.exports.LIST_KIND_KEYFRAME = LIST_KIND_KEYFRAME;
19069-
module.exports.LIST_KIND_NESTED = LIST_KIND_NESTED;
19070-
module.exports.LIST_KIND_SELECTOR = LIST_KIND_SELECTOR;
19071-
module.exports.LIST_NO = LIST_NO;
19072-
module.exports.LIST_UNKNOWN = LIST_UNKNOWN;
1907319082
module.exports.Field = Field;
1907419083
module.exports.Flag = Flag;
1907519084
module.exports.Part = Part;
19085+
module.exports._CC_0 = CC_0;
19086+
module.exports._CC_APOSTROPHE = CC_APOSTROPHE;
19087+
module.exports._CC_COMMA = CC_COMMA;
19088+
module.exports._CC_FULL_STOP = CC_FULL_STOP;
19089+
module.exports._CC_GREATER_THAN_SIGN = CC_GREATER_THAN_SIGN;
19090+
module.exports._CC_HYPHEN_MINUS = CC_HYPHEN_MINUS;
19091+
module.exports._CC_LEFT_PARENTHESIS = CC_LEFT_PARENTHESIS;
19092+
module.exports._CC_LEFT_SQUARE = CC_LEFT_SQUARE;
19093+
module.exports._CC_LOWER_D = CC_LOWER_D;
19094+
module.exports._CC_LOW_LINE = CC_LOW_LINE;
19095+
module.exports._CC_NUMBER_SIGN = CC_NUMBER_SIGN;
19096+
module.exports._CC_PLUS_SIGN = CC_PLUS_SIGN;
19097+
module.exports._CC_QUOTATION_MARK = CC_QUOTATION_MARK;
19098+
module.exports._CC_REVERSE_SOLIDUS = CC_REVERSE_SOLIDUS;
19099+
module.exports._CC_RIGHT_PARENTHESIS = CC_RIGHT_PARENTHESIS;
19100+
module.exports._CC_RIGHT_SQUARE = CC_RIGHT_SQUARE;
19101+
module.exports._CC_SPACE = CC_SPACE;
19102+
module.exports._CC_TILDE = CC_TILDE;
19103+
module.exports._CC_UPPER_A = CC_UPPER_A;
19104+
module.exports._CC_UPPER_Z = CC_UPPER_Z;
19105+
module.exports._LIST_KIND_KEYFRAME = LIST_KIND_KEYFRAME;
19106+
module.exports._LIST_KIND_NESTED = LIST_KIND_NESTED;
19107+
module.exports._LIST_KIND_SELECTOR = LIST_KIND_SELECTOR;
19108+
module.exports._LIST_NO = LIST_NO;
19109+
module.exports._LIST_UNKNOWN = LIST_UNKNOWN;
1907619110
module.exports._blockTokenOf = _blockTokenOf;
1907719111
module.exports.NodeType = NodeType;
19078-
module.exports.TT_AT_KEYWORD = TT_AT_KEYWORD;
19079-
module.exports.TT_BAD_STRING_TOKEN = TT_BAD_STRING_TOKEN;
19080-
module.exports.TT_BAD_URL_TOKEN = TT_BAD_URL_TOKEN;
19081-
module.exports.TT_CDC = TT_CDC;
19082-
module.exports.TT_CDO = TT_CDO;
19083-
module.exports.TT_COLON = TT_COLON;
19084-
module.exports.TT_COMMA = TT_COMMA;
19085-
module.exports.TT_COMMENT = TT_COMMENT;
19086-
module.exports.TT_DELIM = TT_DELIM;
19087-
module.exports.TT_DIMENSION = TT_DIMENSION;
19088-
module.exports.TT_EOF = TT_EOF;
19089-
module.exports.TT_FUNCTION = TT_FUNCTION;
19090-
module.exports.TT_HASH = TT_HASH;
19091-
module.exports.TT_IDENTIFIER = TT_IDENTIFIER;
19092-
module.exports.TT_LEFT_CURLY_BRACKET = TT_LEFT_CURLY_BRACKET;
19093-
module.exports.TT_LEFT_PARENTHESIS = TT_LEFT_PARENTHESIS;
19094-
module.exports.TT_LEFT_SQUARE_BRACKET = TT_LEFT_SQUARE_BRACKET;
19095-
module.exports.TT_NUMBER = TT_NUMBER;
19096-
module.exports.TT_PERCENTAGE = TT_PERCENTAGE;
19097-
module.exports.TT_RIGHT_CURLY_BRACKET = TT_RIGHT_CURLY_BRACKET;
19098-
module.exports.TT_RIGHT_PARENTHESIS = TT_RIGHT_PARENTHESIS;
19099-
module.exports.TT_RIGHT_SQUARE_BRACKET = TT_RIGHT_SQUARE_BRACKET;
19100-
module.exports.TT_SEMICOLON = TT_SEMICOLON;
19101-
module.exports.TT_STRING = TT_STRING;
19102-
module.exports.TT_URL = TT_URL;
19103-
module.exports.TT_WHITESPACE = TT_WHITESPACE;
19112+
module.exports.TokenType = TokenType;
1910419113
module.exports.TokenStream = TokenStream;
1910519114
module.exports.VENDOR_PREFIX = VENDOR_PREFIX;
1910619115
module.exports._IMPORTANT = _IMPORTANT;

‎lib/css/syntax-printer.js‎

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -105,37 +105,37 @@ const {
105105
} = require("./data");
106106
const {
107107
A,
108-
CC_0,
109-
CC_APOSTROPHE,
110-
CC_COMMA,
111-
CC_FULL_STOP,
112-
CC_GREATER_THAN_SIGN,
113-
CC_HYPHEN_MINUS,
114-
CC_LEFT_PARENTHESIS,
115-
CC_LEFT_SQUARE,
116-
CC_LOWER_D,
117-
CC_LOW_LINE,
118-
CC_NUMBER_SIGN,
119-
CC_PLUS_SIGN,
120-
CC_QUOTATION_MARK,
121-
CC_REVERSE_SOLIDUS,
122-
CC_RIGHT_PARENTHESIS,
123-
CC_RIGHT_SQUARE,
124-
CC_SPACE,
125-
CC_TILDE,
126-
CC_UPPER_A,
127-
CC_UPPER_Z,
128108
DARK_PROPERTY,
129109
KEYFRAMES_AT_RULE_RE,
130110
LIGHT_PROPERTY,
131-
LIST_KIND_KEYFRAME,
132-
LIST_KIND_NESTED,
133-
LIST_KIND_SELECTOR,
134-
LIST_NO,
135-
LIST_UNKNOWN,
136111
NodeType,
137112
VENDOR_PREFIX,
113+
_CC_0: CC_0,
114+
_CC_APOSTROPHE: CC_APOSTROPHE,
115+
_CC_COMMA: CC_COMMA,
116+
_CC_FULL_STOP: CC_FULL_STOP,
117+
_CC_GREATER_THAN_SIGN: CC_GREATER_THAN_SIGN,
118+
_CC_HYPHEN_MINUS: CC_HYPHEN_MINUS,
119+
_CC_LEFT_PARENTHESIS: CC_LEFT_PARENTHESIS,
120+
_CC_LEFT_SQUARE: CC_LEFT_SQUARE,
121+
_CC_LOWER_D: CC_LOWER_D,
122+
_CC_LOW_LINE: CC_LOW_LINE,
123+
_CC_NUMBER_SIGN: CC_NUMBER_SIGN,
124+
_CC_PLUS_SIGN: CC_PLUS_SIGN,
125+
_CC_QUOTATION_MARK: CC_QUOTATION_MARK,
126+
_CC_REVERSE_SOLIDUS: CC_REVERSE_SOLIDUS,
127+
_CC_RIGHT_PARENTHESIS: CC_RIGHT_PARENTHESIS,
128+
_CC_RIGHT_SQUARE: CC_RIGHT_SQUARE,
129+
_CC_SPACE: CC_SPACE,
130+
_CC_TILDE: CC_TILDE,
131+
_CC_UPPER_A: CC_UPPER_A,
132+
_CC_UPPER_Z: CC_UPPER_Z,
138133
_IMPORTANT,
134+
_LIST_KIND_KEYFRAME: LIST_KIND_KEYFRAME,
135+
_LIST_KIND_NESTED: LIST_KIND_NESTED,
136+
_LIST_KIND_SELECTOR: LIST_KIND_SELECTOR,
137+
_LIST_NO: LIST_NO,
138+
_LIST_UNKNOWN: LIST_UNKNOWN,
139139
_LONE_NUMBER_RE,
140140
_NO_RULE_SPANS,
141141
_NUMERIC_RE,

‎lib/html/HtmlGenerator.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ const rebaseCssUrls = (css, fromFile, toFile, outputPath) => {
279279
const fromUndo = getUndoPath(fromFile, outputPath, false);
280280
const toUndo = getUndoPath(toFile, outputPath, false);
281281
if (fromUndo === toUndo) return css;
282-
const { readToken, TT_URL } = getCssParser();
282+
const { readToken, TokenType } = getCssParser();
283283
const token = {
284284
type: 0,
285285
start: 0,
@@ -294,7 +294,7 @@ const rebaseCssUrls = (css, fromFile, toFile, outputPath) => {
294294
let out = "";
295295
while (readToken(css, pos, token) !== undefined) {
296296
pos = token.end;
297-
if (token.type !== TT_URL) continue;
297+
if (token.type !== TokenType.Url) continue;
298298
const url = css.slice(token.contentStart, token.contentEnd);
299299
// Rebase only the undo-path-relative urls; a root-relative (`/`), fragment
300300
// (`#`) or scheme (`data:`, …, a `:` before any `/`) url is absolute.

‎lib/html/syntax-parser.js‎

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,16 @@ const QUOTE_DOUBLE = 1;
309309
const QUOTE_SINGLE = 2;
310310
const QUOTE_NONE = 0;
311311

312+
/**
313+
* How an attribute value is quoted in the source (HTML §13.2.5.36–38).
314+
* @type {{ None: 0, Double: 1, Single: 2 }}
315+
*/
316+
const Quote = {
317+
None: QUOTE_NONE,
318+
Double: QUOTE_DOUBLE,
319+
Single: QUOTE_SINGLE
320+
};
321+
312322
// The longest WHATWG named entity is 32 chars with its `;`, 31 without. Capping
313323
// the tokenizer's reference run and the decoder's longest-prefix backtrack there
314324
// keeps `&` followed by thousands of alphanumerics linear-time.
@@ -4504,6 +4514,16 @@ const NS_HTML = 0;
45044514
const NS_MATHML = 1;
45054515
const NS_SVG = 2;
45064516

4517+
/**
4518+
* An element's namespace (Infra §8): its MathML or SVG `Flag` bit, neither for HTML.
4519+
* @type {{ HTML: 0, MathML: 1, SVG: 2 }}
4520+
*/
4521+
const Namespace = {
4522+
HTML: NS_HTML,
4523+
MathML: NS_MATHML,
4524+
SVG: NS_SVG
4525+
};
4526+
45074527
/**
45084528
* AST node `type` discriminators. Numeric for the same reason as the CSS
45094529
* `NodeType`: compact integer `===` dispatch on the tree-construction and
@@ -13885,22 +13905,15 @@ let _cssParser;
1388513905
* @returns {ParsedSource[]} url references
1388613906
*/
1388713907
const parseCssUrls = (input) => {
13888-
const {
13889-
TT_EOF,
13890-
TT_FUNCTION,
13891-
TT_STRING,
13892-
TT_URL,
13893-
TT_WHITESPACE,
13894-
TokenStream,
13895-
equalsLowerCase
13896-
} = _cssParser || (_cssParser = require("../css/syntax-parser"));
13908+
const { TokenType, TokenStream, equalsLowerCase } =
13909+
_cssParser || (_cssParser = require("../css/syntax-parser"));
1389713910
const ts = new TokenStream(input);
1389813911
/** @type {ParsedSource[]} */
1389913912
const result = [];
1390013913
for (;;) {
1390113914
const t = ts.consume();
13902-
if (t.type === TT_EOF) break;
13903-
if (t.type === TT_URL) {
13915+
if (t.type === TokenType.EOF) break;
13916+
if (t.type === TokenType.Url) {
1390413917
if (t.contentEnd > t.contentStart) {
1390513918
result.push([
1390613919
input.slice(t.contentStart, t.contentEnd),
@@ -13909,12 +13922,12 @@ const parseCssUrls = (input) => {
1390913922
]);
1391013923
}
1391113924
} else if (
13912-
t.type === TT_FUNCTION &&
13925+
t.type === TokenType.Function &&
1391313926
equalsLowerCase(input.slice(t.start, t.end - 1), "url")
1391413927
) {
1391513928
let s = ts.consume();
13916-
while (s.type === TT_WHITESPACE) s = ts.consume();
13917-
if (s.type === TT_STRING) {
13929+
while (s.type === TokenType.Whitespace) s = ts.consume();
13930+
if (s.type === TokenType.String) {
1391813931
const quote = input.charCodeAt(s.start);
1391913932
const innerStart = s.start + 1;
1392013933
// Drop the closing quote, unless the string is unterminated at EOF.
@@ -14344,28 +14357,18 @@ const A = {
1434414357

1434514358
module.exports.A = A;
1434614359
module.exports.BLOCK_CONTENTS = BLOCK_CONTENTS;
14347-
module.exports.CC_APOSTROPHE = CC_APOSTROPHE;
14348-
module.exports.CC_LEFT_SQUARE_BRACKET = CC_LEFT_SQUARE_BRACKET;
14349-
module.exports.CC_LF = CC_LF;
14350-
module.exports.CC_NUMBER_SIGN = CC_NUMBER_SIGN;
14351-
module.exports.CC_QUOTATION_MARK = CC_QUOTATION_MARK;
14352-
module.exports.CC_RIGHT_SQUARE_BRACKET = CC_RIGHT_SQUARE_BRACKET;
14353-
module.exports.CC_SOLIDUS = CC_SOLIDUS;
1435414360
module.exports.EMBEDDED_LANGUAGES = EMBEDDED_LANGUAGES;
1435514361
module.exports.EVENT_HANDLER = EVENT_HANDLER;
1435614362
module.exports.FLAG_FOSTER_REGION = FLAG_FOSTER_REGION;
1435714363
module.exports.JSON_TYPE = JSON_TYPE;
14358-
module.exports.NS_HTML = NS_HTML;
14359-
module.exports.NS_MATHML = NS_MATHML;
14360-
module.exports.NS_SVG = NS_SVG;
1436114364
module.exports.Field = Field;
1436214365
module.exports.Flag = Flag;
1436314366
module.exports.Part = Part;
14367+
module.exports.Namespace = Namespace;
1436414368
module.exports.NodeType = NodeType;
14365-
module.exports.QUOTE_DOUBLE = QUOTE_DOUBLE;
14366-
module.exports.QUOTE_NONE = QUOTE_NONE;
14367-
module.exports.QUOTE_SINGLE = QUOTE_SINGLE;
14369+
module.exports.Quote = Quote;
1436814370
module.exports.SVG_TYPE = SVG_TYPE;
14371+
module.exports._CC_NUMBER_SIGN = CC_NUMBER_SIGN;
1436914372
module.exports._S = _S;
1437014373
module.exports._attributeCountOf = _attributeCountOf;
1437114374
module.exports._attributeList = _attributeList;

‎lib/html/syntax-printer.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ const {
1818
TRANSPARENT_IMPLIED_ELEMENTS
1919
} = require("./data");
2020
const {
21-
CC_NUMBER_SIGN,
2221
FLAG_FOSTER_REGION,
2322
Field,
2423
Flag,
2524
JSON_TYPE,
26-
NS_HTML,
25+
Namespace,
2726
NodeType,
2827
SVG_TYPE,
28+
_CC_NUMBER_SIGN: CC_NUMBER_SIGN,
2929
_S,
3030
_attributeCountOf,
3131
_attributeList,
@@ -77,6 +77,8 @@ const {
7777
startsWithWs,
7878
stripAsciiWhitespace
7979
} = require("./syntax-parser");
80+
81+
const NS_HTML = Namespace.HTML;
8082
/** @typedef {import("./syntax-parser").EmbeddedSourceRenderer} EmbeddedSourceRenderer */
8183
/** @typedef {import("./syntax-parser").DeferredEmbeddedSource} DeferredEmbeddedSource */
8284
/** @typedef {import("./syntax-parser").HtmlNodeRef} HtmlNodeRef */

‎test/benchmarkCases/css-parser-tailwind-unit/index.bench.mjs‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ const {
2222
parseAComponentValue,
2323
parseAListOfComponentValues,
2424
parseACommaSeparatedListOfComponentValues,
25-
TT_LEFT_CURLY_BRACKET,
26-
TT_RIGHT_CURLY_BRACKET,
27-
TT_SEMICOLON
25+
TokenType
2826
} = cssParser;
2927

3028
// Real-world ~1.9 MiB minified stylesheet (Tailwind), shared with the
@@ -61,9 +59,9 @@ function expand(css) {
6159
pos = t.end;
6260
out += css.slice(t.start, t.end);
6361
out +=
64-
t.type === TT_LEFT_CURLY_BRACKET ||
65-
t.type === TT_RIGHT_CURLY_BRACKET ||
66-
t.type === TT_SEMICOLON
62+
t.type === TokenType.LeftCurlyBracket ||
63+
t.type === TokenType.RightCurlyBracket ||
64+
t.type === TokenType.Semicolon
6765
? "\n"
6866
: " ";
6967
}

0 commit comments

Comments
 (0)