Commit graph

59 commits

Author SHA1 Message Date
Boshen
187299bd8f
feat(prettier): add print_call_expression for CallExpression and NewExpression (#1340) 2023-11-16 11:47:30 +08:00
Boshen
cf3318c609
refactor(prettier): use allocator for IfBreak's Box (#1339) 2023-11-16 11:33:30 +08:00
Dunqing
b443a0798f
fix(prettier): remove unnecessary group and ident in BinaryishExpression (#1337) 2023-11-16 11:16:26 +08:00
Dunqing
8d7c0d73d1
feat(prettier): improve the format of ReturnStatement to support longer width (#1336) 2023-11-16 11:10:27 +08:00
Dunqing
2bed242016
feat(prettier): Doc::IfBreak should a accept single doc and add if_break macro (#1335) 2023-11-16 11:03:53 +08:00
Boshen
a2f9c8c6b7
feat(prettier): add more expression formatting logic (#1334) 2023-11-15 16:36:15 +00:00
Boshen
9594f62caf
feat(prettier): add print_block (#1333) 2023-11-15 14:56:20 +00:00
Wenzhe Wang
f04921fa95
feat(prettier): format WithStatement (#1332) 2023-11-15 14:49:52 +00:00
Boshen
45d5cf7e0a
chore(prettier): move format.rs to its own directory (#1331) 2023-11-15 13:08:29 +00:00
Boshen
33a14902d3
perf(prettier): preallocate the output buffer (#1328) 2023-11-15 14:24:47 +08:00
Cameron
e5a34366af
fix(prettier) Fix printing of array expressions (#1325) 2023-11-15 10:18:32 +08:00
Cameron
9c170b89ff
refactor(prettier) Remove flat_contents from IfBreak (#1324) 2023-11-15 10:13:30 +08:00
Cameron
01a3a77ead
fix(prettier) indent block stmts correctly (#1323) 2023-11-15 09:59:11 +08:00
Cameron
ebcd707e8b
feat(prettier) Get indentation working (#1322) 2023-11-15 09:58:35 +08:00
Boshen
be043c37e9
refactor(ast): VariableDeclarationKind::to_string -> as_str (#1321) 2023-11-14 15:28:13 +00:00
Boshen
d2b73122c5
refactor(prettier): add a static string ss construction macro (#1320) 2023-11-14 15:20:50 +00:00
Dunqing
96753c2efd
feat(prettier): add HardLine if the next line of the VariableDeclartion is a empty line (#1318) 2023-11-14 23:04:27 +08:00
Dunqing
ca7e0ab208
fix(prettier): calculate overflow for ObjectPattern (#1317) 2023-11-14 22:58:09 +08:00
Boshen
5773af9536
feat(prettier): complete PrettireOptions (#1319) 2023-11-14 14:57:19 +00:00
Dunqing
dee24c7092
feat(prettier): implement format function for PropertyKey (#1311) 2023-11-14 21:22:30 +08:00
Dunqing
fae2813683
feat(prettier): implement format function for BindingProperty (#1310) 2023-11-14 21:16:31 +08:00
Dunqing
211275fd7f
feat(prettier): implement format function for ObjectPattern (#1309)
feat(prettier): implement format function for ObjectPattern

feat: replace space with Line
2023-11-14 21:09:26 +08:00
Dunqing
f597a43d8a
feat(prettier): implement format function for StringLiteral (#1308) 2023-11-14 21:03:26 +08:00
Dunqing
e26e8dd6f8
feat(prettier): implement format function for CallExpression (#1307) 2023-11-14 20:55:26 +08:00
Dunqing
e0af69a884
feat(prettier): implement format function for BindingPattern (#1306)
feat(prettier): implement format function for BindingPattern

feat: full match
2023-11-14 20:48:34 +08:00
Dunqing
071efded7c
feat(prettier): implement format function for VariableDeclarator (#1305) 2023-11-14 20:40:29 +08:00
Cameron
6a062a882f
fix(prettier) Fix subtract with overflow (#1314) 2023-11-14 20:35:33 +08:00
Boshen
5f316626f6
feat(prettier): add the basics of comment printing (#1313) 2023-11-14 12:32:03 +00:00
Dunqing
4967ca2cdb
feat(prettier): implement format function for VariableDeclaration (#1304) 2023-11-14 20:30:27 +08:00
magic-akari
ac6f5884a5
feat(prettier): implement format for MemberExpression (#1312) 2023-11-14 20:23:50 +08:00
Cameron
891d353ade
feat(prettier) Improve function printing (#1301) 2023-11-14 17:14:34 +08:00
magic-akari
3fd97505d1
feat(prettier): implement format for ClassElement (#1299) 2023-11-14 15:16:05 +08:00
magic-akari
b95ec556fc
feat(prettier): implement format for StaticBlock (#1298) 2023-11-14 15:15:47 +08:00
magic-akari
73e0bd7edf
feat(prettier): implement format for CatchClause (#1297) 2023-11-14 15:15:18 +08:00
Boshen
90c7fee1bc
refactor(prettier): make the printer code more rusty (#1296) 2023-11-14 13:54:32 +08:00
Dunqing
6c1435a3c1
feat(prettier): implement format for ContinueStatement (#1293)
Deleted by mistake at #1285

Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-14 05:49:04 +00:00
Boshen
a8ecdaecb9
refactor(prettier): move printer.rs to its own folder (#1294) 2023-11-14 13:42:41 +08:00
Cameron
92cd6df08a
feat(printer) A Working Printer (#1287)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-14 05:00:57 +00:00
Cameron
be181c1bc8
feat(printer) Print BinaryExpression (#1282) 2023-11-14 12:20:25 +08:00
Dunqing
c15b76b92d
feat(prettier): add HardLine and Semicolon in ExpressionStatement (#1285) 2023-11-14 12:14:45 +08:00
Cameron
b528af1b93
feat(printer) Print SwitchStatement (#1281) 2023-11-14 12:14:02 +08:00
Cameron
7182cc6ebe
feat(printer) Print Argument (#1280) 2023-11-14 09:50:30 +08:00
Cameron
232b93ba41
feat(printer) Print ArrayExpression (#1279) 2023-11-14 09:45:26 +08:00
Cameron
561c73d88c
feat(printer) Basic Printer options (#1278) 2023-11-14 09:37:18 +08:00
Dunqing
0297cf7cc7
fix(prettier): remove redundant newline and semicolons from the Program (#1284) 2023-11-14 09:36:37 +08:00
Dunqing
3942256af4
feat(prettier): correctly format the NumberLiteral (#1283) 2023-11-14 09:27:56 +08:00
Cameron
3db074b87c
feat(printer) Print TryStatement (#1277) 2023-11-13 19:16:05 +00:00
Cameron
2adfec6c0f
feat(printer) Print ContinueStatement (#1276) 2023-11-13 18:29:28 +00:00
Cameron
4ea0aacdb4
feat(printer) Print ThrowStatement (#1275) 2023-11-13 18:28:14 +00:00
Cameron
f892a9e8a1
feat(printer) Print BreakStatement (#1274) 2023-11-13 18:28:06 +00:00