Breccia language definition - A Breccian text comprises one or more file fracta, each contained in a separate file.   │   │   ├─────┐   ╵ │   file │   fractum ▲   ╷ │   ├─────┘   │   │   ▼ : re `(file).*(fractum)`s see `^+File fractum$` diagram, The form of a Breccian text. ━━━━━━━━━━━━━ Afterlinker ───────────── - An afterlinker formulates a connection between a subject just mentioned and an object to which it refers the reader. - A type of command point, its command has this form:   subject referential object   ╶──┬── clause ── P ──┬── command ──┬── P ── clause ──┬───▶   │ │ │ │   └─────────────────┘ └─────────────────┘ diagram, The form of the command in an afterlinker. ──────────────── subject clause ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ / An optional clause within an afterlinker, - The subject clause, if present, recalls something just mentioned (the link subject) and explicitly locates the text that mentioned it.   ╶──╴‘re’╶── P ── pattern matcher ───▶ diagram, The form of a subject clause in an afterlinker. - Absent a subject clause, the mention of the subject is located implicitly as the head of the afterlinker’s parent. subject mentions( afterlinker ⁠li⁠ ) / A list in linear order of pattern matches, each locating a mention of the link subject; or any empty list if the head of ⁠li⁠’s parent is to be taken implicitly as the sole mention. if( ⁠li⁠ includes no subject clause ) return+ an empty list return+ `parental head match( pattern matcher of ⁠li⁠’s subject clause )` : see `^*parental head match` @ `^^hierarchic relata$`i ───────────────────── referential command ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - The referential command of an afterlinker refers the reader to the object, and determines the type of the afterlinker. : re `type of the (afterlinker)` see `${same}` @ `^+fractal types$` : Which in turn determines its interpretation. ·   ┌── cf.+ ───┐   │ │   ├─╴‘contra’─┤   │ │   ├─╴‘e.g.’╶──┤   │ │   ├─╴‘i.e.’╶──┤   │ │   ├─╴‘join’╶──┤   ╶──┤ ├───▶   ├─╴‘NB’╶────┤   │ │   ├─╴‘N.B.’╶──┤   │ │   ├─╴‘pace’╶──┤   │ │   ├─╴‘q.v.’╶──┤   │ │   ├─╴‘sc.’╶───┤   │ │   ├── see+ ───┤   │ │   └─╴‘viz.’╶──┘ : ad `q.v.` : Referential command `q.v.` is of limited use. It makes grammatical sense only when a) the subject clause is absent, and b) the object clause is either absent or comprises a fractal context locant (for example, `q.v. @ foo.brec`). cf.+    ╶──╴‘cf.’╶──┬── S ──╴‘e.g.’╶──┬───▶   │ │   └─────────────────┘ see+    ┌──╴‘also’╶──┐   ╶──╴‘see’╶──┬── S ──┤ ├──┬───▶   │ └──╴‘e.g.’╶──┘ │   │ │   └───────────────────────┘ \ ‘See also’ at least has no abbreviated form. \ https://english.stackexchange.com/q/491883/371457 ─────────────── object clause ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ / An optional clause within an afterlinker, - The object clause, if present, explicitly locates or identifies the link object.   ┌────── URI reference ───────┐   ╶──┤ ├───▶   ├────── fractum locant ──────┤   │ │   └── fractal context locant ──┘ : re `URI reference` see https://www.rfc-editor.org/rfc/rfc3986#section-4.1 diagram, The form of an object clause in an afterlinker. - It happens that a URI reference and a fractum locant may have the same form. - Yet an object clause in the form of a URI reference must unambiguously be taken either as a URI reference or as a fractum locant, not both. - The following method disambiguates the two cases. : note : Always an author may use a `non-fractal` qualifier to forestall a URI referent being interpreted as Breccia. comprises a URI reference( an object clause ⁠c_o⁠ in the form of a URI reference ) / Answers whether ⁠c_o⁠ is to be taken to comprise a URI reference as opposed to a fractum locant. deem+ ⁠u⁠ a URI reference unless( ⁠c_o⁠ has just the form of a URI reference ⁠u⁠ ) throw+ not in the form of a URI reference: ⁠c_o⁠ deem+ ⁠p⁠ the path component of ⁠u⁠; ⁠s⁠ a path segment : re `(path component).+(path segment)`s see https://www.rfc-editor.org/rfc/rfc3986#section-3.3 if( ⁠p⁠ ends with a path segment ⁠s⁠ ) / It follows that ⁠p⁠ does not end with ‘/’. if( ⁠s⁠ ends with ‘.brec’ ) / Then take ⁠c_o⁠ to comprise a fractum locant. return+ false if( the referent of ⁠u⁠ is known or given to comprise Breccia ) / Then take ⁠c_o⁠ to comprise a fractum locant. return+ false return+ true - Absent an object clause, the object is located implicitly by the form in which the subject was mentioned. : see `^*/ No object clause is present.$` @ `^*object\( afterlinker ⁠li⁠ \)$` object( afterlinker ⁠li⁠ ) / Locates or identifies the object. deem+ ⁠lo_f⁠ a fractum locant, ⁠m_0⁠ the pattern matcher `^^${same}`ip if( ⁠li⁠ includes an object clause ) deem+ ⁠c_o⁠ the object clause if( ⁠c_o⁠ has just the form of a URI reference ) if( `comprises a URI reference( ⁠c_o⁠ )` ) return+ the referent of the URI reference if( ⁠c_o⁠ includes a URI reference with a `non-fractal` qualifier ) return+ the referent of the URI reference / It falls to the caller or reader to determine what more, if anything, the author intended by this atypical form of reference. if( ⁠c_o⁠ comprises a fractal context locant ) + Set ⁠lo_f⁠ to ⁠m_0⁠ in space-delimited conjunction with the fractal context locant. return+ a fractum, that of `locate fractum( ⁠li⁠, ⁠lo_f⁠ )` / It happens ⁠c_o⁠ comprises a fractum locant. + Set ⁠lo_f⁠ to the fractum locant that constitutes ⁠c_o⁠. deem+ ⁠f⁠ a fractum, ⁠m⁠ a possible match, those of `locate fractum( ⁠li⁠, ⁠lo_f⁠ )` if( no ⁠m⁠ occured, or no capture group of ⁠m⁠ captured a text sequence ) return+ ⁠f⁠ return+ a disjoint text sequence comprising all captures of ⁠m⁠. / No object clause is present. + Set ⁠lo_f⁠ to ⁠m_0⁠. return+ a fractum, that of `locate fractum( ⁠li⁠, ⁠lo_f⁠ )` locate fractum( afterlinker ⁠li⁠, fractum locant ⁠lo_f⁠ ) / Returns the located fractum, together with any match that served to pinpoint it. deem+ ⁠f⁠ a fractum, ⁠m⁠ a possible match, those of `locate fractum( ⁠lo_f⁠, ⁠fIgnore⁠ = parent of ⁠li⁠ )` : ad `⁠fIgnore⁠ = parent of ⁠li⁠` : Exclude from the search area the head of linker ⁠li⁠’s parent, wherein the link subject is mentioned. \ Else too often locant matchers formed on the pattern of the mention \ — e.g. using `${same}` — will inadvertently match the mention. if( ⁠f⁠ is privatized and local to ⁠li⁠, and ⁠li⁠ is unprivatized ) throw+ malformed linker: ⁠li⁠ is unprivatized yet makes a local reference to privatized fractum ⁠f⁠ : N.B. `should be able.+remove.+privatized fracta.+without impairing.+integrity` @ `^^privatizer$`i / To repair this, either privatize ⁠li⁠, make its reference remote or non-fractal, or deprivatize ⁠f⁠. return+ ⁠f⁠ and any ⁠m⁠ ───────────────────────── interpolation variables ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - The following interpolation variables are valid in the fractum-locant patterns of an object clause. ${1}, ${2}, ${3}, … ${9} / Equates as follows. deem+ ⁠v⁠ the present instance of this interpolation variable; ⁠g⁠ the ordinal digit comprising the content of ⁠v; ⁠li⁠ an afterlinker, namely the owning fractum of ⁠v; ⁠mm⁠ the list of `subject mentions( ⁠li⁠ )` if( ⁠mm⁠ contains no mention ) throw+ back reference to a subject-clause capture, but no subject clause deem+ ⁠m⁠ the first mention of ⁠mm⁠ if( ⁠m⁠ includes no capture ⁠g⁠ ) throw+ no such capture group in the subject clause return+ the text sequence of capture ⁠g⁠ ${same} / Equates as follows. deem+ ⁠li⁠ an afterlinker, namely the owning fractum of the present instance of this interpolation variable; ⁠mm⁠ the list of `subject mentions( ⁠li⁠ )` if( ⁠mm⁠ contains a mention ) deem+ ⁠m⁠ the first mention if( ⁠m⁠ includes a capture ) return+ a text sequence comprising all captured sequences of ⁠m⁠, in capture order, separated by spaces ‘ ’ (20) : re `20` see http://unicode.org/charts/PDF/U0000.pdf return+ a copy of the whole text sequence of ⁠m⁠ modified thus: ⁃ Trimmed of leading and trailing whitespace ⁃ Any remaining sequences of whitespace each collapsed to a single space ‘ ’ (20) ⁃ Reconstituted, if the above has emptied it, as a single space else if( the parent of ⁠li⁠ is a titled division ) : see `^*division titles\( divider` @ `^^division$`i return+ the first titling label of the division title : re `first titling label` cf. `where.+${same}.+might start`sp @ `^*\^\+` @ `^^pattern language$`i @ `^^regular-expression pattern matching$`i : Compatible by design. else( the parent of ⁠li⁠ is a file fractum or point ) return+ `parental head text(⁠li⁠)` modified thus: : see `^*parental head text` @ `^^hierarchic relata$`i ⁃ Truncated to the portion prior to any comment carrier or indent blind ⁃ Trimmed of its perfect indent ⁃ Trimmed of any trailing whitespace ⁃ Any remaining sequences of whitespace each collapsed to a single space ‘ ’ (20) : re `20` see http://unicode.org/charts/PDF/U0000.pdf ━━━━━━━━━━━━━ Alarm point ───────────── - A point wherein the bullet comprises ‘!!’ or ends with ‘!!’ and is not directly followed by a no-break space (A0). : re `A0` see http://unicode.org/charts/PDF/U0080.pdf - Nominally it forms urgent matter for the attention of authors. / E.g. indicating a problem with the text. - Its descriptor, if present, is largely free in form. / It may not start with a no-break space, however, as then the point would instead be a plain point. : see `^*. One purpose of placing a no-break space.+in this position` @ `^*bullet$` ━━━━━━━━━━━━━ Aside point ───────────── - A point wherein the bullet comprises ‘/’ and is not directly followed by a no-break space (A0). : re `A0` see http://unicode.org/charts/PDF/U0080.pdf - Nominally it forms matter of less import than its place would otherwise suggest. / E.g. matter to which the reader should give less attention on a first reading. - Its descriptor, if present, is largely free in form. / It may not start with a no-break space, however, as then the point would instead be a plain point. : see `^*. One purpose of placing a no-break space.+in this position` @ `^*bullet$` ━━━━━━━━━━━━━━━ Command point ─────────────── - A point wherein the bullet comprises ‘:’ and is not directly followed by a no-break space (A0). : re `not directly followed by a no-break space` see `^*. One purpose of placing a no-break space.+in this position` @ `^*bullet$` - Its descriptor has this form:   ╶── S ──┬──╴‘privately’╶─ S ──┬── command ──┬── P ──┬── appendage clause ──┬───▶   │ │ │ │ │   └─────────────────────┘ │ └──┬───────────────────┘   └──────────┘ \ S not P before the command, in order that parsers may reach the command and identify \ the type of command point without having to navigate the formal complexity of P. - The form of the command varies with the type of command point. : re `type of (command point)` see `${same}` @ `^+fractal types$` - The `privately` modifier, if present, is equivalent to putting a privatizer on the command point. appendage clause - A clause of free-form, descriptive text appended to a command point.   appendage   ╭┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╮     ┌─────╴◀────────┐   │ │   ╶──╴‘:’╶──┴── P ── term ──┴─┬── P ──┬───▶   │ │   └───────┘ ━━━━━━━━━━━━━━━━━ Comment carrier ───────────────── - A carrier of commentary for the attention of authors, publishers or other atypical readers. : cf. `^+Privatizer$` - Each comment carrier is formed as either a comment appender or a comment block, as shown in the diagrams that follow. - In these diagrams, no commentary part begins or ends with a plain space character (20). : re `20` see http://unicode.org/charts/PDF/U0000.pdf - Any such space at the leading or trailing edge is separate from the commentary proper. comment appender - A carrier of commentary subsequent to non-commentary on the same line.   commentary   ╭┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╮     ┌─╴◀────┐ ┌────╴◀─────────┐   in-line non- ┊ │ │ │ │ end   -plain-space ╶── S ┊╶──┴─╴‘\’╶─┴─┬── S ──┴── character ──┴─┬─┬── S ──┬──╴ of ───▶   (non-20) ┊ │ │ │ │ line   └─────────────────────────┘ └───────┘ : re `20` see http://unicode.org/charts/PDF/U0000.pdf : re `(end).+(of) ─.+(line)\R`s see `^*end of line$` diagram, The form of a comment appender. comment block - A comment carrier that extends over a sequence of (one or more) whole lines.   commentary   ╭┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╮     ┌─╴◀────┐ ┌────╴◀─────────┐   start ┊ │ │ │ │ end   of ┊╶──┬── S ──┬─┴─╴‘\’╶─┴─┬── S ──┴── character ──┴─┬─┬── S ──┬──╴ of ───▶   line ┊ │ │ │ │ │ │ line   └───────┘ └─────────────────────────┘ └───────┘ : re `(end).+(of) ─.+(line)\R`s see diagram, The form of each line of a comment block. - The commentary of a comment block may include one or more no-break spaces (A0). : re `A0` see http://unicode.org/charts/PDF/U0080.pdf / An author may, for example, comment out an indent blind, or a point whose bullet contains a no-break space, without thereby introducing an error. comment-block label / A type of commentary. Part of a comment block. - Commentary delimited by two or more backslashes in a line of a comment block.   comment-block label   ╭┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╮     ┌─╴◀────┐ ┌────╴◀─────────┐   start │ │ ┊ │ │ ┊ end   of ╶──┬── S ──┬─╴‘\’╶─┴─╴‘\’╶─┴── S ┊╶──┴── character ──┴───▶ ┊╶──┬── S ──┬──╴ of   line │ │ ┊ ┊ │ │ line   └───────┘ └───────┘ : re `(end)$.+(of)$.+(line)$`s see ━━━━━━━━━━ Division ────────── - A body fractum with a head in the form of a divider. divider - The head of a division. - It comprises all contiguous divider segments.   │   │   ├─────┐   ╵ │   divider ▲   segment │   ╷ │   ├─────┘   │   │   ▼ / It follows that sibling dividers cannot be made contiguous; rather their segments would coalesce to comprise one divider. divider segment / Part of a divider. - It starts with a perfectly indented divider drawing character.   ┌───╴◀────────┐ ┊   start ┊ perfect divider │ │ ┊ divider segment,   of ┊╶─── indent ──╴ drawing ──┬─┴─ character ─┴─┬───▶ ┊ non-divider fractum,   line ┊ character │ │ ┊ or end of file   └─────────────────┘ ┊ : re `(perfect).+\R.+(indent)` see @ `^+Separation$` : re `(divider).+\R.+(drawing).+\R.+(character)` see - Outside of comment carriers and indent blinds, characters between the leading, divider drawing character and the end boundary of the segment (rightmost in diagram) are unconstrained in form. divider drawing character - A character in the Unicode range 2500-259F. : re `2500-259F` see http://unicode.org/charts/PDF/U2500.pdf : re `2500-259F` see http://unicode.org/charts/PDF/U2580.pdf division label / Part of a divider segment. - A sequence of non-divider-drawing characters within a line of a divider segment, exclusive of any ⁃ comment carrier, ⁃ indent blind or ⁃ leading or trailing plain space characters (20). : re `20` see http://unicode.org/charts/PDF/U0000.pdf division title - A division title comprises all division labels of contiguous lines (one or more in number) each of which precedes any divider drawing character of the same line. / Consider for example this divider:   ┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╮   This is a division title, ┊ This is not   and it includes this ┊   ┄┄┄┄┄┄┄┄┄┄┄┄┄ This is not ┄╯   This is a 2nd division title / Assume the horizontal lines above (‘┄┄┄’) are perfectly indented. : re `perfectly indented` see `^*perfect indent$` @ `^+Separation$` / Calling `division titles( example divider )` would yield: ⇒ ‘This is a division title, and it includes this’ ‘This is a 2nd division title’ - Presenters may give greater prominence to division titles, e.g. showing them in bold face. division titles( divider `d` ) / A list in linear order of character strings, each to be taken as a title of the division headed by `d`. deem+ `tt` a string list, intitally empty / `tt` The list of title strings. deem+ `b` and `bLast` division labels, `bString` a string, `t` a string / `t` The title being assembled, yet to be appended to `tt`. / `bLast` The division label last contributed to `t`, if any. for( each division label `b` of divider `d` ) if( `b` leads the line on which it occurs, discounting plain spaces (20) ) : re `20` see http://unicode.org/charts/PDF/U0000.pdf - Then `b` is a titling label, meaning it contributes to a title. + Set `bString` to the string of `b`. + Collapse in `bString` each sequence of plain spaces to a single plain space. if( `bLast` is unset ) - Then `b` starts the first title. + Set `t` to `bString`. else if( `b` occurs on the line succeeding `bLast` ) / Note that `bLast` must occupy a single line. : see `a sequence.+within a line`i @ `^^division label$`i - Then `b` appends to the title (`t`) made by its predecessor. + Set `t` to the concatenation of `t` + space character + `bString`. else( `t` is fully assembled and `b` starts a new title ) + Append to `tt` a copy of `t`. + Set `t` to `bString`. + Set `bLast` to `b`. if( `t` is set ) - Then `d` has a titling label and final title assembly `t`. + Append to `tt` a copy of `t`. return+ `tt` ───────────────── pseudo-division ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - A pseudo-division is a group of siblings wherein only the first is a true division (often a headless one, a bare divider), the remainder being of other fractal types. - Normally a sibling *successor* to a division is itself a division. - Where it is not, it may appear (owing to its placement under the same divider) to be *part* of that division. - Such an apparently *extended* division is called a pseudo-division. / The appearance of extension is false because the successors lie ‘under’ the same divider merely in terms of linear order, not hierarchy. - Pseudo-divisions are a linear form of partition, as opposed to the hierarchic form of true divisions. / The whole of a pseudo-division may be transformed to a true division by indenting all but the first sibling into the *body* of the first. ━━━━━━━━━━━━━━ File fractum ────────────── - The largest formal unit of Breccian composition, forming the content of a file. - It comprises a head formed as a file descriptor and/or a body formed as a sequence of body fracta.   start of file   ┄┄┄┄┄┄┄┄┄┄┄┄┄   │   │   ├──────┐   ╵ │ ╮   file │ ┊   descriptor │ ┊ head   ╷ │ ┊   ┌────┤ │ ╯   │ ├──────┘   │ │   │ ├────┐ ╮   │ ╵ │ ┊   │ body ▲ ┊   │ fractum │ ┊ body   │ ╷ │ ┊   │ ├────┘ ┊   └────┤ ╯   │   │   ▼   ┄┄┄┄┄┄┄┄┄┄┄┄┄   end of file : re `(file).*(descriptor)`s see : re `(body).*(fractum)`s see `${same}` @ `^+fractal types$` diagram, The form of a file fractum. - Either the head or the body may be absent, not both. / Absence of both implies no file fractum at all, thus an empty file. - The head is absent (and a body present) if the first line of the file is perfectly indented and not part of a comment block. : re `perfectly indented` see `^*perfect indent$` @ `^+Separation$` ───────────────── file descriptor ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ / Aka ‘file head’. : cf. `^*point descriptor$` - The head of a file fractum. - It is largely free in form, constrained only by its foregap (F) and end boundary.   ┌───────╴◀─────────┐   start ┊ │ │ ┊ end boundary   of ┊╶── F ──┬─┴── term ──┬── P ──┴─┬───▶ ┊ of head   file ┊ │ │ │ ┊   │ └──┬──────┘   └───────────────┘ : re `(end boundary)\R.+(of head)` see `^*- Always its end boundary` @ `^*head$` @ `^+Fractum$` diagram, The form of a file descriptor. - By definition, the first term will not be perfectly indented. : re `perfectly indented` see `^*perfect indent$` @ `^+Separation$` / Here a perfect indent would instead form the start of a body, not of a head. ──────────── file title ┈┈┈┈┈┈┈┈┈┈┈┈ - The file title, if any, is determined by the first fractal head in linear order whose titling extract is neither null nor empty. - The file title is that extract. titling extract( fractal head `h` ) if( `h` is a divider ) return+ the first division title of `h`, or null if there is none : re `division title` see `^^${same}$`i @ `^^division$`i else( `h` is a file head or point head ) return+ `h` modified thus: ⁃ Truncated to the portion prior to any indent blind ⁃ Divorced of all comment carriers ⁃ Trimmed of leading and trailing plain whitespace ⁃ Any remaining sequences of plain whitespace each collapsed to a single plain space ‘ ’ (20) : re `20` see http://unicode.org/charts/PDF/U0000.pdf ━━━━━━━━━ Fractum ───────── - A fractum is the basic formal unit of Breccian composition, recursion and order. - It divides formally into two parts: a head and a body.   │   │   ╵   · · · · ╮   · · ┊   · ? · ┊ head   · · ┊   · · · · ╯   ╷   │   ┌────┤ ╮   │ ├────┐ ┊   │ ╵ │ ┊   │ body ▲ ┊ body   │ fractum │ ┊   │ ╷ │ ┊   │ ├────┘ ┊   └────┤ ╯   │   │   ▼ : re `(body).*(fractum)`s see `${same}` @ `^+fractal types$` diagram, The abstract form of a fractum. head - The part of a fractum exclusive of its children. - Its form (shown abstractly in the diagram) varies according to fractal type. - Never does the head of a body fractum, however, begin with a newline. / Only a file head may begin with a newline. - Every newline belongs to the same fractal head as the character that precedes it; or, if no character precedes it, then it belongs to the file head. - Always its end boundary (not fully shown) comprises one of: • the head successor - The head successor is the fractum succeeding the head in linear order. - In terms relative to the head’s own fractum ⁠f⁠, the head successor is the first applicable of: ⁃ The first child of ⁠f⁠. / In its body, that is. ⁃ The next sibling of ⁠f⁠. ⁃ The next sibling of the nearest ancestor of ⁠f⁠. - Always in this case the final character sequence of the head comprises one or more newlines. / In this case, even a point head that nominally omits its descriptor must in fact have a descriptor comprising one or more newlines. • the end of the file body - The part of a fractum comprising its children alone; a sequence of sibling body fracta. - A body is always optional: regardless of fractal type, it may be omitted. term - Substansive content of a fractal head outside of a separator. - Formally a sequence of non-whitespace characters that does not comprise a sequence of backslashes ‘\’. / Here a sequence of backslashes ‘\’ would instead delimit a comment carrier; so forming part of a separator (F or P), not of a term. ─────────────── fractal types ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ ◆ file fractum ◇ body fractum ◆ division ◇ point ◆ alarm point ◆ aside point ◇ command point ◇ afterlinker ◆ jointer ◆ pointer ◆ note carrier ◆ privatizer ◆ plain point † ◆ task point legend ◇ abstract type ◆ concrete type † informal type ─────────────────── hierarchic relata ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ : privately cf. `comparative genealogical terms$` @ non-fractal http://reluk.ca/project/proto-wayic/origins/doc.task ancestor, of a body fractum ⁠f_b⁠ - The parent of ⁠f_b⁠, or an ancestor of the parent. / No file fractum has an ancestor, body fracta alone have ancestors. parent, of a body fractum ⁠f_b⁠ - ⁠f_b⁠’s nearest fractal predecessor of less indent, if any, otherwise the file fractum. / No file fractum has a parent, body fracta alone have parents. sibling, of a body fractum ⁠f_b⁠ - Another body fractum of the same parent as ⁠f_b⁠. / No file fractum has a sibling, body fracta alone may have siblings. / No file fractum is a sibling; all siblings are body fracta. child, of a fractum ⁠f⁠ - One for whom ⁠f⁠ is parent. / No file fractum is a child; all children are body fracta, and vice versa. descendant, of a fractum ⁠f⁠ - A child of ⁠f⁠, or a descendant of the child. / No file fractum is a descendant; all descendants are body fracta, and vice versa. parental head text( fractum ⁠f⁠ ) / The text sequence of the head of the parent of ⁠f⁠. deem+ ⁠p⁠ the parent of ⁠f⁠ if( ⁠p⁠ is headless ) / It happens ⁠p⁠ is a headless file fractum. throw+ misplaced back reference, no parent head to refer to return+ the text sequence of the head of ⁠p⁠ parental head match( pattern matcher ⁠pm⁠ ) / A list in linear order of the matches of ⁠pm⁠ within the head of the parent of ⁠pm⁠’s owning fractum. deem+ ⁠f⁠ the owning fractum of ⁠pm⁠; ⁠h⁠ a text sequence, that of `parental head text(⁠f⁠)` trimmed of its perfect indent; ⁠mm⁠ a list of matches, intitally empty; ⁠m⁠ a match for( each match ⁠m⁠ of ⁠pm⁠ against ⁠h⁠ ) if( ⁠m⁠ is an empty text sequence ) throw+ incomplete back reference, ⁠pm⁠ matches an empty text sequence if( any capture group of ⁠pm⁠ fails in ⁠m⁠ to capture a non-empty text sequence ) throw+ incomplete back reference, this group captures nothing in the parent head + Append ⁠m⁠ to ⁠mm⁠. if( ⁠mm⁠ is empty ) throw+ broken back reference, no such text ⁠pm⁠ in parent head return+ ⁠mm⁠ ─────────────── linear relata ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ predecessor, of a fractum or character ⁠x⁠ - Another that precedes ⁠x⁠ in linear order. / (in the definite sense, e.g. ‘the predecessor’) The immediate predecessor of ⁠x⁠. successor, of a fractum or character ⁠x⁠ - Another that follows ⁠x⁠ in linear order. / (in the definite sense, e.g. ‘the successor’) The immediate successor of ⁠x⁠. ━━━━━━━━━━━━━━━━ Fractum locant ──────────────── / Part of an associative or other reference. - A fractum locant locates a fractum (typical case) or a non-fractal resource (atypical).   fractal   context locant   ╭┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╮   pattern   ┌── matcher ──┬── P ─╴‘@’╶─ P ── fractum ───▶   │ │ locant   ╶────┤ └───▶   ╭ │ ╮   ┊ └─┬──╴‘non-fractal’╶── P ──┬─── URI ────▶ ┊ file locant   ┊ │ │ reference ┊   ╰ └────────────────────────┘ ╯ : re `(pattern).*(matcher)`s see : re `(fractum).*(locant)`s see : re `(URI).*(reference)`s see https://www.rfc-editor.org/rfc/rfc3986#section-4.1 diagram, The form of a fractum locant. - The `non-fractal` qualifier, if present, warns that the referent of the URI reference does not comprise Breccia. - Readers and processors should not, in this case, expect to actually locate a fractum. : re `processors.+actually (locate a fractum)` see e.g. `attempt to ${same}` @ `^^locate fractum\(.+⁠lo_f⁠.+⁠fIgnore⁠.+\)$`s locate fractum( fractum locant ⁠lo_f⁠, any fractum ⁠fIgnore⁠ whose head to exclude from the search area ) / Returns the located fractum, together with any match that served to pinpoint it. deem+ ⁠f_0⁠ a fractum if( ⁠lo_f⁠ includes a file locant ) if( a `non-fractal` qualifier is present ) throw+ attempt to locate a fractum in a referent marked ‘non-fractal’ if( no referent can be resolved from the URI reference ) throw+ unable to resolve URI reference if( the resolved referent contains no file fractum ) throw+ non-Breccian URI referent + Set ⁠f_0⁠ to the file fractum of the resolved referent. else + Set ⁠f_0⁠ to the file fractum in which ⁠lo_f⁠ is contained. deem+ ⁠p⁠ a pattern matcher, ⁠m⁠ and ⁠m_0⁠ matches if( ⁠lo_f⁠ includes a pattern matcher ) + Set ⁠p⁠ to its final pattern matcher. while( ⁠p⁠ is set ) for( each match ⁠m⁠ of ⁠p⁠ against the body of ⁠f_0⁠ ) deem+ ⁠f⁠ the fractum in whose head ⁠m⁠ starts if( end boundary(⁠m⁠) exceeds end boundary(head of ⁠f⁠) ) / Then match ⁠m⁠ extends across multiple heads. Ignore it. \ Else matchers with dot-all modifier `s` would tend to match too broadly. continue+ `for` if( ⁠p⁠ is the first pattern matcher of ⁠lo_f⁠ ) if( ⁠fIgnore⁠ is set and equals ⁠f⁠ ) / Then ignore this match. continue+ `for` if( ⁠lo_f⁠ lies within the head of ⁠f⁠ ) / Then ignore this match. Fractum locants do not locate the fracta in whose heads they are contained. \ Else too often their matchers would match themselves by accident. continue+ `for` if( ⁠m_0⁠ is unset ) + Set ⁠m_0⁠ to ⁠m⁠. + Set ⁠f_0⁠ to ⁠f⁠. else if( ⁠f_0⁠ equals ⁠f⁠ ) / Then ignore this match. It is a further match in the same head, and the first match takes precedence. continue+ `for` throw+ ambiguous reference, ⁠p⁠ matches multiple fractal heads / Such ambiguity is disallowed. \ Else pattern matchers that fail to match \ their intended targets would be too liable to match elsewhere \ and thus fail silently. if( ⁠m_0⁠ is unset ) throw+ broken reference, pattern of ⁠p⁠ not found if( pattern matcher ⁠p⁠ has a predecessor in ⁠lo_f⁠ ) + Set ⁠p⁠ to the predecessor. + Unset ⁠m_0⁠. else + Unset ⁠p⁠. return+ ⁠f_0⁠ and any ⁠m_0⁠ ━━━━━━━━━━━━━━ Indent blind ────────────── - A sequence of lines whose first non-plain-space character (non-20) is a no-break space (A0).   ┌───╴◀────────┐   start ┊ │ │ ┌─── end of line ───┐   of ┊╶──┬── S ──┬── A0 ──┬─┴─ character ─┴─┬──┤ ├───▶   line ┊ │ │ │ │ └── S ── comment ───┘   └───────┘ └─────────────────┘ appender : re `20` see http://unicode.org/charts/PDF/U0000.pdf : re `A0` see http://unicode.org/charts/PDF/U0080.pdf : re `(comment).+\R.+(appender)` see diagram, The form of each line in an indent blind. This diagram itself is an example of a blind comprising several such lines. - By definition, no line of an indent blind can be perfectly indented, regardless of its S width. : re `perfectly indented` see `^*perfect indent$` @ `^+Separation$` - Therefore no indent blind ever interrupts the fractal head in which it occurs; always the head continues through the blind. ━━━━━━━━━ Jointer ───────── - An afterlinker with a referential command of `join`. : cf. `^+Pointer$` - In effect, it may stand for the fractal body of its object. - Each parent of the jointer gains for a subjoint child (which is not an actual child) each child of the object fractum that does not duplicate a pre-existing child. - Here the duplication test ignores differences in whitespacing and comment carriage. - If the object fractum itself has a jointer as its child, then the effect applies recursively. - Any subject clause in a jointer locates the subject in particular as the rationale for writing the jointer into the text. ━━━━━━━━━━━━━━ Note carrier ────────────── - A note carrier is used to place a note. - It is a type of command point, and its command has this form:   preposition   ╭┄┄┄┄┄┄┄┄┄┄┄┄╮     ┌──╴‘ad’╶──┐ ┌────────────────────┐   │ │ │ │   ┌──┴──╴‘on’╶──┴── P ── pattern matcher ──┴── P ──┬──╴‘note’╶──┴───▶   ╶──┤ │   └────────────────────────────────────────────────┘ ╰┄┄┄┄┄┄╯   label   ╰┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╯   purview clause diagram, The form of the command in a note carrier. - The note is carried in the appendage of the command point. - The purview clause, if present, locates within the carrier parent’s head the text to which the note pertains, namely its purview. - Absent a purview clause, the purview is located implicitly as the carrier parent’s head in toto. purview( note carrier ⁠c⁠ ) / A list in linear order of pattern matches locating the text sequences to which ⁠c⁠’s note pertains, or any empty list if the note pertains implicitly to the head of ⁠c⁠’s parent. if( ⁠c⁠ includes no purview clause ) return+ an empty list return+ `parental head match( pattern matcher of ⁠c⁠’s purview clause )` : see `^*parental head match` @ `^^hierarchic relata$`i ━━━━━━━━━━━━━ Plain point ───────────── - A catch-all designation for points of no defined subtype. : re `defined subtype` see `^*◇ point` @ `^+fractal types$` - A plain point is largely free in form. ━━━━━━━ Point ─────── - A body fractum with a head in this form:   start ┊ perfect point ┊ end boundary   of ┊╶─── indent ─── bullet ──┬── descriptor ──┬───▶ ┊ of head   line ┊ │ │ ┊   └────────────────┘ : re `(perfect).+\R.+(indent)` see `^*perfect indent$` @ `^+Separation$` : re `(point).*(descriptor)`s see : re `(end boundary)\R.+(of head)` see `^*- Always its end boundary` @ `^*head$` @ `^+Fractum$` diagram, The form of a point head. bullet - The bullet of a point head is defined by its leading and trailing edges as shown in the diagrams below.   non-backslash, non-whitespace,   perfect ┊ ┌─────╴ non-divider-drawing character ────────┐   indent ┊╶──┤ ├───▶   ┊ └──┬─╴‘\’╶─┬──╴ non-backslash, non-newline, ──┘   │ │ non-plain-space character   └─╴◀────┘ : re `(perfect).+\R.+(indent)` see `^*perfect indent$` @ `^+Separation$` diagram, The form of a bullet’s leading edge. - Between the edges, any non-alphanumeric, non-whitespace character may be followed by a single no-break space (A0). / Authors may use such a no-break space in lieu of a plain space in order to avoid the formation of a trailing edge that would prematurely terminate the bullet. : re `A0` see http://unicode.org/charts/PDF/U0080.pdf - The two edge diagrams (above and below) are not mutually exclusive, their bullet characters may overlap. / The bullet may, for example, comprise a single character that alone occupies both the leading and trailing edge. ·   ┊   ┌───▶ ┊╶─── end of line   non-alphanumeric │ ┊   ┌──╴ non-whitespace ╶──┼───▶ ┊╶──╴‘ ’   │ character │ ┊ comment   ╶──┤ └───▶ ┊╶── A0 ──┐ ┌───▶ appender   │ alphanumeric ┊ │ │   └──── character ────────▶ ┊╶────────┴───┬── S ──┴─┬───▶ end of line   ┊ │ │   └─────────┘ : re `A0` see http://unicode.org/charts/PDF/U0080.pdf : re `(comment)$.+(appender)$`s see diagram, The form of a bullet’s trailing edge. The bullet itself includes only parts to the left of the dashed line. / As the diagram shows, no bullet ends with a space character, whether plain or no-break. Rather any space character at the trailing edge is separate from the bullet proper. / One purpose of placing a no-break space (A0) in this position is to defeat the formation of a special bullet (alarm, aside, command or task bullet) or comment delimiter that otherwise would occur. The present text contains examples of that usage. : re `(task bullet).*(example)`s see `^*see\+\N{U+A0}$` @ `^+referential command$` : re `(comment delimiter).*(example)`s see `^*\\\N{U+A0}$` @ `^+pattern language$` @ `^+Regular-expression pattern matching$` point descriptor : cf. `^+file descriptor$` - Descriptive text in the head of a point. - It is largely free in form, constrained only by its end boundary.   ┌───────╴◀─────────┐   ┊ ┌───────────┐ │ │ ┊ end boundary   bullet ┊╶──┤ ├──┴── P ──┬── term ──┴─┬───▶ ┊ of head   ┊ └─── A0 ──┬─┘ │ │ ┊   │ └─┬──────────┘   └──────────────┘ : re `(end boundary)\R.+(of head)` see `^*- Always its end boundary` @ `^*head$` @ `^+Fractum$` : re `A0` see http://unicode.org/charts/PDF/U0080.pdf diagram, The form of a point descriptor. / The option of a leading no-break space (A0) occurs only for a bullet ending with a non-alphanumeric, non-whitespace character, - Point descriptors of particular types may be further constrained. : re `particular types` see `^*◇ point` @ `^+fractal types$` : e.g. `^+Command point$` ━━━━━━━━━ Pointer ───────── - An afterlinker whose referential command is other than ‘join’. : cf. `^+Jointer$` ━━━━━━━━━━━━ Privatizer ──────────── - A privatizer privatizes its parent, thereby marking the parent (both head and body) as pertaining soley to the author, or authors. : cf. `^+Comment carrier$` - A type of command point, its command has this form:   ╶──╴‘private’╶───▶ - One should be able to remove all privatized fracta of a text without impairing its integrity and without substantial loss of meaning to public readers. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Regular-expression pattern matching ───────────────────────────────────── literalized pattern( string ) return+ the literally enquoted pattern of `string`, as defined for Perl `quotemeta` : re `quotemeta` see https://perldoc.perl.org/functions/quotemeta.html ───────────────── pattern matcher ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - A matcher of regular-expression patterns. Its form is:   ┌──────╴◀──────────┐   │ │   ╶──╴‘`’╶── pattern ──╴‘`’╶──┬─┴─ match modifier ─┴─┬───▶   │ │   └──────────────────────┘ : re `─ (pattern) ─` see `^+pattern language$` ──────────────── match modifier ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - A parameter that dictates how a pattern matcher operates.   ┌──╴‘i’╶──┐   ╶──┤ ├───▶   ├──╴‘s’╶──┤   │ │   └──╴‘p’╶──┘ i - Enables case-insensitive matching. : see https://perldoc.perl.org/perlre#i p - Enables expansive whitespace mode. - The pattern is read such that any sequence of unquoted plain whitespace is effectively interpreted as `(?: |\N{U+A}|\N{U+D}\N{U+A}|\N{U+A0})+`. / With this, any plain whitespace character in the pattern (or sequence of plain whitespace) will match any sequence of whitespace. s - Enables dot-all mode. : see https://perldoc.perl.org/perlre#s ────────────────── pattern language ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - The language in which patterns are defined. : re `patterns` see `Its form is:$.*─ (pattern) ─`s @ `^+pattern matcher$` - The language comprises a subset of the regular-expression elements of Perl, together with a few additions tailored to Breccia, all as detailed below. - To allow for future extensions to the language, the symbols `[ ] { }` may appear only in backslashed literal form, e.g. `\[ \] \{ \}`. \  - It ‘either takes away the special meaning of the character following it, or it is the start of a backslash or escape sequence.’ : see https://perldoc.perl.org/perlrebackslash#The-backslash - Note that it could, instead, inadvertently form a comment appender; as it does here, for example:   : see ` \\ ` @ non-fractal foo.html - To avoid that, substitute an equivalent pattern, such as:   : see ` \\\N{U+20}` @ non-fractal foo.html - To allow for future extensions to the language, alphabetic backslashes are restricted to those defined below. \b - Word boundary. : see https://perldoc.perl.org/perlrebackslash#%5Cb%7B%7D,-%5Cb,-%5CB%7B%7D,-%5CB \d - Decimal digit. : see https://perldoc.perl.org/perlrebackslash#Character-classes \N{···} - Character or character sequence by name or number. : see https://perldoc.perl.org/perlrebackslash#Named-or-numbered-characters-and-character-sequences \R - Line break. : see https://perldoc.perl.org/perlrebackslash#%5CR ^ - The beginning (zero width) of a line. : cf. https://perldoc.perl.org/perlre#Metacharacters : note : This is consistent with Perl’s multi-line mode. : see https://perldoc.perl.org/perlre#m ^* - A perfect indent, equivalent to `^(?: )*`. : re `perfect indent` see @ `^^separation$`i ^+  - Matches a divider up to where its first titling label might start. : re `first titling label` cf. `^*return.+${same}` @ `^*\$\{same\}$` @ `^^interpolation variables$`i @ `^^afterlinker$`i : Compatible by design. - Equivalent to Perl `^(?: )*[\x2500-\x259F].*?\R(?: )* {1,3}`. ^^ - Matches as `^+` if it can, otherwise as `^*`. - Equivalent to Perl `^(?: )*(?:[\x2500-\x259F].*?\R(?: )* {1,3})?`. . - Any character except a newline, or any including a newline if `s` is used. : re `\`(s)\`` see `^*s$` @ `^+match modifier$` : see https://perldoc.perl.org/perlre#Metacharacters $ - The end (zero width) of a line. : cf. https://perldoc.perl.org/perlre#Metacharacters : note : This is consistent with Perl’s multi-line mode. : see https://perldoc.perl.org/perlre#m ${···} - Variable interpolator. - Equates to the value of the named interpolation variable. - Valid only in a context that defines that variable. : e.g. `^^interpolation variables`i @ `^^afterlinker$`i | - Alternation. : see https://perldoc.perl.org/perlre#Metacharacters (···) - Capture group. : see https://perldoc.perl.org/perlre#Capture-groups (?:···) - Cluster group. : see https://perldoc.perl.org/perlre#(?:pattern) * - Zero or more times. : see https://perldoc.perl.org/perlre#Quantifiers +  - One or more times; when used as a quantifier. - Possessive; when used to qualify a quantifier. : see https://perldoc.perl.org/perlre#Quantifiers ? - Once or not at all; when used as a quantifier. - Non-greedy; when used to qualify a quantifier. : see https://perldoc.perl.org/perlre#Quantifiers ━━━━━━━━━━━━ Separation ──────────── allowed whitespace • plain space ‘ ’ (20) : re `20` see http://unicode.org/charts/PDF/U0000.pdf • newline comprising either a line feed (A), or carriage return followed by a line feed (D, A) : re `A|D` see http://unicode.org/charts/PDF/U0000.pdf • no-break space (A0) as described for use in bullets, indent blinds and comment blocks \ Allowing other horizontal whitespace characters (e.g. 9, 2000-200A, 202F, 205F, 3000) \ might lead to confusion, considering that indentation determines syntax. : re `A0` see http://unicode.org/charts/PDF/U0080.pdf end of line - Each line end is formed either as a line break indicated by a newline, or as the end of the file. F - Foregap, a separator in the following form.   ┌──────────────╴◀────────────┐   │ │   │ ┌─── comment block ────┐ │   │ │ │ │   │ ├───── indent blind ───┤ │   start ┊ │ │ │ │   of ┊╶──┴──┼────────┬── newline ──┴──┴──┬───▶   line ┊ │ │ │   └── S ─┬─┘ │   └─────────────────────┘ P - Postgap, a separator in the following form.   ┌─────────┐   │ ┌─┴── newline ───┐   │ │ │   ╶──┴── S ──┼──── comment ╶──┴──┬── F ──┬───▶   │ appender │ │   │ └──┬────┘   └──────────────────────┘ : re `(comment).+\R.+(appender)` see perfect indent - A separator comprising zero or more tetrads of plain space characters (20) at the start of a line, as follows.   ┌───────────╴◀────────────┐   start ┊ │ │ ┊   of ┊╶──┬─┴─╴‘ ’╶─╴‘ ’╶─╴‘ ’╶─╴‘ ’╶─┴─┬───▶ ┊ non-whitespace   line ┊ │ │ ┊ character   └─────────────────────────────┘ : re `20` see http://unicode.org/charts/PDF/U0000.pdf / A perfect indent marks the start of a body fractum. Specifically it marks the start of a point head or divider segment. S - A separator comprising plain space characters (20) in the following form.   ┌─╴◀────┐   │ │   ╶──┴─╴‘ ’╶─┴───▶ : re `20` see http://unicode.org/charts/PDF/U0000.pdf ━━━━━━━━━━━━ Task point ──────────── - A point wherein the bullet comprises ‘+’ or ends with ‘+’ and is not directly followed by a no-break space (A0). : re `A0` see http://unicode.org/charts/PDF/U0080.pdf - Nominally it describes or indicates work to be done. \ Defining a specialized point for tasking is justified by the Breccian purpose of text drafting \ for which in-line tasking is an important capability. \ re `purpose of text drafting` see `for point-form outlining and drafting` @ README.html - Its descriptor, if present, is largely free in form. / It may not start with a no-break space, however, as then the point would instead be a plain point. : see `^*. One purpose of placing a no-break space.+in this position` @ `^*bullet$` \ Local Variables: \ brec-to-collapse-indent-blinds: t \ End: \ Copyright © 2019-2024 Michael Allan. Licence MIT.