Base for simple stateful regular expression-based lexers. Simplifies the lexing process so that you need only provide a list of states and regular expressions.
Do the lexical analysis
Formatter class
Properties:
lexer: Current lexer style: Current style stream: Current output stream (if not set use sys.stdout)
Use this method for formatting data
Format a single peace of a text using the provided style
Simple console output formatter using ConsoleStyleAdapter and tea.console.color cprint
Style adapter is a helper class for adapting a style for restricted environments, where not all colors or font styles are available.
For example the terminal console doesn’t have the full range of colors and also doesn’t have font styles. Look in the ConsoleStyleAdapter for example implementation.
Override this method to implement the adaptation logic
Simple hex color to console color adapter
Simple console output formatter using ConsoleStyleAdapter and tea.console.color cprint
Formatter class
Properties:
lexer: Current lexer style: Current style stream: Current output stream (if not set use sys.stdout)
Use this method for formatting data
Format a single peace of a text using the provided style
Base for simple stateful regular expression-based lexers. Simplifies the lexing process so that you need only provide a list of states and regular expressions.
Do the lexical analysis
Simple hex color to console color adapter
Font properties
Style adapter is a helper class for adapting a style for restricted environments, where not all colors or font styles are available.
For example the terminal console doesn’t have the full range of colors and also doesn’t have font styles. Look in the ConsoleStyleAdapter for example implementation.
Override this method to implement the adaptation logic