Safe Haskell | None |
---|---|
Language | Haskell2010 |
Bricks is a lazy functional language that strongly resembles Nix.
Notable differences from Nix:
- No built-in null, integer, or boolean types
- No
builtins
and no infix operators (+
,-
,//
) - No URI literals
- No escape sequences in indented strings (
''
...''
) - The inline comment keyword is
--
rather than#
- There are block comments in the form
{-
...-}
- The concept of "set" is referred to as "dict" (this is not actually a language difference, we just use a different word to talk about the same concept)
The following modules are re-exported from this module in their entireties:
- Bricks.Expression - Defines most of the types, notably
Expression
- Bricks.IndentedString - Deals with the whitespace cleanup performed when
parsing indented strings (
''
...''
) - Bricks.Keyword - Enumerates the language's keywords
- Bricks.Parsing - Defines all of the Parsec parsers for parsing Bricks code
into
Expression
s - Bricks.Rendering - Defines all of the renderers for turning
Expression
s into Bricks code - Bricks.UnquotedString - Defines the rules for what strings are allowed to appear unquoted in Bricks code
Other modules:
- Bricks.Expression.Construction - Functions for constructing
Expression
s in a way that matches theirShow
implementations.
- data Expression
- render'expression :: Render Expression
- render'expression'listContext :: Render Expression
- render'expression'dotLeftContext :: Render Expression
- render'expression'applyLeftContext :: Render Expression
- render'expression'applyRightContext :: Render Expression
- render'expression'inParens :: Render Expression
- render'expression'dictKey :: Render Expression
- parse'expression :: Parser Expression
- parse'expression'paren :: Parser Expression
- parse'expression'dictKey :: Parser Expression
- parse'expressionList :: Parser [Expression]
- parse'expressionList'1 :: Parser Expression
- parse'expressionList'1'noDot :: Parser Expression
- str'escape :: Text -> Text
- parse'str'within'normalQ :: Parser Text
- parse'str'escape'normalQ :: Parser Text
- type Str'Static = Text
- render'strStatic'unquotedIfPossible :: Render Str'Static
- render'strStatic'quoted :: Render Str'Static
- parse'strStatic :: Parser Str'Static
- parse'strStatic'quoted :: Parser Str'Static
- parse'strStatic'unquoted :: Parser Str'Static
- newtype Str'Dynamic = Str'Dynamic {}
- data Str'1
- strDynamic'toList :: Str'Dynamic -> [Str'1]
- strDynamic'fromList :: [Str'1] -> Str'Dynamic
- strDynamic'singleton :: Str'1 -> Str'Dynamic
- render'strDynamic'unquotedIfPossible :: Render Str'Dynamic
- render'strDynamic'quoted :: Render Str'Dynamic
- parse'strDynamic'quoted :: Parser Str'Dynamic
- parse'strDynamic'normalQ :: Parser Str'Dynamic
- parse'strDynamic'indentedQ :: Parser Str'Dynamic
- newtype Str'Unquoted = Str'Unquoted'Unsafe {}
- str'tryUnquoted :: Text -> Maybe Str'Unquoted
- str'unquoted'orThrow :: Text -> Str'Unquoted
- str'canRenderUnquoted :: Text -> Bool
- char'canRenderUnquoted :: Char -> Bool
- render'strUnquoted :: Render Str'Unquoted
- parse'strUnquoted :: Parser Str'Unquoted
- str'dynamicToStatic :: Str'Dynamic -> Maybe Str'Static
- str'staticToDynamic :: Str'Static -> Str'Dynamic
- str'unquotedToDynamic :: Str'Unquoted -> Str'Dynamic
- newtype InStr = InStr {}
- inStr'toList :: InStr -> [InStr'1]
- inStr'join :: InStr -> Str'Dynamic
- inStr'level :: InStr -> Natural
- inStr'dedent :: InStr -> InStr
- inStr'trim :: InStr -> InStr
- render'inStr'1 :: Render InStr'1
- parse'inStr :: Parser InStr
- parse'inStr'1 :: Parser InStr'1
- data InStr'1 = InStr'1 {}
- inStr'1'nonEmpty :: InStr'1 -> Bool
- inStr'1'empty :: InStr'1 -> Bool
- inStr'1'modifyLevel :: (Natural -> Natural) -> InStr'1 -> InStr'1
- newtype List = List (Seq Expression)
- render'list :: Render List
- parse'list :: Parser List
- data Dict = Dict {}
- keyword'rec :: Keyword
- render'dict :: Render Dict
- parse'dict :: Parser Dict
- parse'dict'rec :: Parser (Seq DictBinding)
- parse'dict'noRec :: Parser (Seq DictBinding)
- data DictBinding
- render'dictBinding :: Render DictBinding
- parse'dictBinding :: Parser DictBinding
- parse'dictBinding'inherit :: Parser DictBinding
- parse'dictBinding'eq :: Parser DictBinding
- data Dot = Dot {}
- expression'applyDots :: Expression -> [Expression] -> Expression
- render'dot :: Render Dot
- parse'dot'rhs'chain :: Parser [Expression]
- data Lambda = Lambda {}
- render'lambda :: Render Lambda
- parse'lambda :: Parser Lambda
- data Param
- render'param :: Render Param
- parse'param :: Parser Param
- parse'param'var :: Parser Param
- parse'param'noVar :: Parser Param
- data DictPattern = DictPattern {}
- data DictPattern'1 = DictPattern'1 {}
- render'dictPattern :: Render DictPattern
- render'dictPattern'1 :: Render DictPattern'1
- parse'dictPattern :: Parser DictPattern
- parse'dictPattern'start :: Parser ()
- data Apply = Apply {}
- expression'applyArgs :: Expression -> [Expression] -> Expression
- render'apply :: Render Apply
- data Let = Let {}
- keyword'let :: Keyword
- keyword'in :: Keyword
- render'let :: Render Let
- parse'let :: Parser Let
- data LetBinding
- render'letBinding :: Render LetBinding
- parse'letBinding :: Parser LetBinding
- parse'letBinding'eq :: Parser LetBinding
- parse'letBinding'inherit :: Parser LetBinding
- data With = With {}
- keyword'with :: Keyword
- render'with :: Render With
- parse'with :: Parser With
- data Inherit = Inherit {}
- keyword'inherit :: Keyword
- render'inherit :: Render Inherit
- parse'inherit :: Parser Inherit
- data Keyword
- keywords :: [Keyword]
- keywordString :: Keyword -> String
- keywordText :: Keyword -> Text
- parse'keyword :: Keyword -> Parser ()
- keyword'inlineComment :: Keyword
- parse'spaces :: Parser ()
- parse'comment :: Parser ()
- parse'comment'inline :: Parser ()
- parse'comment'block :: Parser ()
- type Render a = a -> Text
- parse'antiquote :: Parser Str'Dynamic
Expressions
data Expression Source #
Expr'Var Str'Unquoted | A variable, such as |
Expr'Str Str'Dynamic | A string may be quoted either in the traditional form using a
single double-quote ( "one\ntwo" or in the "indented string" form using two single-quotes ( '' one two '' Both of these examples reduce to the same value, because leading whitespace is stripped from indented strings. Either may contain "antiquotation" (also known as "string interpolation") to conveniently concatenate string-valued variables into the string. "Hello, my name is ${name}!" Normal strings may contain the following escape sequences:
The indented string form does not interpret any escape sequences. |
Expr'List List | A list is an ordered collection of expressions. The empty list: [ ] A list containing three variables: [ a b c ] Lambdas, function applications, [ (x: f x y) (g y) (let a = y; in f a a) (with d; f x a) ] |
Expr'Dict Dict | A dict is an unordered extensional mapping from strings. The empty dict (with no bindings): { } A dict with two bindings: { a = "one"; b = "one two"; } By default, dict bindings cannot refer to each other. For that, you
need the rec { a = "one"; b = "${a} two"; } In either case, the order of the bindings does not matter. The left-hand side of a dict binding may be a quoted string (in the
traditional { "a b" = "c"; } The left-hand side of a dict may even be an arbitrary expression,
using the let x = "a b"; in { ${x} = "c"; } Dicts also support the { inherit a; inherit (x) c d; } The previous expression is equivalent to: { a = a; c = x.c; d = x.d; } |
Expr'Dot Dot | A dot expression (named after the The examples in this section all reduce to Z. { a = "Z"; }.a let x = { a = "Z"; }; in x.a { x = { a = "Z"; }; }.x.a The right-hand side of a dot may be a quoted string (in the
traditional { a = "Z"; }."a" The right-hand side of a dot may even be an arbitrary expression,
using the { a = "Z"; }.${ let b = "a"; in b } |
Expr'Lambda Lambda | A lambda expression This is a function that turns a name into a greeting: name: "Hello, ${name}!" The function parameter can also be a dict pattern, which looks like this: { a, b, c ? "another" }: "Hello, ${a}, ${b}, and ${c}!" That function accepts a dict and looks up the keys By default, a lambda defined with a dict pattern fails to evaluate if
the dict argument contains keys that are not listed in the pattern.
To prevent it from failing, you can end the pattern with ({ a, ... }: x) { a = "1"; b = "2"; } Every function has a single parameter. If you need multiple parameters, you have to curry: a: b: [ a b ] |
Expr'Apply Apply | Function application: f x If a function has multiple (curried) parameters, you can chain them together like so: f x y z |
Expr'Let Let | A let-in expression: let greet = x: "Hello, ${x}!"; name = "Chris"; in greet name Let bindings, like dict bindings, may also use the let d = { greet = x: "Hello, ${x}!"; name = "Chris"; } inherit (d) greet name; in greet name The previous example also demonstrates how the bindings in a let
expression may refer to each other (much like a dict with the |
Expr'With With | A with expression is similar to a let-in expression, but the bindings come from a dict. with { greet = x: "Hello, ${x}!"; name = "Chris"; }; greet name |
Show Expression Source # | This instance is designed for doctests and REPL experimentation. The
format is designed to strike a balance in verbosity between the derived |
Binding Expression DictBinding Source # | |
Rendering expressions
render'expression :: Render Expression Source #
Render an expression.
render'expression'listContext :: Render Expression Source #
Render an expression in a list context.
render'expression'dotLeftContext :: Render Expression Source #
Render an expression in the context of the left-hand side of a Dot
.
render'expression'applyLeftContext :: Render Expression Source #
Render an expression in the context of the left-hand side of an Apply
.
render'expression'applyRightContext :: Render Expression Source #
Render an expression in the context of the right-hand side of an Apply
.
Parsing expressions
parse'expression :: Parser Expression Source #
The primary, top-level expression parser. This is what you use to parse a
.nix
file.
>>>
parseTest parse'expression ""
parse error at (line 1, column 1): unexpected end of input expecting expression
parse'expression'paren :: Parser Expression Source #
Parser for a parenthesized expression, from opening parenthesis to closing parenthesis.
parse'expression'dictKey :: Parser Expression Source #
Parser for an expression in a context that is expecting a dict key.
One of:
- an unquoted string
- a quoted dynamic string
- an arbitrary expression wrapped in antiquotes (
${
...}
)
Parsing lists of expressions
parse'expressionList :: Parser [Expression] Source #
Parser for a list of expressions in a list literal ([ x y z ]
) or in a
chain of function arguments (f x y z
).
>>>
parseTest parse'expressionList ""
[]
>>>
parseTest (length <$> parse'expressionList) "x \"one two\" (a: b) (c d)"
4
>>>
parseTest (length <$> parse'expressionList) "(x \"one two\" (a: b) (c d))"
1
parse'expressionList'1 :: Parser Expression Source #
Parser for a single item within an expression list (expressionListP
).
This expression is not a lambda, a function application, a let
-in
expression, or a with
expression.
>>>
parseTest parse'expressionList'1 "ab.xy"
dot (var "ab") (str ["xy"])
>>>
parseTest parse'expressionList'1 "(x: f x x) y z"
lambda (param "x") (apply (apply (var "f") (var "x")) (var "x"))
>>>
parseTest parse'expressionList'1 "{ a = b; }.a y"
dot (dict [binding (str ["a"]) (var "b")]) (str ["a"])
parse'expressionList'1'noDot :: Parser Expression Source #
Like parse'expressionList'1
, but with the further restriction that the
expression may not be a Dot
.
>>>
parseTest parse'expressionList'1'noDot "ab.xy"
var "ab"
>>>
parseTest parse'expressionList'1'noDot "(x: f x x) y z"
lambda (param "x") (apply (apply (var "f") (var "x")) (var "x"))
>>>
parseTest parse'expressionList'1'noDot "{ a = b; }.a y"
dict [binding (str ["a"]) (var "b")]
Strings
str'escape :: Text -> Text Source #
Insert escape sequences for rendering normal double-quoted ("
) strings.
parse'str'within'normalQ :: Parser Text Source #
Parser for at least one normal character, within a normally-quoted string context, up to but not including the end of the string or the start of an antiquotation.
Static strings
type Str'Static = Text Source #
A fixed string value. We use the description "static" to mean the string
may not contain antiquotation, in contrast with Str'Dynamic
which can.
render'strStatic'unquotedIfPossible :: Render Str'Static Source #
Render a static string, in unquoted form if possible.
render'strStatic'quoted :: Render Str'Static Source #
Render a static string, in quoted form.
parse'strStatic :: Parser Str'Static Source #
Parser for a static string which may be either quoted or unquoted.
>>>
parseTest parse'strStatic "\"hello\""
"hello"
>>>
parseTest parse'strStatic "hello"
"hello"
>>>
parseTest parse'strStatic "\"a b\""
"a b"
>>>
parseTest parse'strStatic "a b"
"a"
By "static," we mean that the string may not contain antiquotation.
>>>
parseTest parse'strStatic "\"a${x}b\" xyz"
parse error at (line 1, column 5): antiquotation is not allowed in this context
parse'strStatic'quoted :: Parser Str'Static Source #
Parser for a static string that is quoted.
parse'strStatic'unquoted :: Parser Str'Static Source #
Parser for an unquoted static string.
Dynamic strings
newtype Str'Dynamic Source #
A quoted string expression, which may be a simple string like "hello"
or
a more complex string containing antiquotation like "Hello, my name is
${name}!"
. See Expr'Str
.
We use the description "dynamic" to mean the string may contain antiquotation,
in contrast with Str'Static
which cannot.
One part of a Str'Dynamic
.
strDynamic'toList :: Str'Dynamic -> [Str'1] Source #
strDynamic'fromList :: [Str'1] -> Str'Dynamic Source #
render'strDynamic'unquotedIfPossible :: Render Str'Dynamic Source #
Render a dynamic string, in unquoted form if possible.
render'strDynamic'quoted :: Render Str'Dynamic Source #
Render a dynamic string, in quoted form.
parse'strDynamic'quoted :: Parser Str'Dynamic Source #
Parser for a dynamic string that is quoted. It may be a "normal" quoted
string delimited by one double-quote "
..."
(parse'strDynamic'normalQ
) or
an "indented" string delimited by two single-quotes ''
...''
(parse'strDynamic'indentedQ
).
parse'strDynamic'normalQ :: Parser Str'Dynamic Source #
Parser for a dynamic string enclosed in "normal" quotes ("
..."
).
parse'strDynamic'indentedQ :: Parser Str'Dynamic Source #
Parser for a dynamic string enclosed in "indented string" format,
delimited by two single-quotes ''
...''
. This form of string does not have
any escape sequences.
Unquoted strings
newtype Str'Unquoted Source #
A string that can be rendered unquoted. Unquoted strings are restricted to
a conservative set of characters; see str'canRenderUnquoted
for the full
rules.
The constructor is tagged "unsafe" because it lets you construct and invalid
value. Prefer str'tryUnquoted
which does validate the text.
str'tryUnquoted :: Text -> Maybe Str'Unquoted Source #
str'unquoted'orThrow :: Text -> Str'Unquoted Source #
Throws an exception if the string cannot render unquoted.
str'canRenderUnquoted :: Text -> Bool Source #
Whether a string having this name can be rendered without quoting it. We allow a string to render unquoted if all these conditions are met:
- The string is nonempty
- All characters satify
char'canRenderUnquoted
- The string is not a keyword
>>>
str'canRenderUnquoted "-ab_c"
True
>>>
str'canRenderUnquoted ""
False
>>>
str'canRenderUnquoted "a\"b"
False
>>>
str'canRenderUnquoted "let"
False
char'canRenderUnquoted :: Char -> Bool Source #
Letters, -
, and _
.
render'strUnquoted :: Render Str'Unquoted Source #
Render an unquoted string in unquoted form.
parse'strUnquoted :: Parser Str'Unquoted Source #
Parser for an unquoted string. Unquoted strings are restricted to a conservative set of characters, and they may not be any of the keywords.
>>>
parseTest parse'strUnquoted "abc"
unquoted "abc"
>>>
parseTest parse'strUnquoted "x{y"
unquoted "x"
>>>
parseTest parse'strUnquoted "let"
parse error at (line 1, column 4): unexpected end of input
String conversions
Indented strings
An "indented string literal," delimited by two single-quotes ''
.
This type of literal is called "indented" because the parser automatically
removes leading whitespace from the string (inStr'dedent
), which makes it
convenient to use these literals for multi-line strings within an indented
expression without the whitespace from indentation ending up as part of the
string.
inStr'toList :: InStr -> [InStr'1] Source #
inStr'join :: InStr -> Str'Dynamic Source #
Join InStr
s with newlines interspersed.
inStr'level :: InStr -> Natural Source #
Determine how many characters of whitespace to strip from an indented string.
inStr'dedent :: InStr -> InStr Source #
Determine the minimum indentation of any nonempty line, and remove that many space characters from the front of every line.
inStr'trim :: InStr -> InStr Source #
Remove any empty lines from the beginning or end of an indented string.
parse'inStr :: Parser InStr Source #
Parser for an indented string. This parser produces a representation of the lines from the source as-is, before the whitespace is cleaned up.
Single line of an indented string
One line of an InStr
.
InStr'1 | |
|
inStr'1'nonEmpty :: InStr'1 -> Bool Source #
Determines whether an InStr'1
contains any non-space
characters. The opposite of inStr'1'nonEmpty
.
This is used to determine whether this line should be considered when
calculating the number of space characters to strip in inStr'dedent
.
inStr'1'empty :: InStr'1 -> Bool Source #
The opposite of inStr'1'nonEmpty
.
inStr'1'modifyLevel :: (Natural -> Natural) -> InStr'1 -> InStr'1 Source #
Modify an InStr
by applying a function to its number of leading spaces.
Lists
A list literal expression, starting with [
and ending with ]
.
See Expr'List
.
render'list :: Render List Source #
Render a list literal ([ ... ]
).
parse'list :: Parser List Source #
Parser for a list expression ([ ... ]
).
>>>
parseTest parse'list "[]"
list []
>>>
parseTest parse'list "[x \"one\" (a: b) (c d)]"
list [var "x", str ["one"], lambda (param "a") (var "b"), apply (var "c") (var "d")]
Dicts
A dict literal expression, starting with {
or rec {
and ending with
}
. See Expr'Dict
.
Dict | |
|
render'dict :: Render Dict Source #
Render a dict literal ({ ... }
).
parse'dict :: Parser Dict Source #
Parser for a dict expression, either recursive (rec
keyword) or not.
>>>
parseTest parse'dict "{}"
dict []
>>>
parseTest parse'dict "rec { }"
rec'dict []
>>>
parseTest parse'dict "{ a = b; inherit (x) y z \"s t\"; }"
dict [binding (str ["a"]) (var "b"), inherit'from (var "x") ["y", "z", "s t"]]
parse'dict'rec :: Parser (Seq DictBinding) Source #
Parser for a recursive (rec
keyword) dict.
>>>
parseTest parse'dict "rec { }"
rec'dict []
>>>
parseTest parse'dict "rec { a = \"1\"; b = \"${a}2\"; }"
rec'dict [binding (str ["a"]) (str ["1"]), binding (str ["b"]) (str [antiquote (var "a"), "2"])]
parse'dict'noRec :: Parser (Seq DictBinding) Source #
Parser for a non-recursive (no rec
keyword) dict.
>>>
parseTest parse'dict "{ }"
dict []
>>>
parseTest parse'dict "{ a = \"1\"; b = \"${a}2\"; }"
dict [binding (str ["a"]) (str ["1"]), binding (str ["b"]) (str [antiquote (var "a"), "2"])]
Dict bindings
data DictBinding Source #
A binding of the form x = y;
within a DictLiteral
or LetExpr
.
render'dictBinding :: Render DictBinding Source #
Render a binding within a Dict
, without the trailing semicolon.
Dict lookup (dot)
An expression of the form person.name
that looks up a key from a dict.
See Expr'Dot
.
Dot | |
|
:: Expression | Dict |
-> [Expression] | Lookups |
-> Expression | Dot expression |
render'dot :: Render Dot Source #
Render a dot expression (a.b
).
parse'dot'rhs'chain :: Parser [Expression] Source #
Parser for a chain of dict lookups (like .a.b.c
) on the right-hand side
of a Dot
expression.
>>>
parseTest parse'dot'rhs'chain ""
[]
>>>
parseTest parse'dot'rhs'chain ".abc"
[str ["abc"]]
>>>
parseTest parse'dot'rhs'chain ".a.${b}.\"c\".\"d${e}\""
[str ["a"],var "b",str ["c"],str ["d", antiquote (var "e")]]
Functions
Lambdas
A function expression. See Expr'Lambda
.
Lambda | |
|
render'lambda :: Render Lambda Source #
Render a lambda expression (x: y
).
parse'lambda :: Parser Lambda Source #
Parser for a lambda expression (x: y
).
>>>
parseTest parse'lambda "x: [x x \"a\"]"
lambda (param "x") (list [var "x", var "x", str ["a"]])
>>>
parseTest parse'lambda "{a,b}:a"
lambda (pattern [param "a", param "b"]) (var "a")
>>>
parseTest parse'lambda "{ ... }: \"x\""
lambda (pattern [] <> ellipsis) (str ["x"])
>>>
parseTest parse'lambda "a@{ f, b ? g x, ... }: f b"
lambda (param "a" <> pattern [param "f", param "b" & def (apply (var "g") (var "x"))] <> ellipsis) (apply (var "f") (var "b"))
>>>
parseTest parse'lambda "a: b: \"x\""
lambda (param "a") (lambda (param "b") (str ["x"]))
Function parameters
A parameter to a Lambda
. All functions have a single parameter, but it's
more complicated than that because it may also include dict destructuring.
Param'Name Str'Unquoted | A simple single-parameter function |
Param'DictPattern DictPattern | Dict destructuring, which gives you something resembling multiple named parameters with default values |
Param'Both Str'Unquoted DictPattern | Both a param name and a dict pattern, separated by the |
render'param :: Render Param Source #
Render a lambda parameter: everything from the beginning of a lambda, up
to but not including the :
that separates the head from the body of the
lambda.
parse'param :: Parser Param Source #
Parser for a function parameter (the beginning of a Lambda
), including
the colon. This forms part of parse'expression
, so it backtracks in places
where it has overlap with other types of expressions.
parse'param'var :: Parser Param Source #
Parser for a parameter that starts with a variable. This could be a simple param that consists only of only the variable, or the variable may be followed by a dict pattern.
parse'param'noVar :: Parser Param Source #
Parser for a param that has no variable, only a a dict pattern. This parser backtracks because the beginning of a dict pattern looks like the beginning of a dict expression.
Dict patterns
data DictPattern Source #
A type of function parameter (Param
) that does dict destructuring.
DictPattern | |
|
data DictPattern'1 Source #
One item within a DictPattern
.
DictPattern'1 | |
|
render'dictPattern :: Render DictPattern Source #
Render a dict pattern ({ a, b ? c, ... }
).
render'dictPattern'1 :: Render DictPattern'1 Source #
Render a single item in a DictPattern
.
parse'dictPattern :: Parser DictPattern Source #
Parser for a dict pattern (the type of lambda parameter that does dict destructuring. This parser does not backtrack.
parse'dictPattern'start :: Parser () Source #
This is used in a lookahead by parse'param
to determine whether we're
about to start parsing a DictPattern
.
Function application
A function application expression. See Expr'Apply
.
Apply | |
|
:: Expression | Function |
-> [Expression] | Args |
-> Expression | Function application |
render'apply :: Render Apply Source #
Render a function application expression (f x
).
let
A let
-in
expression. See Expr'Let
.
Let | |
|
keyword'in :: Keyword Source #
render'let :: Render Let Source #
Render a let
-in
expression.
let
bindings
data LetBinding Source #
A semicolon-terminated binding within the binding list of a Let
expression.
LetBinding'Eq Str'Static Expression | A binding with an equals sign, of the form |
LetBinding'Inherit Inherit | A binding using the |
render'letBinding :: Render LetBinding Source #
Render a binding within a Let
, without the trailing semicolon.
with
A with
expression. See Expr'With
.
render'with :: Render With Source #
Render a with
expression.
parse'with :: Parser With Source #
inherit
Keywords
keywords :: [Keyword] Source #
All of the keywords. This list is used when parsing and rendering because an unquoted string cannot have a name that is exactly the same as a keyword.
keywordString :: Keyword -> String Source #
keywordText :: Keyword -> Text Source #
parse'keyword :: Keyword -> Parser () Source #
Backtracking parser for a particular keyword.
Comments and whitespace
parse'spaces :: Parser () Source #
parse'comment :: Parser () Source #
parse'comment'inline :: Parser () Source #
parse'comment'block :: Parser () Source #