Add vscode extension, command line argument, and positioned error handling.

This commit is contained in:
2024-07-04 23:40:38 -04:00
parent 0cad438f4d
commit b9f921ab3b
24 changed files with 5701 additions and 98 deletions

View File

@@ -57,10 +57,13 @@ best : Nat -> Nat -> Doc -> DOC
best w k x = be w k [(0,x)]
-- Public interface
public export
interface Pretty a where
pretty : a -> Doc
export
pretty : Nat -> Doc -> String
pretty w x = layout (best w 0 x)
render : Nat -> Doc -> String
render w x = layout (best w 0 x)
public export
Semigroup Doc where x <+> y = Seq x (Seq (Text " ") y)
@@ -124,3 +127,7 @@ fill : List Doc -> Doc
fill [] = Empty
fill [x] = x
fill (x :: y :: xs) = (flatten x <+> fill (flatten y :: xs)) `Alt` (x </> fill (y :: xs))
public export
FromString Doc where
fromString = text