diff --git a/crates/squawk_syntax/src/ast/generated/nodes.rs b/crates/squawk_syntax/src/ast/generated/nodes.rs index e0f0aec0..c038b9ec 100644 --- a/crates/squawk_syntax/src/ast/generated/nodes.rs +++ b/crates/squawk_syntax/src/ast/generated/nodes.rs @@ -5414,6 +5414,10 @@ impl DropAccessMethod { support::token(&self.syntax, SyntaxKind::ACCESS_KW) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } @@ -5421,6 +5425,10 @@ impl DropAccessMethod { pub fn method_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::METHOD_KW) } + #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -5441,9 +5449,17 @@ impl DropAggregate { support::token(&self.syntax, SyntaxKind::AGGREGATE_KW) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } + #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -5491,6 +5507,10 @@ impl DropCollation { support::children(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn collation_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::COLLATION_KW) } @@ -5498,6 +5518,10 @@ impl DropCollation { pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } + #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -5676,6 +5700,10 @@ impl DropEventTrigger { support::child(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } @@ -5684,6 +5712,10 @@ impl DropEventTrigger { support::token(&self.syntax, SyntaxKind::EVENT_KW) } #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } + #[inline] pub fn trigger_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::TRIGGER_KW) } @@ -5722,6 +5754,10 @@ impl DropExtension { support::children(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } @@ -5729,6 +5765,10 @@ impl DropExtension { pub fn extension_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::EXTENSION_KW) } + #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -5892,6 +5932,10 @@ impl DropIndex { support::children(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn concurrently_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::CONCURRENTLY_KW) } @@ -5903,6 +5947,10 @@ impl DropIndex { pub fn index_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::INDEX_KW) } + #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -6092,6 +6140,10 @@ impl DropOperatorClass { support::child(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn class_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::CLASS_KW) } @@ -6104,6 +6156,10 @@ impl DropOperatorClass { support::token(&self.syntax, SyntaxKind::OPERATOR_KW) } #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } + #[inline] pub fn using_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::USING_KW) } @@ -6201,6 +6257,10 @@ impl DropPolicy { support::child(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } @@ -6208,6 +6268,10 @@ impl DropPolicy { pub fn policy_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::POLICY_KW) } + #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -6224,6 +6288,10 @@ impl DropProcedure { support::child(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } @@ -6231,6 +6299,10 @@ impl DropProcedure { pub fn procedure_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::PROCEDURE_KW) } + #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -6247,6 +6319,10 @@ impl DropPublication { support::children(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } @@ -6254,6 +6330,10 @@ impl DropPublication { pub fn publication_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::PUBLICATION_KW) } + #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -6390,10 +6470,18 @@ impl DropSequence { support::children(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } + #[inline] pub fn sequence_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::SEQUENCE_KW) } @@ -6413,10 +6501,18 @@ impl DropServer { support::child(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } + #[inline] pub fn server_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::SERVER_KW) } @@ -6436,10 +6532,18 @@ impl DropStatistics { support::children(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } + #[inline] pub fn statistics_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::STATISTICS_KW) } @@ -6459,10 +6563,18 @@ impl DropSubscription { support::child(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } + #[inline] pub fn subscription_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::SUBSCRIPTION_KW) } @@ -6867,10 +6979,18 @@ impl DropView { support::child(&self.syntax) } #[inline] + pub fn cascade_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::CASCADE_KW) + } + #[inline] pub fn drop_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::DROP_KW) } #[inline] + pub fn restrict_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::RESTRICT_KW) + } + #[inline] pub fn view_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::VIEW_KW) } @@ -7599,6 +7719,10 @@ impl FromItem { support::token(&self.syntax, SyntaxKind::R_PAREN) } #[inline] + pub fn star_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::STAR) + } + #[inline] pub fn from_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::FROM_KW) } @@ -15090,17 +15214,13 @@ pub struct UsingOnClause { pub(crate) syntax: SyntaxNode, } impl UsingOnClause { - #[inline] - pub fn expr(&self) -> Option { - support::child(&self.syntax) - } #[inline] pub fn from_item(&self) -> Option { support::child(&self.syntax) } #[inline] - pub fn on_token(&self) -> Option { - support::token(&self.syntax, SyntaxKind::ON_KW) + pub fn on_clause(&self) -> Option { + support::child(&self.syntax) } #[inline] pub fn using_token(&self) -> Option { diff --git a/crates/squawk_syntax/src/postgresql.ungram b/crates/squawk_syntax/src/postgresql.ungram index 45617608..8ebb77fd 100644 --- a/crates/squawk_syntax/src/postgresql.ungram +++ b/crates/squawk_syntax/src/postgresql.ungram @@ -1043,13 +1043,16 @@ IfExists = 'if' 'exists' DropType = - 'drop' 'type' IfExists? (Path (',' Path)*) ('cascade' | 'restrict')? + 'drop' 'type' IfExists? (Path (',' Path)*) + ('cascade' | 'restrict')? DropIndex = 'drop' 'index' 'concurrently'? IfExists? (Path (',' Path)*) + ('cascade' | 'restrict')? DropTable = - 'drop' 'table' IfExists? (Path (',' Path)) ('cascade' | 'restrict')? + 'drop' 'table' IfExists? (Path (',' Path)) + ('cascade' | 'restrict')? DropDatabase = 'drop' 'database' IfExists? NameRef @@ -1677,7 +1680,7 @@ TablesampleClause = 'tablesample' CallExpr RepeatableClause? FromItem = - 'only'? (NameRef | FieldExpr) Alias? TablesampleClause? + 'only'? (NameRef | FieldExpr) '*'? Alias? TablesampleClause? | 'lateral'? ParenSelect Alias? | 'lateral'? CallExpr ('with' 'ordinality')? Alias? | 'lateral'? JsonTable Alias? @@ -2280,20 +2283,22 @@ FunctionSig = DropForeignDataWrapper = 'drop' 'foreign' 'data' 'wrapper' IfExists? (NameRef (',' NameRef)*) - ('cascade' | 'restrict') + ('cascade' | 'restrict')? DropForeignTable = 'drop' 'foreign' 'table' IfExists? Path - ('cascade' | 'restrict') + ('cascade' | 'restrict')? DropAccessMethod = 'drop' 'access' 'method' IfExists? NameRef + ('cascade' | 'restrict')? Aggregate = Path ParamList DropAggregate = 'drop' 'aggregate' IfExists? (Aggregate (',' Aggregate)*) + ('cascade' | 'restrict')? DropCast = 'drop' 'cast' IfExists? CastSig @@ -2304,9 +2309,11 @@ CastSig = DropCollation = 'drop' 'collation' IfExists? (Path (',' Path)*) + ('cascade' | 'restrict')? DropConversion = - 'drop' 'conversion' IfExists? Path ('cascade' | 'restrict') + 'drop' 'conversion' IfExists? Path + ('cascade' | 'restrict')? DropDomain = 'drop' 'domain' IfExists? (Path (',' Path)*) @@ -2314,19 +2321,23 @@ DropDomain = DropEventTrigger = 'drop' 'event' 'trigger' IfExists? NameRef + ('cascade' | 'restrict')? DropExtension = 'drop' 'extension' IfExists? (NameRef (',' NameRef)*) + ('cascade' | 'restrict')? DropMaterializedView = 'drop' 'materialized' 'view' IfExists? (Path (',' Path)*) ('cascade' | 'restrict')? DropOperatorFamily = - 'drop' 'operator' 'family' IfExists? Path 'using' NameRef ('cascade' | 'restrict') + 'drop' 'operator' 'family' IfExists? Path 'using' NameRef + ('cascade' | 'restrict')? DropOperator = - 'drop' 'operator' IfExists? OpSigList ('cascade' | 'restrict') + 'drop' 'operator' IfExists? OpSigList + ('cascade' | 'restrict')? OpSigList = (OpSig (',' OpSig)*) @@ -2336,57 +2347,73 @@ OpSig = DropOperatorClass = 'drop' 'operator' 'class' IfExists? Path 'using' NameRef + ('cascade' | 'restrict')? DropOwned = - 'drop' 'owned' 'by' RoleList ('cascade' | 'restrict')? + 'drop' 'owned' 'by' RoleList + ('cascade' | 'restrict')? DropPolicy = 'drop' 'policy' IfExists? NameRef OnTable + ('cascade' | 'restrict')? DropProcedure = 'drop' 'procedure' IfExists? FunctionSigList + ('cascade' | 'restrict')? DropPublication = 'drop' 'publication' IfExists? (NameRef (',' NameRef)*) + ('cascade' | 'restrict')? DropRole = 'drop' 'role' IfExists? (NameRef (',' NameRef)*) DropRoutine = - 'drop' 'routine' IfExists? FunctionSigList ('cascade' | 'restrict')? + 'drop' 'routine' IfExists? FunctionSigList + ('cascade' | 'restrict')? DropRule = - 'drop' 'rule' IfExists? NameRef OnTable ('cascade' | 'restrict')? + 'drop' 'rule' IfExists? NameRef OnTable + ('cascade' | 'restrict')? DropSequence = 'drop' 'sequence' IfExists? (Path (',' Path)*) + ('cascade' | 'restrict')? DropServer = 'drop' 'server' IfExists? NameRef + ('cascade' | 'restrict')? DropStatistics = 'drop' 'statistics' IfExists? (Path (',' Path)*) + ('cascade' | 'restrict')? DropSubscription = 'drop' 'subscription' IfExists? NameRef + ('cascade' | 'restrict')? DropTablespace = 'drop' 'tablespace' IfExists? NameRef DropTextSearchParser = - 'drop' 'text' 'search' 'parser' IfExists? Path ('cascade' | 'restrict')? + 'drop' 'text' 'search' 'parser' IfExists? Path + ('cascade' | 'restrict')? DropTextSearchConfig = - 'drop' 'text' 'search' 'configuration' IfExists? Path ('cascade' | 'restrict')? + 'drop' 'text' 'search' 'configuration' IfExists? Path + ('cascade' | 'restrict')? DropTextSearchDict = - 'drop' 'text' 'search' 'dictionary' IfExists? Path ('cascade' | 'restrict')? + 'drop' 'text' 'search' 'dictionary' IfExists? Path + ('cascade' | 'restrict')? DropTextSearchTemplate = - 'drop' 'text' 'search' 'template' IfExists? Path ('cascade' | 'restrict')? + 'drop' 'text' 'search' 'template' IfExists? Path + ('cascade' | 'restrict')? DropTransform = - 'drop' 'transform' IfExists? 'for' ty:Type 'language' language:NameRef ('cascade' | 'restrict')? + 'drop' 'transform' IfExists? 'for' ty:Type 'language' language:NameRef + ('cascade' | 'restrict')? DropUser = 'drop' 'user' IfExists? (NameRef (',' NameRef)*) @@ -2396,6 +2423,7 @@ DropUserMapping = DropView = 'drop' 'view' IfExists? Path + ('cascade' | 'restrict')? Explain = 'explain' @@ -2644,7 +2672,8 @@ TriggerEventList = (TriggerEvent ('or' TriggerEvent)*) DropSchema = - 'drop' 'schema' IfExists? (NameRef (',' NameRef)*) ('cascade' | 'restrict')? + 'drop' 'schema' IfExists? (NameRef (',' NameRef)*) + ('cascade' | 'restrict')? CreateSchema = 'create' 'schema' IfNotExists? (SchemaAuthorization | Name) SchemaElement* @@ -2661,7 +2690,8 @@ SchemaElement = | Grant DropTrigger = - 'drop' 'trigger' IfExists? Path OnTable ('cascade' | 'restrict')? + 'drop' 'trigger' IfExists? Path OnTable + ('cascade' | 'restrict')? OnTable = 'on' Path @@ -2807,7 +2837,8 @@ DetachPartition = 'detach' 'partition' DropColumn = - 'drop' 'column'? IfExists? NameRef ('restrict' | 'cascade')? + 'drop' 'column'? IfExists? NameRef + ('restrict' | 'cascade')? AddColumn = 'add' 'column'? IfNotExists? Name Type Collate? (Constraint (',' Constraint)*)?