File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export default class Tokenizer {
19
19
this . LINE_COMMENT_REGEX = / ^ ( (?: # | - - ) .* ?(?: \n | $ ) ) / ;
20
20
this . BLOCK_COMMENT_REGEX = / ^ ( \/ \* [ ^ ] * ?(?: \* \/ | $ ) ) / ;
21
21
this . NUMBER_REGEX = / ^ ( ( - \s * ) ? [ 0 - 9 ] + ( \. [ 0 - 9 ] + ) ? | 0 x [ 0 - 9 a - f A - F ] + | 0 b [ 0 1 ] + ) \b / ;
22
- this . OPERATOR_REGEX = / ^ ( ! = | < > | = = | < = | > = | ! < | ! > | \| \| | .) / ;
22
+ this . OPERATOR_REGEX = / ^ ( ! = | < > | = = | < = | > = | ! < | ! > | \| \| | : : | - > > | - > | .) / ;
23
23
24
24
this . RESERVED_TOPLEVEL_REGEX = this . createReservedWordRegex ( cfg . reservedToplevelWords ) ;
25
25
this . RESERVED_NEWLINE_REGEX = this . createReservedWordRegex ( cfg . reservedNewlineWords ) ;
Original file line number Diff line number Diff line change @@ -432,4 +432,10 @@ export default function behavesLikeSqlFormatter(language) {
432
432
expect ( format ( "'foo \\' JOIN bar'" ) ) . toBe ( "'foo \\' JOIN bar'\n" ) ;
433
433
expect ( format ( "`foo `` JOIN bar`" ) ) . toBe ( "`foo `` JOIN bar`\n" ) ;
434
434
} ) ;
435
+
436
+ it ( "formats postgres specific operators" , function ( ) {
437
+ expect ( format ( "column::int" ) ) . toBe ( "column :: int\n" ) ;
438
+ expect ( format ( "v->2" ) ) . toBe ( "v -> 2\n" ) ;
439
+ expect ( format ( "v->>2" ) ) . toBe ( "v ->> 2\n" ) ;
440
+ } ) ;
435
441
}
You can’t perform that action at this time.
0 commit comments