Skip to content

Commit

Permalink
Seal abstract AST classes
Browse files Browse the repository at this point in the history
  • Loading branch information
amake committed Aug 27, 2023
1 parent 4128a39 commit 11197d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/org.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<OrgNode> get children => const [];

Expand Down Expand Up @@ -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<OrgSection>? sections])
: sections = List.unmodifiable(sections ?? const <OrgSection>[]);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 11197d2

Please sign in to comment.