From 11197d26cc41e0e038492c3bf7190abe68c6e38f Mon Sep 17 00:00:00 2001 From: Aaron Madlon-Kay Date: Sat, 26 Aug 2023 20:09:59 +0900 Subject: [PATCH] Seal abstract AST classes --- lib/src/org.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/org.dart b/lib/src/org.dart index 2bdaba0..05125d9 100644 --- a/lib/src/org.dart +++ b/lib/src/org.dart @@ -38,7 +38,7 @@ String parseOrgIdUrl(String url) { } /// The base type of all Org AST objects -abstract class OrgNode { +sealed class OrgNode { /// The children of this node. May be empty. List get children => const []; @@ -66,7 +66,7 @@ abstract class OrgNode { } /// A node potentially containing [OrgSection]s -abstract class OrgTree extends OrgNode { +sealed class OrgTree extends OrgNode { OrgTree(this.content, [Iterable? sections]) : sections = List.unmodifiable(sections ?? const []); @@ -524,7 +524,7 @@ class OrgTable extends OrgNode with IndentedElement { String toString() => 'OrgTable'; } -abstract class OrgTableRow extends OrgNode { +sealed class OrgTableRow extends OrgNode { OrgTableRow(this.indent); final String indent; @@ -686,7 +686,7 @@ class OrgList extends OrgNode with IndentedElement { String toString() => 'OrgList'; } -abstract class OrgListItem extends OrgNode { +sealed class OrgListItem extends OrgNode { OrgListItem(this.indent, this.bullet, this.checkbox, this.body); final String indent;