From e7fcb56a660f52167dfc8968a5189c071805d5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Sat, 25 Mar 2023 16:40:03 +0100 Subject: [PATCH] Clarify parsing passes. --- MEMBERS.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/MEMBERS.md b/MEMBERS.md index 43cf72f..cc1ca39 100644 --- a/MEMBERS.md +++ b/MEMBERS.md @@ -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 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. +### Pass 0 + Comments start with the ```#``` character and continue until the end of particular line. Comments are stripped from each line before parsing. The same applies 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 -------------------