| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Agda.Interaction.Highlighting.Precise
Description
Types used for precise syntax highlighting.
Synopsis
- data Aspect
- data NameKind
- data OtherAspect
- data Aspects = Aspects {}
- data DefinitionSite = DefinitionSite {}
- data TokenBased
- newtype File = File {}
- type HighlightingInfo = CompressedFile
- parserBased :: Aspects
- singleton :: Ranges -> Aspects -> File
- several :: [Ranges] -> Aspects -> File
- merge :: File -> File -> File
- smallestPos :: File -> Maybe Int
- toMap :: File -> IntMap Aspects
- newtype CompressedFile = CompressedFile {}
- compressedFileInvariant :: CompressedFile -> Bool
- compress :: File -> CompressedFile
- decompress :: CompressedFile -> File
- noHighlightingInRange :: Ranges -> CompressedFile -> CompressedFile
- singletonC :: Ranges -> Aspects -> CompressedFile
- severalC :: [Ranges] -> Aspects -> CompressedFile
- splitAtC :: Int -> CompressedFile -> (CompressedFile, CompressedFile)
- selectC :: Range -> CompressedFile -> CompressedFile
- smallestPosC :: CompressedFile -> Maybe Int
- mergeC :: CompressedFile -> CompressedFile -> CompressedFile
Files
Syntactic aspects of the code. (These cannot overlap.)
They can be obtained from the lexed tokens already,
except for the NameKind.
Constructors
| Comment | |
| Option | |
| Keyword | |
| String | |
| Number | |
| Symbol | Symbols like forall, =, ->, etc. |
| PrimitiveType | Things like Set and Prop. |
| Name (Maybe NameKind) Bool | Is the name an operator part? |
NameKinds are figured out during scope checking.
Constructors
| Bound | Bound variable. |
| Constructor Induction | Inductive or coinductive constructor. |
| Datatype | |
| Field | Record field. |
| Function | |
| Module | Module name. |
| Postulate | |
| Primitive | Primitive. |
| Record | Record type. |
| Argument | Named argument, like x in {x = v} |
| Macro | Macro. |
data OtherAspect #
Other aspects, generated by type checking.
(These can overlap with each other and with Aspects.)
Constructors
| Error | |
| DottedPattern | |
| UnsolvedMeta | |
| UnsolvedConstraint | Unsolved constraint not connected to meta-variable. This could for instance be an emptyness constraint. |
| TerminationProblem | |
| PositivityProblem | |
| ReachabilityProblem | |
| CoverageProblem | |
| IncompletePattern | When this constructor is used it is probably a good idea to
include a |
| CatchallClause | |
| TypeChecks | Code which is being type-checked. |
Instances
| Bounded OtherAspect # | |
Defined in Agda.Interaction.Highlighting.Precise | |
| Enum OtherAspect # | |
Defined in Agda.Interaction.Highlighting.Precise Methods succ :: OtherAspect -> OtherAspect # pred :: OtherAspect -> OtherAspect # toEnum :: Int -> OtherAspect # fromEnum :: OtherAspect -> Int # enumFrom :: OtherAspect -> [OtherAspect] # enumFromThen :: OtherAspect -> OtherAspect -> [OtherAspect] # enumFromTo :: OtherAspect -> OtherAspect -> [OtherAspect] # enumFromThenTo :: OtherAspect -> OtherAspect -> OtherAspect -> [OtherAspect] # | |
| Eq OtherAspect # | |
Defined in Agda.Interaction.Highlighting.Precise | |
| Show OtherAspect # | |
Defined in Agda.Interaction.Highlighting.Precise Methods showsPrec :: Int -> OtherAspect -> ShowS # show :: OtherAspect -> String # showList :: [OtherAspect] -> ShowS # | |
| EmbPrj OtherAspect # | |
Defined in Agda.TypeChecking.Serialise.Instances.Highlighting Methods icode :: OtherAspect -> S Int32 # icod_ :: OtherAspect -> S Int32 # value :: Int32 -> R OtherAspect # | |
Meta information which can be associated with a character/character range.
Constructors
| Aspects | |
Fields
| |
data DefinitionSite #
Constructors
| DefinitionSite | |
Fields
| |
Instances
| Eq DefinitionSite # | |
Defined in Agda.Interaction.Highlighting.Precise Methods (==) :: DefinitionSite -> DefinitionSite -> Bool # (/=) :: DefinitionSite -> DefinitionSite -> Bool # | |
| Show DefinitionSite # | |
Defined in Agda.Interaction.Highlighting.Precise Methods showsPrec :: Int -> DefinitionSite -> ShowS # show :: DefinitionSite -> String # showList :: [DefinitionSite] -> ShowS # | |
| EmbPrj DefinitionSite # | |
Defined in Agda.TypeChecking.Serialise.Instances.Highlighting Methods icode :: DefinitionSite -> S Int32 # icod_ :: DefinitionSite -> S Int32 # value :: Int32 -> R DefinitionSite # | |
data TokenBased #
Is the highlighting "token-based", i.e. based only on information from the lexer?
Constructors
| TokenBased | |
| NotOnlyTokenBased |
Instances
| Eq TokenBased # | |
Defined in Agda.Interaction.Highlighting.Precise | |
| Show TokenBased # | |
Defined in Agda.Interaction.Highlighting.Precise Methods showsPrec :: Int -> TokenBased -> ShowS # show :: TokenBased -> String # showList :: [TokenBased] -> ShowS # | |
| Semigroup TokenBased # | |
Defined in Agda.Interaction.Highlighting.Precise Methods (<>) :: TokenBased -> TokenBased -> TokenBased # sconcat :: NonEmpty TokenBased -> TokenBased # stimes :: Integral b => b -> TokenBased -> TokenBased # | |
| Monoid TokenBased # | |
Defined in Agda.Interaction.Highlighting.Precise Methods mempty :: TokenBased # mappend :: TokenBased -> TokenBased -> TokenBased # mconcat :: [TokenBased] -> TokenBased # | |
| EmbPrj TokenBased # | |
Defined in Agda.TypeChecking.Serialise.Instances.Highlighting Methods icode :: TokenBased -> S Int32 # icod_ :: TokenBased -> S Int32 # value :: Int32 -> R TokenBased # | |
A File is a mapping from file positions to meta information.
The first position in the file has number 1.
type HighlightingInfo = CompressedFile #
Syntax highlighting information.
Creation
parserBased :: Aspects #
A variant of mempty with tokenBased set to
NotOnlyTokenBased.
singleton :: Ranges -> Aspects -> File #
is a file whose positions are those in singleton rs mrs,
and in which every position is associated with m.
Merging
Inspection
toMap :: File -> IntMap Aspects #
Convert the File to a map from file positions (counting from 1)
to meta information.
Compressed files
newtype CompressedFile #
Constructors
| CompressedFile | |
Instances
compressedFileInvariant :: CompressedFile -> Bool #
Invariant for compressed files.
Note that these files are not required to be maximally
compressed, because ranges are allowed to be empty, and the
Aspectss in adjacent ranges are allowed to be equal.
compress :: File -> CompressedFile #
Compresses a file by merging consecutive positions with equal meta information into longer ranges.
decompress :: CompressedFile -> File #
Decompresses a compressed file.
noHighlightingInRange :: Ranges -> CompressedFile -> CompressedFile #
Clear any highlighting info for the given ranges. Used to make sure unsolved meta highlighting overrides error highlighting.
Creation
singletonC :: Ranges -> Aspects -> CompressedFile #
is a file whose positions are those in singletonC rs mrs,
and in which every position is associated with m.
severalC :: [Ranges] -> Aspects -> CompressedFile #
Like singletonR, but with a list of Ranges instead of a
single one.
splitAtC :: Int -> CompressedFile -> (CompressedFile, CompressedFile) #
splitAtC p f splits the compressed file f into (f1, f2),
where all the positions in f1 are < p, and all the positions
in f2 are >= p.
selectC :: Range -> CompressedFile -> CompressedFile #
Inspection
smallestPosC :: CompressedFile -> Maybe Int #
Returns the smallest position, if any, in the CompressedFile.
Merge
mergeC :: CompressedFile -> CompressedFile -> CompressedFile #
Merges compressed files.