Generic scanlet builders for the Pratt parser engine.
Scanlet builders wrap language-specific consume functions into parselets that the grammar spec can reference. They bridge the gap between 'consume characters from source' and 'produce a CST node'.
Any language can use these builders with its own consume functions.
Generic scanlet builders for the Pratt parser engine. Scanlet builders wrap language-specific consume functions into parselets that the grammar spec can reference. They bridge the gap between 'consume characters from source' and 'produce a CST node'. Any language can use these builders with its own consume functions.
(atom-scanlet token-type consume-fn)Build a scanlet that consumes chars via consume-fn, makes a token, returns atom node. consume-fn: (fn [^String source ^long len ^long pos] → end-pos)
Build a scanlet that consumes chars via consume-fn, makes a token, returns atom node. consume-fn: (fn [^String source ^long len ^long pos] → end-pos)
(delimited-scanlet node-type token-type close-char close-type)Build a scanlet for an opening delimiter that parses children until close-char.
Build a scanlet for an opening delimiter that parses children until close-char.
(single-char-scanlet token-type factory-parselet)Build a scanlet for a single-character token that delegates to a factory parselet. factory-parselet: (fn [engine tok] → CST node)
Build a scanlet for a single-character token that delegates to a factory parselet. factory-parselet: (fn [engine tok] → CST node)
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 |