propensive / cellulose

A comprehensive Scala library for working with CoDL files
1 stars 0 forks source link

Work out exceptions to double-space rules #16

Open propensive opened 11 months ago

propensive commented 11 months ago

We have a general rule that on a line, after two or more spaces, a single space does not constitute a new parameter. That is, two or more spaces are required to separate subsequent parameters. For key/value-style data, this works well most of the time, but not always. In a hypothetical project definition we could have, for example,

id           my-project
name         My project
description  The project I'm developing
keywords     experimental data cli

and experimental data cli would be treated as a single parameter, which would lead to a validation failure if keywords are not allowed to contain spaces, while it should really be three separate parameters (which would be interpreted as a repeated parameter according to the schema). But we would not want the description to be split on spaces.

Offering a way to specify (in a schema) whether a field can include spaces (or not) might help here. Concretely, this would mean that the example above could be correctly interpreted without additional spaces being required between the keywords.

propensive commented 11 months ago

Currently we use the following symbols in schemata:

We could add another symbol to indicate whether parameters can contain spaces, but this would only be useful for + and *.