Module perspective_viewer::exprtk
source · Structs§
- Because ExprTK reports errors in column/row coordinates and visually needs to be applied to an entire token rather than a single character, we need fairly obnoxious counter logic to figure out how to generate the resulting syntax-highlighted HTML. The
Counter<'a>struct encpsulates this logic, generating aNodeRefto any autocomplete-able<span>tokens, as well as other convenient data for HTML rendering, and can be called incrementally while iterating tokens after parsing.
Enums§
- Syntax-highlightable ExprTK tokens. We had the option of implemnting this alternatively as
pub struct Token(TokenType, &'a str);, but I felt this was less ergonomic for the frequent pattern matching necessary when handling enum tokens.
Constants§
Functions§
- Parse a string representing an ExprTK Expression Column into
Tokens. A token list is sufficient for syntax-highlighting purposes, faster than a full parser and much easier to write a renderer for.