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 {
4646 {
4747 type : TokenType . NUMBER ,
4848 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,
5050 } ,
5151 // RESERVED_PHRASE is matched before all other keyword tokens
5252 // 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) {
5151 ) ;
5252 } ) ;
5353
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+
5466 it ( 'supports @variables' , ( ) => {
5567 expect ( format ( 'SELECT @foo, @some_long.var$with$special.chars' ) ) . toBe ( dedent `
5668 SELECT
You can’t perform that action at this time.
0 commit comments