diff --git a/docsite/site/content/reference/expressions.md b/docsite/site/content/reference/expressions.md index e25f30f..1056248 100644 --- a/docsite/site/content/reference/expressions.md +++ b/docsite/site/content/reference/expressions.md @@ -32,6 +32,7 @@ let tuple = { field = "value", }, list = [1, 2, 3], + "quoted field" = "quoted value", }; // reference the field in the inner tuple in our tuple defined above. @@ -41,6 +42,12 @@ tuple.inner.field; tuple.list.0; ``` +Selectors can quote fields in the selector if there are quoted fields with spaces in them. + +``` +tuple."quoted field"; +``` + ### The environment Selector There is a special selector in ucg for obtaining a value from the environment. diff --git a/docsite/site/content/reference/types.md b/docsite/site/content/reference/types.md index feaf2ee..ff663e1 100644 --- a/docsite/site/content/reference/types.md +++ b/docsite/site/content/reference/types.md @@ -65,6 +65,7 @@ UCG also has two complex types. Tuples are an ordered set of name value pairs. They are delimited by braces and should contain 1 or more `name = expression` pairs separated by commas. Trailing commas are allowed. +Field names can be barewords with no spaces or they can be quoted strings. ``` let tuple = { @@ -72,6 +73,7 @@ let tuple = { inner = { number = 1, }, + "quoted field" = "quotd value", }; ```