Skip to content

Commit

Permalink
Comments; formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams committed Jan 26, 2024
1 parent fa77631 commit e47a21c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Sources/Lotsawa/Grammar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ public struct Symbol: Hashable, Comparable {
public static var maxID: ID { (1 << 14) - 1 }
}

// A type that can represent the size of any grammar.
/// A type that can represent the size of any grammar.
///
/// A grammar's size is defined to be the sum of the sizes of its BNF rules, where the size of a
/// rule is one greater than the size of its right-hand side.
public typealias GrammarSize = UInt16

/// A rule identifier for public consumption.
Expand All @@ -32,9 +35,8 @@ public struct RuleID: Hashable, Comparable {
}


/// A collection of Backus-Naur Form (BNF) rules, each defining a symbol
/// on its left-hand side in terms of a string of symbols on its right-hand
/// side.
/// A collection of Backus-Naur Form (BNF) rules, each defining a symbol on its left-hand side in
/// terms of a string of symbols on its right-hand side.
///
/// - Parameter StoredSymbol: storage representation of `Symbol.id` values in this grammar.
public struct Grammar<StoredSymbol: SignedInteger & FixedWidthInteger> {
Expand Down

0 comments on commit e47a21c

Please sign in to comment.