(add-pattern pattern-list pattern)Adds the given pattern to the given pattern list.
Adds the given pattern to the given pattern list.
(build-rule-list & patterns)Builds a list of rules. Use with rule-run, rule-ignore and rule-throw.
Builds a list of rules. Use with rule-run, rule-ignore and rule-throw.
(handle-matchers-and-rules string pos matcher-list rule-list)(handle-matchers-and-rules string pos index matcher-list rule-list)Handles patterns and rules. If there was a match, handles it's respective rule, and returns the new position directly after the match. Otherwise, nil.
Handles patterns and rules. If there was a match, handles it's respective rule, and returns the new position directly after the match. Otherwise, nil.
(lex string rule-list)Using the given rules, lex the given string.
Using the given rules, lex the given string.
(make-lexer-exception string-index)(make-lexer-exception string-index reason)Makes a new lexer exception with ex-info.
Makes a new lexer exception with ex-info.
(matcher-next string position matcher)Attempts, using the given matcher, to match the string starting at the given position. If the match was successful, returns the matched piece of the string, otherwise, nil.
Attempts, using the given matcher, to match the string starting at the given position. If the match was successful, returns the matched piece of the string, otherwise, nil.
(rule-ignore pattern)Makes a rule with a regex pattern that will be ignored during lexing.
Makes a rule with a regex pattern that will be ignored during lexing.
(rule-run pattern f)Makes a rule associating a regex pattern to a function. While lexing, f is given the pattern that was matched, and should have the signature [^String].
Makes a rule associating a regex pattern to a function. While lexing, f is given the pattern that was matched, and should have the signature [^String].
(rule-throw pattern reason)Makes a rule with a regex pattern that will throw an exception with the given reason during lexing.
Makes a rule with a regex pattern that will throw an exception with the given reason during lexing.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |