Skip to content

Commit 6f8418b

Browse files
committed
fix: support define stmt
1 parent d8c7b3e commit 6f8418b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

crates/codegen/src/get_node_properties.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,9 @@ fn custom_handlers(node: &Node) -> TokenStream {
630630
} }
631631
// if its a list, we handle it in the handler for `List`
632632
},
633+
protobuf::ObjectType::ObjectType => {
634+
tokens.push(TokenProperty::from(Token::TypeP));
635+
},
633636
_ => panic!("Unknown DefineStmt {:#?}", n.kind()),
634637
}
635638
},

crates/parser/src/codegen.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,19 @@ mod tests {
272272

273273
#[test]
274274
fn test_create_type() {
275+
test_get_node_properties(
276+
"create type type1",
277+
SyntaxKind::DefineStmt,
278+
vec![
279+
TokenProperty::from(SyntaxKind::Create),
280+
TokenProperty::from(SyntaxKind::TypeP),
281+
TokenProperty::from("type1".to_string()),
282+
],
283+
)
284+
}
285+
286+
#[test]
287+
fn test_create_composite_type() {
275288
test_get_node_properties(
276289
"create type type1 as (attr1 int4, attr2 bool);",
277290
SyntaxKind::CompositeTypeStmt,

0 commit comments

Comments
 (0)