segment: Add comment about zero-length segments.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 30 Nov 2021 14:54:48 +0000 (06:54 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 30 Nov 2021 14:55:06 +0000 (06:55 -0800)
src/language/lexer/segment.c

index d459116df3815cffe13586abe48f89753a1239f4..346910898ce3898b4bec6c62563a1a6f8dfe10bd 100644 (file)
@@ -1893,6 +1893,9 @@ segmenter_get_mode (const struct segmenter *s)
    bytes as part of INPUT, because they have (figuratively) been consumed by
    the segmenter.
 
+   Segments can have zero length, including segment types SEG_END,
+   SEG_SEPARATE_COMMANDS, SEG_START_DOCUMENT, SEG_INLINE_DATA, and SEG_SPACES.
+
    Failure occurs only if the segment type of the N bytes in INPUT cannot yet
    be determined.  In this case segmenter_push() returns -1.  If more input is
    available, the caller should obtain some more, then call again with a larger