From 577abae87d7a73a72d432311a604124bed0a1f4c Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 25 Oct 2026 09:48:40 +0000 Subject: Parse query definitions --- hobgoblin/src/ast/untyped.hob | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'hobgoblin/src') diff --git a/hobgoblin/src/ast/untyped.hob b/hobgoblin/src/ast/untyped.hob index 314eb85..86004f9 100644 --- a/hobgoblin/src/ast/untyped.hob +++ b/hobgoblin/src/ast/untyped.hob @@ -24,6 +24,7 @@ sum UntypedNamespaceStatementNode { variant UntypedDatabaseSchemaDefinitionNode; variant UntypedEnumDefinitionNode; variant UntypedNativeTypeDefinitionNode; + variant UntypedQueryDefinitionNode; variant UntypedStructDefinitionNode; variant UntypedSumDefinitionNode; @@ -57,6 +58,14 @@ struct UntypedNativeTypeDefinitionNode { field source: Source; } +struct UntypedQueryDefinitionNode { + field name: String; + field databaseSchema: UntypedTypeLevelExpressionNode; + field statements: List[UntypedStatementNode]; + field docComment: DocComment; + field source: Source; +} + struct UntypedStructDefinitionNode { field name: String; field typeParams: Option[List[UntypedTypeParamNode]]; @@ -125,6 +134,17 @@ struct UntypedTypeLevelReferenceNode { field source: Source; } +// == Statements == + +sum UntypedStatementNode { + variant UntypedReturnNode; +} + +struct UntypedReturnNode { + field expression: UntypedExpressionNode; + field source: Source; +} + // == Expressions == sum UntypedExpressionNode { -- cgit v1.2.3