Module colorizer.matcher
Helper functions for colorizer to enable required parsers
Functions
compile (matchers, matchers_trie) | Form a trie stuct with the given prefixes |
make (options) | Parse the given options and return a function with enabled parsers. |
Functions
- compile (matchers, matchers_trie)
-
Form a trie stuct with the given prefixes
Parameters:
- matchers table: List of prefixes, {"rgb", "hsl"}
- matchers_trie table: Table containing information regarding non-trie based parsers
Returns:
-
function: function which will just parse the line for enabled parsers
- make (options)
-
Parse the given options and return a function with enabled parsers.
if no parsers enabled then return false
Do not try make the function again if it is present in the cache
Parameters:
- options table: options created in colorizer.setup
Returns:
-
function|boolean: function which will just parse the line for enabled parsers