From b3fd7c6de341644616a5f67be36b256686032f37 Mon Sep 17 00:00:00 2001 From: pommicket Date: Mon, 8 Sep 2025 12:54:40 -0400 Subject: Various cleanup to spec --- pre-commit.sh | 11 +++++ site/404.html | 1 + site/index.html | 1 + site/spec.html | 125 ++++++++++++++++++++++++++++++-------------------------- 4 files changed, 79 insertions(+), 59 deletions(-) create mode 100755 pre-commit.sh diff --git a/pre-commit.sh b/pre-commit.sh new file mode 100755 index 0000000..995cc0a --- /dev/null +++ b/pre-commit.sh @@ -0,0 +1,11 @@ +#!/bin/bash +for file in site/*.html; do + echo "Checking $file..." + # Check with Nu validator (https://github.com/validator/validator) if installed + which vnu >/dev/null && vnu $file || exit 1 + # /dev/null is to force file names to be printed (grep -H is a GNU extension) + if grep -n '\s$' /dev/null $file; then + echo "$file has trailing white space." + exit 1 + fi +done diff --git a/site/404.html b/site/404.html index b5a6bc4..5efbee6 100644 --- a/site/404.html +++ b/site/404.html @@ -3,6 +3,7 @@ + Page not found diff --git a/site/index.html b/site/index.html index ce3d6e7..e1d086a 100644 --- a/site/index.html +++ b/site/index.html @@ -3,6 +3,7 @@ + POM Configuration Language diff --git a/site/spec.html b/site/spec.html index c8b3c6e..9435812 100644 --- a/site/spec.html +++ b/site/spec.html @@ -29,7 +29,6 @@ while still being terse and legible. The POM specification is quite strict, to avoid cases where dubious files can be accepted by some parsers while being rejected by others. - POM files should use the .pom file extension to identify themselves.

Every file describes a configuration, which is a mapping from keys to values. @@ -138,11 +137,11 @@ time = 35 min

Error handling

- All error conditions are described in this specification. A compliant POM parser should not - reject any file in any other case, outside of exceptional circumstances such as running out of memory. + All error conditions are described in this specification. A general-purpose POM parser should not + reject a file in any other case, outside of exceptional circumstances such as running out of memory. When an error occurs, it should be reported, ideally with information about the file name and line number, and the file must be entirely rejected (i.e. parsers must not attempt to preserve only the correct parts of an erroneous file). - Warnings may also be issued according to the judgment of the library author. + Warnings may also be issued according to the judgment of the parser author.

Text encoding

@@ -168,7 +167,7 @@ time = 35 min and does not contain two dots in a row (..).

- Any string of non-zero Unicode scalar values (U+0080–10FFFF, but not U+D800–U+DFFF) is a valid value. + Any string of non-zero Unicode scalar values (U+0001–10FFFF, but not U+D800–U+DFFF) is a valid value.

Parsing

@@ -204,7 +203,7 @@ time = 35 min

  • If the line does not end with ] optionally succeeded by any number of accepted-spaces, an error occurs.
  • The current-section is set to the text in between the initial [ and final ] - (white space between the [ and ] is not trimmed). + (white space after the [ and before the ] is not trimmed).
  • If the new current-section is not empty and not a valid key (see above), an error occurs. @@ -226,7 +225,7 @@ time = 35 min Let c be the first character after the = and any succeeding accepted-spaces.
  • - If c is one of "'` (U+0022 QUOTATION MARK, U+0027 APOSTROPHE, U+0060 GRAVE ACCENT), + If c is " (U+0022 QUOTATION MARK) or ` (U+0060 GRAVE ACCENT), the value is quoted, and spans from the first character after c to the next unescaped instance of c in the file (which may be on a different line). In this case,
      @@ -241,8 +240,14 @@ time = 35 min
  • - Otherwise, accepted-spaces at the end of the line are removed; - then, the value is the text starting from c and going to the end of the line. + Otherwise, the value is unquoted. In this case, +
      +
    1. accepted-spaces at the end of the line are removed.
    2. +
    3. + The value is the exact text starting from c and going + to the end of the line (escape sequences are not processed). +
    4. +
  • If the value is not a valid value (i.e. it contains a null character), an error occurs.
  • @@ -307,7 +312,7 @@ time = 35 min As a consequence, an empty string is considered to be an empty list.

    - If a list's order is irrelevant and it might be large or benefit from labelling its entries, + If a list’s order is irrelevant and it might be large or benefit from labelling its entries, a key prefix should be used instead (see the ingredients “list” in the opening example).

    @@ -333,7 +338,7 @@ time = 35 min z - things = `\,,,76` + things = \,,,76 , 76 @@ -359,7 +364,7 @@ time = 35 min

    (Likewise, an ordered series of configurations A1, …, An - can be merged by merging An-1 into An, then An-2 into + can be merged by merging A2 into A1, then A3 into the resulting configuration, etc.)

    @@ -379,7 +384,7 @@ time = 35 min some will have to be enforced by the application.

    - Every schema key is of the form k.rule, where k is a valid key, + Every schema key must be of the form k.rule, where k is a valid key, and rule is one of the rule names listed below.

    @@ -387,12 +392,12 @@ time = 35 min