Skip to content

Commit

Permalink
Changes to whitespace in signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Jan 23, 2025
1 parent c937a26 commit cacd7a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/core/serpentine.Path.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ object Path:
ElementType,
PlatformType: {Navigable by ElementType, Radical from RootType}]
(root0: RootType, elements: List[ElementType])
: Path on PlatformType =
: Path on PlatformType =
if elements.isEmpty then root0 else
Path.from[PlatformType]
(PlatformType.rootText(root0),
Expand All @@ -81,7 +81,7 @@ object Path:

private def from[PlatformType]
(root0: Text, elements: List[Text], separator: Text, caseSensitivity: Case)
: Path on PlatformType =
: Path on PlatformType =
new Path(root0, elements, separator, caseSensitivity):
type Platform = PlatformType

Expand Down Expand Up @@ -128,7 +128,7 @@ extends Pathlike:
textDescent.prim.let(navigable.element(_))

def peer(using navigable: Platform is Navigable)(name: navigable.Operand)
: Path on Platform raises PathError =
: Path on Platform raises PathError =
parent.let(_ / name).lest(PathError(PathError.Reason.RootParent))

def descent(using navigable: Platform is Navigable): List[navigable.Operand] =
Expand Down Expand Up @@ -175,7 +175,7 @@ extends Pathlike:
val right0 = right.textDescent.drop(-difference)

def recur(left: List[Text], right: List[Text], size: Int, count: Int)
: Path on Platform =
: Path on Platform =
if left.isEmpty
then Path.from(textRoot, left0.drop(size - count), separator, caseSensitivity)
else if left.head == right.head then recur(left.tail, right.tail, size + 1, count + 1)
Expand All @@ -190,12 +190,12 @@ extends Pathlike:
(textRoot, textDescent.drop(depth - count), separator, caseSensitivity)

def relativeTo(right: Path on Platform)(using navigable: Platform is Navigable)
: Relative by navigable.Operand raises PathError =
: Relative by navigable.Operand raises PathError =
if textRoot != right.textRoot then abort(PathError(PathError.Reason.DifferentRoots))
val common = conjunction(right).depth
Relative(right.depth - common, textDescent.dropRight(common).map(navigable.element(_)))

def resolve(text: Text)(using Platform is Navigable, Platform is Radical)
: Path on Platform raises PathError =
: Path on Platform raises PathError =
safely(Path.parse(text)).or(safely(this + Relative.parse(text))).or:
abort(PathError(PathError.Reason.InvalidRoot))
6 changes: 3 additions & 3 deletions src/core/serpentine.Relative.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ object Relative:
parse(_)

def parse[ElementType](using navigable: Navigable by ElementType)(text: Text)
: Relative by ElementType =
: Relative by ElementType =
def recur(start: Int, ascent: Int, elements: List[ElementType]): Relative by ElementType =
if start >= text.length then Relative(ascent, elements)
else
Expand All @@ -62,11 +62,11 @@ object Relative:

def apply[ElementType](using navigable: Navigable by ElementType)
(ascent0: Int, descent0: List[ElementType])
: Relative by ElementType =
: Relative by ElementType =
Relative.from[ElementType](ascent0, descent0.map(navigable.makeElement(_)), navigable.separator)

private def from[ElementType](ascent0: Int, descent0: List[Text], separator: Text)
: Relative by ElementType =
: Relative by ElementType =
new Relative(ascent0, descent0, separator):
type Operand = ElementType

Expand Down
2 changes: 1 addition & 1 deletion src/core/serpentine.Serpentine.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object Serpentine:
object `/`:
def unapply[PlatformType <: AnyRef & Matchable: {Navigable, Radical}, ElementType]
(path: Path on PlatformType)
: Option[(Path on PlatformType, PlatformType.Operand)] =
: Option[(Path on PlatformType, PlatformType.Operand)] =
path.textDescent match
case Nil => None
case head :: Nil => Some((PlatformType.root(path.textRoot), PlatformType.element(head)))
Expand Down

0 comments on commit cacd7a4

Please sign in to comment.