@tikoci/centrs
    Preparing search index...

    Interface SegmentResult

    The full segmentation of one input string.

    interface SegmentResult {
        ascii: boolean;
        comments: { end: number; start: number }[];
        defects: Defect[];
        discardFrom?: number;
        segments: Segment[];
    }
    Index
    ascii: boolean

    The input was pure ASCII, so an analyzed-byte offset into it is also a JS string index — the test a caller needs before it may treat the spans above as offsets into original itself. Published from the coordinate pass this result already ran rather than re-derived, so the two cannot disagree.

    comments: { end: number; start: number }[]

    comment spans (analyzed-byte offsets), dropped from the statement stream.

    defects: Defect[]

    Unbalanced delimiters and other structural surprises, each located; never a throw. Includes the two coordinate-pass classes (bom, non-ascii).

    discardFrom?: number

    The first } or ] that closes nothing at the top level, where RouterOS stops reading (#504). The device accepts the script and silently discards that byte and everything after it: :put 1};:put 2 lowers to (evl /putmessage=1) and }⏎:put 1 to /, on CHR 7.24.5 and 7.23.8. A ) there, or any stray close inside an open group, is a rejection instead and is only an unbalanced-close defect. Absent when there is none.

    segments: Segment[]