File tree 2 files changed +12
-1
lines changed
main/java/com/github/vertical_blank/sqlformatter/core
test/java/com/github/vertical_blank/sqlformatter
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public class Tokenizer {
49
49
public Tokenizer (DialectConfig cfg ) {
50
50
this .WHITESPACE_REGEX = "^(\\ s+)" ;
51
51
this .NUMBER_REGEX = "^((-\\ s*)?[0-9]+(\\ .[0-9]+)?|0x[0-9a-fA-F]+|0b[01]+)\\ b" ;
52
- this .OPERATOR_REGEX = "^(!=|<>|==|<=|>=|!<|!>|\\ |\\ ||::|->>|->|~~\\ *|~~|!~~\\ *|!~~|~\\ *|!~\\ *|!~|.)" ;
52
+ this .OPERATOR_REGEX = "^(!=|<>|==|<=|>=|!<|!>|\\ |\\ ||::|->>|=>| ->|~~\\ *|~~|!~~\\ *|!~~|~\\ *|!~\\ *|!~|.)" ;
53
53
54
54
// this.BLOCK_COMMENT_REGEX = /^(\/\*[^]*?(?:\*\/|$))/;
55
55
this .BLOCK_COMMENT_REGEX = "^(/\\ *(?s).*?(?:\\ */|$))" ;
Original file line number Diff line number Diff line change @@ -58,6 +58,17 @@ public void withNamedParams() {
58
58
" foo = 'bar'" );
59
59
}
60
60
61
+ @ Test
62
+ public void withFatArrow () {
63
+ String format = SqlFormatter .format ("SELECT * FROM tbl WHERE foo => '123'" );
64
+ assertEquals (format , "SELECT\n " +
65
+ " *\n " +
66
+ "FROM\n " +
67
+ " tbl\n " +
68
+ "WHERE\n " +
69
+ " foo => '123'" );
70
+ }
71
+
61
72
@ Test
62
73
public void withIndexedParams () {
63
74
String format = SqlFormatter .format ("SELECT * FROM tbl WHERE foo = ?" , Arrays .asList ("'bar'" ));
You can’t perform that action at this time.
0 commit comments