Skip to content

Commit a39eb8e

Browse files
authored
Fix printing of tagged template literals (#8018)
* Fix printing of tagged template literals * CHANGELOG
1 parent 6d9c5cd commit a39eb8e

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#### :bug: Bug fix
2222

23+
- Fix printing of tagged template literals. https://github.com/rescript-lang/rescript/pull/8018
24+
2325
#### :memo: Documentation
2426

2527
#### :nail_care: Polish

compiler/syntax/src/res_parsetree_viewer.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,8 @@ let is_printable_attribute attr =
534534
| ( {
535535
Location.txt =
536536
( "res.iflet" | "res.braces" | "ns.braces" | "JSX" | "res.await"
537-
| "res.template" | "res.ternary" | "res.inlineRecordDefinition" );
537+
| "res.template" | "res.taggedTemplate" | "res.ternary"
538+
| "res.inlineRecordDefinition" );
538539
},
539540
_ ) ->
540541
false

tests/syntax_tests/data/printer/expr/expected/templateLiteral.res.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,7 @@ let box = css`
119119
}
120120
}
121121
`)
122+
123+
sql
124+
->SQL.query`INSERT INTO my_table (a, b, c) VALUES ${a}, ${b}, ${c}`
125+
->Promise.thenResolve(Console.log)

tests/syntax_tests/data/printer/expr/templateLiteral.res

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,7 @@ let box = css`
119119
}
120120
}
121121
`)
122+
123+
sql
124+
->SQL.query`INSERT INTO my_table (a, b, c) VALUES ${a}, ${b}, ${c}`
125+
->Promise.thenResolve(Console.log)

0 commit comments

Comments
 (0)