File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -529,6 +529,13 @@ fn custom_handlers(node: &Node) -> TokenStream {
529
529
"TypeCast" => quote ! {
530
530
tokens. push( TokenProperty :: from( Token :: Typecast ) ) ;
531
531
} ,
532
+ "CreateDomainStmt" => quote ! {
533
+ tokens. push( TokenProperty :: from( Token :: Create ) ) ;
534
+ tokens. push( TokenProperty :: from( Token :: DomainP ) ) ;
535
+ if n. type_name. is_some( ) {
536
+ tokens. push( TokenProperty :: from( Token :: As ) ) ;
537
+ }
538
+ } ,
532
539
_ => quote ! { } ,
533
540
}
534
541
}
Original file line number Diff line number Diff line change @@ -91,4 +91,18 @@ mod tests {
91
91
] ,
92
92
)
93
93
}
94
+
95
+ #[ test]
96
+ fn test_create_domain ( ) {
97
+ test_get_node_properties (
98
+ "create domain us_postal_code as text check (value is not null);" ,
99
+ SyntaxKind :: CreateDomainStmt ,
100
+ vec ! [
101
+ TokenProperty :: from( SyntaxKind :: Create ) ,
102
+ TokenProperty :: from( SyntaxKind :: DomainP ) ,
103
+ TokenProperty :: from( SyntaxKind :: As ) ,
104
+ TokenProperty :: from( "us_postal_code" . to_string( ) ) ,
105
+ ] ,
106
+ )
107
+ }
94
108
}
You can’t perform that action at this time.
0 commit comments