Skip to content

Latest commit

 

History

History
33 lines (30 loc) · 2.13 KB

spec.md

File metadata and controls

33 lines (30 loc) · 2.13 KB
  1. A CoDL document is a text document encoded in UTF-8.

  2. A line is a sequence of zero or more characters beginning at the start of the document or the character immediately after a newline (\u000a) and ending at the end of the document or the character immediately before a newline character.

  3. A data line is any line which contains any characters other than space ( , \u0020), unless it is a comment line (see below).

  4. The prefix of a data line is the space characters before the first non-space character.

  5. The initial line is the first data line.

  6. The initial prefix is the prefix of the initial line.

  7. Every data line must have a prefix length greater than or equal to the initial prefix length.

  8. The result of subtracting the initial prefix length from the prefix of every line must be an integer multiple of two.

  9. The indentation of a data line is one half of the result of subtracting the initial prefix from the prefix.

  10. The indentation of a data line may be at most two greater than the indentation of the previous line.

  11. The data is the the series of characters of a data line after the prefix.

  12. The words of a data line are one or more sequences of non-space characters separated by one or more space characters.

  13. The keyword is the first word of a data line.

  14. The parameters are the zero or more words following the keyword which are not comments (see below).

  15. The keyword and parameters declare a node.

  16. The initial line declares the root node.

  17. With the exception of the root node, each node has a parent and is correspondingly a child of that node.

  18. The parent, p, of a node other than the root node, n, is declared on the last line preceding n whose indentation is exactly one less than n's indentation.

  19. If the first character after the prefix is a hash (#, \u0023), that line is a comment line and contains no data.

  20. If a word is equal to a single hash character, that word and every subsequent word on the same line are a remark and are not parameters.

  21. A trailing

FIXME: Adjacent comments intented differently