Skip to content

Commit

Permalink
some barebones documentation on the new origin
Browse files Browse the repository at this point in the history
  • Loading branch information
Naum-Tomov committed Oct 12, 2023
1 parent 6da59fa commit 76a0ebf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/col/vct/col/origin/Origin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ case object Origin {
}.mkString(BOLD_HR, HR, BOLD_HR)
}

/***
* This trait is used to box information about Origins in a structured manner.
*/
trait OriginContent

case class PreferredName(preferredName: String) extends OriginContent
Expand All @@ -38,6 +41,10 @@ case class OriginCols(cols: Option[(Int, Int)]) extends OriginContent
case class OriginFilename(filename: String) extends OriginContent
case class InlineBipContext(bipContext: String) extends OriginContent

/**
* A sequence of OriginContents. This sequence can be mutated (add, remove, replace) for convenience.
* @param originContents The known origin contents at the time of Origin creation. Can be empty for a new Origin.
*/
case class Origin(originContents: Seq[OriginContent]) extends Blame[VerificationFailure] {

def addPrefName(name: String): Origin = {
Expand Down Expand Up @@ -494,3 +501,4 @@ case object RedirectOrigin {




0 comments on commit 76a0ebf

Please sign in to comment.