Crate synoptic

Crate synoptic 

Source

Structs§

Atom
An atom is a portion of text within a document that is significant. An atom only covers one line. Atoms cover keywords as well as start and end indicators for bounded tokens E.g., in a string, the atoms would be the starting “ and the ending “
AtomDef
A definition of an Atom See Atom for more information
BoundedDef
Definition for a bounded token, these are tokens that can cover multiple lines. Things like multiline comments and strings are examples of this. They work well for buffering files where you are unaware of where the end indicator may be as it occurs further down in the file.
Highlighter
This is the main struct that will highlight your document
Loc
Represents a point in a 2d space
Regex
A compiled regular expression for searching Unicode haystacks.

Enums§

AtomKind
The kind of atom being represented
TokOpt
This is an enum for representing tokens.
TokenRef
This is a TokenRef, which contains detailed information on what a token is

Functions§

create_mapping
HashMap<byte_idx, char_idx>
find_all
This will find all occurances of a string in a document (and return character indices)
find_tok_index
Find the token index within a tokopt given a display index Returns (token_index, index_within_that_token)
from_extension
Function to obtain a syntax highlighter based on a file extension
trim
Trim utility function to trim down a line of tokens to offset text
trim_fit
Trim utility function to trim down a line of tokens to offset text (with length)
width
Utility function to determine the width of a string, with variable tab width