AST parsing
AST parsing
Syntax of an unquoted field component, e.g. the second component of foo.bar.baz. Includes all characters up to the next dot, or the end of the field. Taken in conjunction with the current quoted field syntax, there is no way to represent a field component that contains a dot and ends in a backslash, e.g. a fact named "foo.bar" since given the dot, it has to be quoted, but quoted fields can't end in a backslash right now (cf. quoted-field-rx).
Syntax of an unquoted field component, e.g. the second component of foo.bar.baz. Includes all characters up to the next dot, or the end of the field. Taken in conjunction with the current quoted field syntax, there is no way to represent a field component that contains a dot and ends in a backslash, e.g. a fact named "foo.bar\" since given the dot, it has to be quoted, but quoted fields can't end in a backslash right now (cf. quoted-field-rx).
Syntax of a match(regex) field component, e.g. the second component of foo.match("bar?").baz. It must begin with match, open paren, double quote, and ends at the next double-quote, close-paren that is not preceded by a backslash and is followed by either a dot, or the end of the field. The regex then, has essentially the same syntax as a double quoted field. And similarly, there is currently not way to specify a match regular expression that ends in a backslash.
Syntax of a match(regex) field component, e.g. the second component
of foo.match("bar?").baz. It must begin with match, open paren,
double quote, and ends at the next double-quote, close-paren that is
not preceded by a backslash and is followed by either a dot, or the
end of the field. The regex then, has essentially the same syntax
as a double quoted field. And similarly, there is currently not way
to specify a match regular expression that ends in a backslash.(parse-field s)(parse-field s offset opts)Parses an AST field like "certname", "facts.partition[3]" and returns a vector of the field components as maps. The first component will always be a ::named-field-part.
Parses an AST field like "certname", "facts.partition[3]" and returns a vector of the field components as maps. The first component will always be a ::named-field-part.
(path-names->field-str names)Returns a properly quoted AST field string (dotted path) for the given names (only handles names, not ::indexed-field-part or ::match-field-part expressions). Throws an exception if any name cannot be quoted, since AST's current quoting syntax is incomplete (e.g. cannot represent a name that contains a dot and ends in backslash.
Returns a properly quoted AST field string (dotted path) for the given names (only handles names, not ::indexed-field-part or ::match-field-part expressions). Throws an exception if any name cannot be quoted, since AST's current quoting syntax is incomplete (e.g. cannot represent a name that contains a dot and ends in backslash.
Syntax of a quoted field component, e.g. the second component of foo."bar".baz. It must begin with a double quote, and ends at the next double quote that is not preceded by a backslash and is followed by either a dot, or the end of the field. There is currently no way to represent a field component that contains a dot and ends in a backslash, e.g. a fact named "foo.bar". It has to be quoted, given the dot, but as just mentioned, quoted fields can't end in a backslash.
Syntax of a quoted field component, e.g. the second component of foo."bar".baz. It must begin with a double quote, and ends at the next double quote that is not preceded by a backslash and is followed by either a dot, or the end of the field. There is currently no way to represent a field component that contains a dot and ends in a backslash, e.g. a fact named "foo.bar\". It has to be quoted, given the dot, but as just mentioned, quoted fields can't end in a backslash.
Syntax of the first component of a field path, e.g. "facts" for facts.os.
Syntax of the first component of a field path, e.g. "facts" for facts.os.
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 |