Skip to content

Commit 6624acf

Browse files
fix zeroturnaround#123, add hex string type
1 parent 9bf3f69 commit 6624acf

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/core/regexFactory.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const patterns = {
5050
'""': '(("[^"\\\\]*(?:\\\\.[^"\\\\]*)*("|$))+)',
5151
"''": "(('[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)",
5252
"N''": "((N'[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)",
53+
"x''": "((x'[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)",
5354
"U&''": "((U&'[^'\\\\]*(?:\\\\.[^'\\\\]*)*('|$))+)",
5455
'U&""': '((U&"[^"\\\\]*(?:\\\\.[^"\\\\]*)*("|$))+)',
5556
'$$': '((?<tag>\\$\\w*\\$)[\\s\\S]*?(?:\\k<tag>|$))',

src/languages/Db2Formatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ export default class Db2Formatter extends Formatter {
866866
...Object.values(reservedKeywords).reduce((acc, arr) => [...acc, ...arr], []),
867867
];
868868

869-
static stringTypes: StringPatternType[] = [`""`, "''", '``', '[]'];
869+
static stringTypes: StringPatternType[] = [`""`, "''", '``', '[]', "x''"];
870870
static blockStart = ['('];
871871
static blockEnd = [')'];
872872
static indexedPlaceholderTypes = ['?'];

0 commit comments

Comments
 (0)