Clarify parsing passes.

This commit is contained in:
Dominik Pantůček 2023-03-25 16:40:03 +01:00
parent edd8b5ede7
commit e7fcb56a66

View file

@ -15,18 +15,36 @@ Symlinks to the member files serve as human-readable aliases.
The implementation handles situation when the human-readable name is The implementation handles situation when the human-readable name is
the member file and the symlink is the four-digit member id. the member file and the symlink is the four-digit member id.
Member File Parsing Member File Parsing - Passes 0 and 1
------------------- ------------------------------------
Member files are read line-by-line. Member files are read line-by-line.
### Pass 0
Comments start with the ```#``` character and continue until the end Comments start with the ```#``` character and continue until the end
of particular line. of particular line.
Comments are stripped from each line before parsing. The same applies Comments are stripped from each line before parsing. The same applies
to leading and trailing whitespace after stripping comments. to leading and trailing whitespace after stripping comments.
Each line should contain a ### Pass 1
Lines are processed as they are returned from pass 0.
Empty lines are skipped.
Lines without any whitespace are interned as symbols and error is
recorded as there is only the key and no value associated with it.
Each key/value pair must begin with key token composed of
non-whitespace characters before the first whitespace. This token is
interned as symbol upon parsing the line. The remainder of the line is
stripped of leading whitespace and stored as a string representing the
value for the key.
The result of parsing is a list of parsed records containing key,
value and line number for further processing.
Member File Grammar Member File Grammar
------------------- -------------------