The Kern Lexer library.
The Kern Lexer library.
(angles p)
Applies parser p skiping over surrounding angle brackets. Calls (trim) after the opening bracket, after p, and after the closing bracket.
Applies parser p skiping over surrounding angle brackets. Calls (trim) after the opening bracket, after p, and after the closing bracket.
The most basic record; for use to build new styles.
The most basic record; for use to build new styles.
(bool-lit)
Parses a boolean value, true or false, comparing according to :case-sensitive. Calls (trim) afterward.
Parses a boolean value, true or false, comparing according to :case-sensitive. Calls (trim) afterward.
(braces p)
Applies parser p skiping over surrounding braces. Calls (trim) after the opening brace, after p, and after the closing brace.
Applies parser p skiping over surrounding braces. Calls (trim) after the opening brace, after p, and after the closing brace.
(brackets p)
Applies parser p skiping over surrounding brackets. Calls (trim) after the opening bracket, after p, and after the closing bracket.
Applies parser p skiping over surrounding brackets. Calls (trim) after the opening bracket, after p, and after the closing bracket.
Lexical settings for C-style languages.
Lexical settings for C-style languages.
(char-lit)
Parses a character literal according to the :type setting. The common syntax is a symbol in single quotes with the usual escape codes. Calls (trim) afterwards.
The following styles add escaped characters:
:basic \b \t \n \f \r ' " / :C :basic + \0ooo \0xnn \unnnnnnnn :Haskell :basic + \nnnn \onnnn \xnnnn :Java :basic + \0ooo \unnnn :Shell :basic + \0ooo \0xnn \unnnnnnnn
Parses a character literal according to the :type setting. The common syntax is a symbol in single quotes with the usual escape codes. Calls (trim) afterwards. The following styles add escaped characters: :basic \b \t \n \f \r \' \" \/ :C :basic + \0ooo \0xnn \unnnnnnnn :Haskell :basic + \nnnn \onnnn \xnnnn :Java :basic + \0ooo \unnnn :Shell :basic + \0ooo \0xnn \unnnnnnnn
(colon)
Parses a single colon; then calls (trim).
Parses a single colon; then calls (trim).
(comma)
Parses a single comma; then calls (trim).
Parses a single comma; then calls (trim).
(comma-sep)
Applies parser p zero or more times, skiping over separating commas. Calls (trim) after each p and comma.
Applies parser p zero or more times, skiping over separating commas. Calls (trim) after each p and comma.
(comma-sep1)
Applies parser p one or more times, skiping over separating commas. Calls (trim) after each p and comma.
Applies parser p one or more times, skiping over separating commas. Calls (trim) after each p and comma.
(dec-lit)
Parses a decimal number as Long or BigInt depending on the magnitude or if it ends with N. Calls (trim) afterward.
Parses a decimal number as Long or BigInt depending on the magnitude or if it ends with N. Calls (trim) afterward.
(dot)
Parses a single dot; then calls (trim).
Parses a single dot; then calls (trim).
(field cs)
Parses an unquoted text field terminated by any character in cs. Calls (trim) afterwards.
Parses an unquoted text field terminated by any character in cs. Calls (trim) afterwards.
(float-lit)
Parses a floating-point number as Double or BigDecimal depending on the magnitude or if it ends with M. It cannot start with a period. The first period found must be followed by at least one digit. Calls (trim) afterward.
Parses a floating-point number as Double or BigDecimal depending on the magnitude or if it ends with M. It cannot start with a period. The first period found must be followed by at least one digit. Calls (trim) afterward.
Lexical settings for Haskell-style languages.
Lexical settings for Haskell-style languages.
(hex-lit)
Parses a hexadecimal number as Long or BigInt depending on the magnitude or if it ends with N. Calls (trim) afterward.
Parses a hexadecimal number as Long or BigInt depending on the magnitude or if it ends with N. Calls (trim) afterward.
(identifier)
Parses an unquoted string suitable for an identifier or a name. The start of the input is defined by :identifier-start, and subsequent symbols by :identtifier-letter. It will check that the parsed value not be in the list of :reserved-names, if any, comparing according to :case-sensitive. Calls (trim) afterwards.
Parses an unquoted string suitable for an identifier or a name. The start of the input is defined by :identifier-start, and subsequent symbols by :identtifier-letter. It will check that the parsed value not be in the list of :reserved-names, if any, comparing according to :case-sensitive. Calls (trim) afterwards.
Lexical settings for Java-style languages.
Lexical settings for Java-style languages.
(lexeme p)
Applies parser p, then calls (trim).
Applies parser p, then calls (trim).
(make-parsers rec)
Returns a function map that corresponds to the customization values of the input record, whose fields are as follows:
:type Identifies the type of settings. :comment-start A string that marks the start of a block comment. :comment-end A string that marks the end of a block comment. :comment-line A string that marks the start of a line comment. :nested-comments Whether the lexer accepts nested comments; a boolean. :identifier-start A parser for the start of an identifier. :identifier-letter A parser for the subsequent characters of an identifier. :reserved-names A list of names that cannot be identifiers. :case-sensitive Whether tokens are case-sensitive; a boolean. :line-continuation A parser for the token that precedes the new line. :trim-newline Treats newline character(s) as whitespace. :leading-sign Whether numbers accept an optional leading sign.
Returns a function map that corresponds to the customization values of the input record, whose fields are as follows: :type Identifies the type of settings. :comment-start A string that marks the start of a block comment. :comment-end A string that marks the end of a block comment. :comment-line A string that marks the start of a line comment. :nested-comments Whether the lexer accepts nested comments; a boolean. :identifier-start A parser for the start of an identifier. :identifier-letter A parser for the subsequent characters of an identifier. :reserved-names A list of names that cannot be identifiers. :case-sensitive Whether tokens are case-sensitive; a boolean. :line-continuation A parser for the token that precedes the new line. :trim-newline Treats newline character(s) as whitespace. :leading-sign Whether numbers accept an optional leading sign.
(new-line)
Parses a new line, UNIX or Windows style; then calls (trim).
Parses a new line, UNIX or Windows style; then calls (trim).
(nil-lit)
Parses a null value, nil or null, comparing according to :case-sensitive. Calls (trim) afterward.
Parses a null value, nil or null, comparing according to :case-sensitive. Calls (trim) afterward.
(none-of)
Succeeds if the next character is not in the supplied string. Calls (trim) afterwards.
Succeeds if the next character is not in the supplied string. Calls (trim) afterwards.
(oct-lit)
Parses an octal number as Long or BigInt depending on the magnitude or if it ends with N. Calls (trim) afterward.
Parses an octal number as Long or BigInt depending on the magnitude or if it ends with N. Calls (trim) afterward.
(one-of cs)
Succeeds if the next character is in the supplied string. Calls (trim) afterwards.
Succeeds if the next character is in the supplied string. Calls (trim) afterwards.
(parens p)
Applies parser p skiping over surrounding parenthesis. Calls (trim) after the opening paren, after p, and after the closing paren.
Applies parser p skiping over surrounding parenthesis. Calls (trim) after the opening paren, after p, and after the closing paren.
(semi)
Parses a single semicolon; then calls (trim).
Parses a single semicolon; then calls (trim).
(semi-sep)
Applies parser p zero or more times, skiping over separating semicolons. Calls (trim) after each p and semicolon.
Applies parser p zero or more times, skiping over separating semicolons. Calls (trim) after each p and semicolon.
(semi-sep1)
Applies parser p one or more times, skiping over separating semicolons. Calls (trim) after each p and semicolon.
Applies parser p one or more times, skiping over separating semicolons. Calls (trim) after each p and semicolon.
Lexical settings for shell-style languages.
Lexical settings for shell-style languages.
(string-lit)
Parses a string literal according to the :type setting. The common syntax is any number of symbols in double quotes with the usual escape codes. Calls (trim) afterward.
The following styles add escaped characters:
:basic \b \t \n \f \r ' " / :C :basic + \0ooo \0xnn \unnnnnnnn :Haskell :basic + \nnnn \onnnn \xnnnn :Java :basic + \0ooo \unnnn :Shell :basic + \0ooo \0xnn \unnnnnnnn
Parses a string literal according to the :type setting. The common syntax is any number of symbols in double quotes with the usual escape codes. Calls (trim) afterward. The following styles add escaped characters: :basic \b \t \n \f \r \' \" \/ :C :basic + \0ooo \0xnn \unnnnnnnn :Haskell :basic + \nnnn \onnnn \xnnnn :Java :basic + \0ooo \unnnn :Shell :basic + \0ooo \0xnn \unnnnnnnn
(sym c)
Parses a single character c. Compares according to :case-sensitive. Calls (trim) afterwards.
Parses a single character c. Compares according to :case-sensitive. Calls (trim) afterwards.
(token cs)
(token cs & more)
Parses a specific string, not necessarily delimited. If more than one are given it will try each choice in turn. Compares according to :case-sensitive. Calls (trim) afterwards.
Parses a specific string, not necessarily delimited. If more than one are given it will try each choice in turn. Compares according to :case-sensitive. Calls (trim) afterwards.
(trim)
Skips over any whitespace, including comments (if defined), at the start of the input. Whether newline characters are removed as whitespace is configured by :trim-newline. When that setting is true, the setting :line-continuation is activated.
Skips over any whitespace, including comments (if defined), at the start of the input. Whether newline characters are removed as whitespace is configured by :trim-newline. When that setting is true, the setting :line-continuation is activated.
(with-parsers rec & body)
Binds the parser vars in the kern.lexer namespace to the values in rec.
Binds the parser vars in the kern.lexer namespace to the values in rec.
(word cs)
(word cs & more)
Parses a specific string; must be delimited by any character not parsed by :identifier-letter. If more than one are given it will try each choice in turn. Compares according to :case-sensitive. Calls (trim) afterwards.
Parses a specific string; must be delimited by any character not parsed by :identifier-letter. If more than one are given it will try each choice in turn. Compares according to :case-sensitive. Calls (trim) afterwards.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close