Liking cljdoc? Tell your friends :D

globber.glob

Globbing searches in clojure.

Globbing searches in clojure.
raw docstring

all-indicesclj

(all-indices s pat)

Find all indices of a substring in a given string

Find all indices of a substring in a given string
sourceraw docstring

ast-typeclj

(ast-type ast)

Determine if the ast can be unrolled to a string, can be exploded to a set of strings or needs to run through our algorithm.

Determine if the ast can be unrolled to a string, can
be exploded to a set of strings or needs to run through
our algorithm.
sourceraw docstring

ast-typenamesclj

Yield a keyword name for the AST type

Yield a keyword name for the AST type
sourceraw docstring

char->tokenclj

(char->token [prev c])

Our simple lexer, understands escaped characters.

Our simple lexer, understands escaped characters.
sourceraw docstring

close-branchclj

(close-branch branch)

We succesfuly parsed a branch, now yield the best possible AST for it.

We succesfuly parsed a branch, now yield
the best possible AST for it.
sourceraw docstring

close-charclassclj

(close-charclass cc nchar)

We're finished running through a class. Yield a set with some additional metadata to indicate whether the class is negated.

This also handles edge-cases (zero or single element classes).

We're finished running through a class.
Yield a set with some additional metadata to
indicate whether the class is negated.

This also handles edge-cases (zero or single element
classes).
sourceraw docstring

explode-astclj

(explode-ast ast)

Explode a non-compound AST to all its possible combinations.

Explode a non-compound AST to all its possible combinations.
sourceraw docstring

explode-compound-astclj

(explode-compound-ast partitions)

Transform a partitioned compound AST by exploding eligible sub-ASTs

Transform a partitioned compound AST by exploding eligible sub-ASTs
sourceraw docstring

expr->tokensclj

(expr->tokens expr)

Looks at characters two at a time to yield a list of tokens.

Looks at characters two at a time to yield a list of tokens.
sourceraw docstring

filter-compound-astclj

(filter-compound-ast partitions candidates)

Given a compound AST, yield the set of matching candidates.

Given a compound AST, yield the set of matching candidates.
sourceraw docstring

filter-compound-partitionclj

(filter-compound-partition [eaters patterns] [pos candidate])

Match a list of candidates against a single partition of a compound AST. When a match occurs, yield a list of the new candidates this may have generated and if they are eligible as a terminal match.

Match a list of candidates against a single partition of
a compound AST. When a match occurs, yield a list of
the new candidates this may have generated and if they
are eligible as a terminal match.
sourceraw docstring

find-patternclj

(find-pattern pos candidate s eaters pattern)

Match a string against a list of eaters and a pattern

Match a string against a list of eaters and a pattern
sourceraw docstring

globclj

(glob expression candidates)

Perform globbing, matching the supplied expression against the list of supplied candidates.

  • candidates is a collection of strings and must be seqable.
  • expression adheres mostly to the bash notion of globbing

Globbing syntax:

  • Any stray character is matched exactly
  • Wildcards ('*') mean any number (including zero) of arbitrary chars
  • Anyones ('?') mean a single arbitrary char
  • Character classes are enclosed in square brackets and may contain arbitrary list of characters to match. If a character class begins with a ('!') or ('^') character, the class will be negated, i.e: will only match characters absent from the class. Empty charclasses, i.e: ('[]'), ('[!]'), and ('[^]') match their representation, not their content.
  • Trees match any of their branches. Trees are delimited by curly brackets and content are separated by commas. Empty trees, i.e: ('{}'), ('{,}'), ('{,,}') match their representation, not their content.

Examples:

(glob "foobar" ["foobar"])  ;; => ("foobar")
(glob "fo[a-z]" ["foobar"]) ;; => ("foobar")
Perform globbing, matching the supplied `expression` against
the list of supplied `candidates`.

- `candidates` is a collection of strings and must be seqable.
- `expression` adheres mostly to the bash notion of globbing

Globbing syntax:

- Any stray character is matched exactly
- Wildcards ('*') mean any number (including zero) of arbitrary chars
- Anyones ('?') mean a single arbitrary char
- Character classes are enclosed in square brackets and may contain
  arbitrary list of characters to match. If a character class begins
  with a ('!') or ('^') character, the class will be negated, i.e:
  will only match characters absent from the class. Empty charclasses,
  i.e: ('[]'), ('[!]'), and ('[^]') match their representation, not
  their content.
- Trees match any of their branches. Trees are delimited by curly
  brackets and content are separated by commas. Empty trees, i.e:
  ('{}'), ('{,}'), ('{,,}') match their representation, not their
  content.

Examples:

    (glob "foobar" ["foobar"])  ;; => ("foobar")
    (glob "fo[a-z]" ["foobar"]) ;; => ("foobar")
sourceraw docstring

make-classclj

(make-class beg end)

Build a list of all characters between beg and end

Build a list of all characters between `beg` and `end`
sourceraw docstring

merge-astclj

(merge-ast)
(merge-ast left right)

Merge two non-compound ASTs by yielding all possible combinations.

Merge two non-compound ASTs by yielding all possible combinations.
sourceraw docstring

negated-cc?clj

(negated-cc? ast)

Is this representing a negated character class?

Is this representing a negated character class?
sourceraw docstring

partition-compound-astclj

(partition-compound-ast tokens)

Partition a compound AST into a list of (eaters, ast) tuples where eaters is a list of eager character eaters and a potentially explodable AST

Partition a compound AST into a list of (eaters, ast) tuples where
eaters is a list of eager character eaters and a potentially explodable
AST
sourceraw docstring

scan-branchclj

(scan-branch tokens)

Eat tokens until the end of a branch.

Eat tokens until the end of a branch.
sourceraw docstring

scan-branchesclj

(scan-branches tokens)

A tree has started, scan all its branches and yield the best possible AST for it.

A tree has started, scan all its branches and yield
the best possible AST for it.
sourceraw docstring

scan-charclassclj

(scan-charclass tokens)

Eat tokens until the character class is closed.

Eat tokens until the character class is closed.
sourceraw docstring

stringify-astclj

(stringify-ast ast)

Reduce a string-only AST to its equivalent string

Reduce a string-only AST to its equivalent string
sourceraw docstring

tokens->astclj

(tokens->ast tokens)

Transform a list of tokens to an AST, if possible.

Transform a list of tokens to an AST, if possible.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close