dhall-lsp-server-1.0.7: Language Server Protocol (LSP) server for Dhall

Safe HaskellNone
LanguageHaskell2010

Dhall.LSP.Backend.Parsing

Synopsis

Documentation

getImportHash :: Src -> Maybe Src Source #

Given an Src of a import expression return the Src containing the hash annotation. If the import does not have a hash annotation return a 0-length Src where we can insert one.

getLetInner :: Src -> Maybe Src Source #

Parse the outermost binding in a Src descriptor of a let-block and return the rest. Ex. on input `let a = 0 let b = a in b` parses `let a = 0 ` and returns the Src descriptor containing `let b = a in b`.

getLetAnnot :: Src -> Maybe Src Source #

Given an Src of a let expression return the Src containing the type annotation. If the let expression does not have a type annotation return a 0-length Src where we can insert one.

getLetIdentifier :: Src -> Src Source #

Given an Src of a let expression return the Src containing the bound identifier, i.e. given `let x = ... in ...` return the Src descriptor containing x. Returns the original Src if something goes wrong.

binderExprFromText :: Text -> Expr Src Import Source #

Approximate the type-checking context at the end of the input. Tries to parse as many binders as possible. Very messy!

holeExpr :: Expr s a Source #

An expression that is guaranteed not to typecheck. Can be used a placeholder type to emulate lazy contexts, when typechecking something in a only partly well-typed context.