File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export default class Tokenizer {
46
46
{
47
47
type : TokenType . NUMBER ,
48
48
regex :
49
- / (?: 0 x [ 0 - 9 a - f A - F ] + | 0 b [ 0 1 ] + | (?: - \s * ) ? [ 0 - 9 ] + (?: \. [ 0 - 9 ] * ) ? (?: [ e E ] [ - + ] ? [ 0 - 9 ] + (?: \. [ 0 - 9 ] + ) ? ) ? ) (? ! \w ) / uy,
49
+ / (?: 0 x [ 0 - 9 a - f A - F ] + | 0 b [ 0 1 ] + | (?: - \s * ) ? [ 0 - 9 ] + (?: \. [ 0 - 9 ] * ) ? (?: [ e E ] [ - + ] ? [ 0 - 9 ] + (?: \. [ 0 - 9 ] + ) ? ) ? ) (? ! [ \w \p { Alphabetic } ] ) / uy,
50
50
} ,
51
51
// RESERVED_PHRASE is matched before all other keyword tokens
52
52
// to e.g. prioritize matching "TIMESTAMP WITH TIME ZONE" phrase over "WITH" clause.
Original file line number Diff line number Diff line change @@ -51,6 +51,18 @@ export default function behavesLikeMariaDbFormatter(format: FormatFn) {
51
51
) ;
52
52
} ) ;
53
53
54
+ // regression test for sql-formatter#651
55
+ it ( 'supports unicode identifiers that start with numbers' , ( ) => {
56
+ expect ( format ( 'SELECT 1ä FROM tbl' ) ) . toBe (
57
+ dedent `
58
+ SELECT
59
+ 1ä
60
+ FROM
61
+ tbl
62
+ `
63
+ ) ;
64
+ } ) ;
65
+
54
66
it ( 'supports @variables' , ( ) => {
55
67
expect ( format ( 'SELECT @foo, @some_long.var$with$special.chars' ) ) . toBe ( dedent `
56
68
SELECT
You can’t perform that action at this time.
0 commit comments