Breccia language definition - A Breccian text comprises one or more file fracta, each contained in a separate file.       ├─────┐   ╵ │ \ [graphical syntax notation], q.v. at end notes   file │   fractum ▲   ╷ │   ├─────┘       : re `(file).*(fractum)`s see `^^ File fractum$` diagram, The form of a Breccian text. ━━━━━━━━━━━━━ 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 `^^character identification$` @ `^^ Notes$` - 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 `^^character identification$` @ `^^ Notes$` - 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$` ━━━━━━━━━━━━━━━━━━━━━━━ Associative reference ─────────────────────── / A type of command point. - It forms a reference by associating one or more pre-existing text sequences (referrer, or referrers) with a remote object (referent). - Its command has this form:   referrer referential referent   ╶──┬─╴ clause ── P ──┬─╴ command ───┬─ P ──╴ clause ──┬───▶   │ │ │ │   └─────────────────┘ └──────────────────┘ : re `(referrer).*(clause)`s see `^^ referrer clause$` : re `(referential).*(command)`s see `^^ referential command$` : re `(referent)\b.*clause.*(clause)`s see `^^ referent clause$` diagram, The form of the command in an associative reference. - The referrer clause, if any, indicates the referrer or referrers, while the referent clause indicates the referent. - A single referrer may be associated with multiple referents. / Via multiple, sibling references that indicate the same referrer. - Multiple referrers may be overlapped or nested in any manner. / Via multiple, sibling references. / Via a single reference that indicates multiple referrers at once. - An associative reference to a private referent of the same author, or authors, must itself be private, else the reference is malformed. : re `private` see `^^ Privatizer$` compile( associative reference ) : join `^^simulacral reference$` @ `^^ Notes$` + `referrers( associative reference )` : re `\`(.+)\`` see same head + `referent( associative reference )` : re `\`(.+)\`` see same head ───────────────── referrer clause ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - The referrer clause, if any, explicitly locates one or more referrers in the head of the reference’s parent. - Absent a referrer clause, the whole head is taken as the sole referrer. - Otherwise the referrers are located in the head by a pattern of text.   ╶──╴‘re’╶── P ── pattern matcher ───▶ diagram, The form of a referrer clause in an associative reference. referrers( associative reference ) : join `^^simulacral reference$` @ `^^ Notes$` / The compiler resolves the referrers of an associative reference as follows. - A list in linear order of text sequences, each to be taken as a referrer. : re `text sequences` see `^^original resource$` @ `^^ Notes$` deem+ `h` a text sequence, that of `parental head text()`; `tt` a list of text sequences, intitally empty if( no referrer clause is present ) + Append `h` to `tt`. else deem+ `p` a pattern, that of the referrer clause for( each match `m` of `p` against `h` ) if( `m` captured no group ) + Append to `tt` the whole text sequence of `m`. else + Append to `tt` a disjoint text sequence comprising the union of all captured text sequences of `m`. if( `tt` is empty ) throw+ broken `re` clause, pattern `p` not found return+ `tt` parental head text() : join `^^simulacral reference$` @ `^^ Notes$` - The text sequence of the head of the source parent of the associative reference. : re `text sequence` see `^^original resource$` @ `^^ Notes$` deem+ `p` a fractum, the parent of the associative reference in the source code if( `p` is headless ) / The parent is a headless file fractum. throw+ headless parent, reference is misplaced return+ the text sequence of the head of `p` ───────────────────── referential command ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - The referential command determines the overall type of associative reference, with implications for its overall effect. : re `overall type of associative reference` see `^^. associative reference$` @ `^^ fractal types$` : re `overall effect` see `^^compile\( associative reference \)$` ·   ┌── cf.+ ───┐   │ │   ├─╴‘contra’─┤   │ │   ├─╴‘e.g.’╶──┤   │ │   ├─╴‘i.e.’╶──┤   │ │   ├─╴‘join’╶──┤   ╶──┤ ├───▶   ├─╴‘NB’╶────┤   │ │   ├─╴‘N.B.’╶──┤   │ │   ├─╴‘pace’╶──┤   │ │   ├─╴‘q.v.’╶──┤   │ │   ├─╴‘sc.’╶───┤   │ │   ├── see+ ───┤   │ │   └─╴‘viz.’╶──┘ / Referential command `q.v.` is of limited use. It makes grammatical sense only when a) the referrer clause is absent, and b) the referent clause is either absent or comprises an inferential referent indicant. 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 ───────────────── referent clause ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - The referent clause, if any, explicitly indicates the referent. - Absent a referent clause, any referrer clause *implies* the referent. - Absent a referrer clause, the referent is implied by the fractal head of the parent. - The form of a referent clause is:   ┌── inferential referent indicant ──┐   ╶──┤ ├────▶   └───────── fractum indicant ────────┘ inferential referent indicant - An inferential referent indicant comprises one or more of three parts that together define (i) referrer similarity, (ii) referential form and (iii) containment.   referrer similarity   ╭┄┄┄ i ┄┄┄┄╮   ┌──────────────────────────┐   ┌─────────────────────────┤ ┌──╴‘head’╶──┐ │   ╶──┤ ┌───╴‘same’╶────┐ └─┤ │ │ containment   └─┤ ├─┬── P ──┤ ├─┬─┬── P ──┴──╴ clause ╶──┬───▶   └──╴‘similar’╶──┘ │ └──╴‘term’╶──┘ │ │ │   └──────────────────────┘ └─────────────────────────┘     ╰┄┄ ii ┄┄╯ ╰┄┄┄┄ iii ┄┄┄┄╯   referential form containment / Examples of its use are:   : re `foo` see same @ `^^bar$`   : cf. @ `^^foo$` (It reads better with some referential commands than with others.) - Referrer similarity (i) determines how broadly or narrowly the pattern of referential form (ii) is to be interpreted for purposes of constructing its inferred definition. : see `^^pattern-matcher compilation based on referrer similarity$` @ `^^ Notes$` - Referential form (ii) determines the form of the referent and how to locate it: ‘head’ defines the referent as a fractum to be located by the pattern of its head, while ‘term’ defines the referent as a text sequence to be located by its own pattern. - In either case, the operative pattern that pinpoints the referent is constructed by inference from the pattern of the referrer, or referrers. - Containment (iii) delimits the context in which the pattern is sought. default referrer similarity() : join `^^simulacral reference$` @ `^^ Notes$` return+ ‘similar’ default referential form() : join `^^simulacral reference$` @ `^^ Notes$` if( the containing associative reference includes a referrer clause and the referential command is not `join` ) return+ ‘term’ return+ ‘head’ indicated referent( inferential referent indicant `iIR` if present ) : join `^^simulacral reference$` @ `^^ Notes$` - The fractum or text sequence to be taken as the referent. : re `fractum or text sequence` see `^^original resource$` @ `^^ Notes$` deem+ `iF` a fractum indicant; `fR` a referential form if( `iIR` is absent ) + Set `fR` to `default referential form()`. + Set `iIR` to an an inferential referent indicant comprising `fR`. else if( `iIR` defines a referential form ) + Set `fR` to that referential form. else + Set `fR` to `default referential form()`. if( the referential form `fR` is ‘head’ ) + Set `iF` to `inferred pattern()` of `iIR` in space-delimited conjunction with any containment clause of `iIR`. return+ `indicated fractum( iF )` / It follows that the referential form `fR` is ‘term’. if( `iIR` includes a containment clause ) + Set `iF` to the fractum indicant of the containment clause. deem+ `f` a fractum, that of `indicated fractum( iF if set )`; `p` a pattern, that of `inferred pattern()` of `iIR`; `tt` a list of text sequences, intitally empty for( each match `m` of `p` against the text sequence of the head of `f` ) if( `m` captured no group ) + Append to `tt` the whole text sequence of `m`. else + Append to `tt` each captured text sequence of `m`. if( `tt` is empty ) throw+ broken reference, pattern `p` not found return+ a disjoint text sequence comprising the union of all `tt` inferred pattern() : join `^^simulacral reference$` @ `^^ Notes$` - Constructs by inference from the pattern of the referrer, or referrers, a pattern to pinpoint the referent. deem+ `fR` the referential form if defined, else `default referential form()`; `p` a string buffer, initially empty; `cR` the referrer clause if present; `sR` the referrer similarity if defined, else `default referrer similarity()` if( `cR` is present ) then the pattern of the referrer(s) is the pattern of `cR` : re `pattern of the referrer` see @ `^^- Constructs by inference` @ `^^inferred pattern\(` + Set `p` to the pattern of `cR`. + Refine `p` according to referrer similarity `sR` and referential form `fR`. : see `^^pattern-matcher compilation based on referrer similarity$` @ `^^ Notes$` else( the pattern of the referrer(s) is the pattern of the parental head ) : re `pattern of the referrer` see @ `^^- Constructs by inference` @ `^^inferred pattern\(` + Set `p` to the string of `parental head text()`. + Trim `p` of comment carriers and indent blinds. + Trim `p` of leading and trailing whitespace. + Set `p` to `literalized pattern( p )`. + Collapse all remaining whitespace of `p` to ‘\s+’. / Neutralizing differences of indentation and line wrapping. + Further refine `p` according to referrer similarity `sR` and referential form `fR`. : see `^^pattern-matcher compilation based on referrer similarity$` @ `^^ Notes$` return+ `p` containment clause   ╶──╴‘@’╶── P ── fractum indicant ────▶ referent( associative reference ) : join `^^simulacral reference$` @ `^^ Notes$` - The text sequence, fractum or other resource to be taken as the referent. : re `text .+ other resource` see `^^original resource$` @ `^^ Notes$` : re `other resource` see head @ non-fractal https://datatracker.ietf.org/doc/html/rfc3986#section-1.1 / The compiler resolves the referent as follows. if( the referent clause includes a resource indicant with a `non-fractal` qualifier ) return+ `indicated resource( resource indicant )` deem+ `iF` a fractum indicant; `iIR` an inferential referent indicant if( a referent clause is present ) if( the referent clause comprises a fractum indicant ) + Set `iF` to the fractum indicant. else( the referent clause comprises an inferential referent indicant ) + Set `iIR` to the inferential referent indicant. break+ `if( a referent clause is present )` deem+ `f` a fractum, that of `indicated fractum( iF )`; `mF` a match, the match of `f` if any occurred if( no `mF` occured or `mF` captured no group ) return+ `f` return+ a disjoint text sequence comprising the union of all captured text sequences of `mF`. return+ `indicated referent( iIR if set )` ━━━━━━━━━━━━━━━ 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] - The form of the command varies with the type of command point. : re `type of command point` see `^^ fractal types$` @ `^^ Fractum$` - The `privately` modifier, if present, is equivalent to putting a privatizer on the command point. : see `^^if.+privately.+is present` @ `^^compile\( command point \)$` appendage clause - A clause of free-form, descriptive text appended to a command point.   appendage   ╭┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╮     ┌─────╴◀────────┐   │ │   ╶──╴‘:’╶──┴── P ── term ──┴─┬── P ──┬──▶   │ │   └───────┘ compile( command point ) : join `^^simulacral reference$` @ `^^ Notes$` if( `privately` is present ) + Remove `privately` and the `S` that follows it. + Append as child of the command point a privatizer. ━━━━━━━━━━━━━━━━━ 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). - 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   ╭┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╮     ┌─╴◀────┐ ┌────╴◀─────────┐   inline non- ┊ │ │ │ │ end   -plain-space ╶── S ┊╶──┴─╴‘\’╶─┴─┬── S ──┴── character ──┴─┬─┬── S ──┬──╴ of ───▶   (non-20) ┊ │ │ │ │ line   └─────────────────────────┘ └───────┘ : re `20` see `^^character identification$` @ `^^ Notes$` : 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 `^^end of line$` 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). : see `^^character identification$` @ `^^ Notes$` / 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)\R`s see `^^end of line$` ━━━━━━━━━━━━━ Compilation ───────────── - Compilation of a simulacrum from a Breccian file. - Compilation is the transformative work of various tools, all referred to here as ‘compilers’. - Initially equal to the source form, the compiler constructs the simulacral form by the transformative effect of executing its embedded command points, as follows. compile( Breccian file `f` ) : join `^^simulacral reference$` @ `^^ Notes$` for( each associative reference of `f` in linear order ) + `compile( associative reference )` : re `\`(.+)\`` see same head / Compiled early, associative references find their referents in the simulacrum before its transformation in later compilations. for( each command point of `f` in linear order ) + `compile( command point )` : re `\`(.+)\`` see same head for( each jointer of `f` in linear order ) + `compile( jointer )` : re `\`(.+)\`` see same head ━━━━━━━━━━ 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 `^^perfect indent$` @ `^^ Separation$` : re `(divider).+\R.+(drawing).+\R.+(character)` see `^^divider drawing character$` - 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 `^^character identification$` @ `^^ Notes$` 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). : see `^^character identification$` @ `^^ Notes$` division titles( divider `d` ) : join `^^simulacral reference$` @ `^^ Notes$` - A list in linear order of character strings, each to be taken as a title of the division headed by `d`. - 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. deem+ `tt` a string list, intitally empty / `tt` The list of title strings. deem+ `t` a string, `n` a text line / `t` The title being assembled, yet to be appended to `tt`. / `n` The line whose division label last contributed to `t`. for( each division label `b` of divider `d` ) if( `b` leads the line on which it occurs, discounting plain spaces (20) ) : see `^^character identification$` @ `^^ Notes$` - Then `b` is a titling label, meaning it contributes to a title. if( `n` is unset ) - Then `b` starts the first title. + Set `t` to the string of `b`. else if( `b` occurs on the line succeeding `n` ) - Then `b` appends to the title (`t`) made by its predecessor. + Set `t` to the concatenation of `t` + space character + string of `b`. else( `t` is fully assembled and `b` starts a new title ) + Append to `tt` a copy of `t`. + Set `t` to the string of `b`. + Set `n` to the line on which `b` occurs. if( `t` is set ) - Then `d` has a titling label and final title assembly `t`. + Append to `tt` a copy of `t`. return+ `tt` ──────────────── false division ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - A false 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 false division. / The appearance of extension is false because the successors lie ‘under’ the same divider merely in terms of linear order, not hierarchy. - False divisions are a linear form of partition, as opposed to the hierarchic form of true divisions. / The whole of a false 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 sequenceof body fracta.   start of file   ┄┄┄┄┄┄┄┄┄┄┄┄┄       ├──────┐   ╵ │ ╮   file │ ┊   descriptor │ ┊ head   ╷ │ ┊   ┌────┤ │ ╯   │ ├──────┘   │ │   │ ├────┐ ╮   │ ╵ │ ┊   │ body ▲ ┊   │ fractum │ ┊ body   │ ╷ │ ┊   │ ├────┘ ┊   └────┤ ╯         ┄┄┄┄┄┄┄┄┄┄┄┄┄   end of file : re `(file).*(descriptor)`s see `^^ File descriptor$` : re `(body).*(fractum)`s see `^^ 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 fractum at all, and an empty file. - The head is absent (and a body fractum 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 that yields a non-empty result after collapsing the whitespace of the relevant part of its content according to head type: file head or point head - The relevant part excludes comment carriers and precedes any indent blind. divider - The relevant part is the first division label. ━━━━━━━━━ 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 │ ┊   │ ╷ │ ┊   │ ├────┘ ┊   └────┤ ╯       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 associative reference jointer pointer 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 B - The parent of B, or an ancestor of the parent. / No file fractum has an ancestor, body fracta alone have ancestors. parent, of a body fractum B - 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 B - Another body fractum of the same parent as 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. ─────────────── 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 indicant ────────────────── / Part of an associative reference or other referential markup. - A fractum indicant comprises one or both of a pattern series and a resource indicant.   ┌────────────────────────────────────┐   ╶──┤ │   └──┬── pattern matcher ──┬──┬── CS ──┴── resource indicant ──┬───▶   │ │ │ │   └───────╴◀── CS ──────┘ └────────────────────────────────┘ - In the namesake case — absent a `non-fractal` qualifier, that is — the fractum indicant indicates a fractum. - Any pattern series pinpoints with each pattern a fractal head, while any resource indicant resolves to a Breccian file and therewith a file fractum. - The overall indicated fractum is the one resolved leftmost in the indicant and so deepest in the fractal hierarchy. / For example, here is a fractum indicant for the present fractum:   `^^/ For example, here is` @ `^^ Fractum indicant$` @ ./language_definition.brec     ╰┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╯ ╰┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╯ ╰┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄╯   pattern pattern resource indicant - Otherwise no actual fractal indication is here defined. - The only definite indication in the presence of a `non-fractal` qualifier is the indicated resource as a whole, namely the referent of the URI reference. : re `URI reference` see @ `^^ Resource indicant$` / It may be left to the reader to determine what more, if anything, the author intends. CS - A containment separator. - It comprises a containment operator ‘@’ between two postgaps.   ╶── P ──╴‘@’╶── P ───▶ indicated fractum( fractum indicant `i` if present ) : join `^^simulacral reference$` @ `^^ Notes$` - The fractum indicated, together with any match that occurred to pinpoint it. : re `fractum` see `^^original resource$` @ `^^ Notes$` deem+ `p` a pattern / The next pattern to seek in the body of fractum `f`. if( `i` is present ) if( `i` includes a resource indicant with a `non-fractal` qualifier ) throw+ non-fractal resource if( `i` includes a pattern series ) + Set `p` to the final pattern in linear order. deem+ `r` a resource, namely `indicated resource( any resource indicant of i )` if( `r` contains no file fractum ) throw+ non-Breccian resource deem+ `f` a fractum, initially the file fractum of `r`; `mF` a match; `desc` a fractum / `desc` A descendant fractum of `f`, the last matched. while( `p` is set ) for( each match `m` of pattern `p` against the body of `f` ) deem+ `head` the fractal head intersected by the first line of `m` unless( all lines of `m` intersect `head` ) throw+ ambiguous reference, `p` intersects multiple heads if( `desc` is set ) throw+ ambiguous reference, `p` matches multiple fracta + Set `desc` to the fractum of `head`. + Set `mF` to `m`. if( `desc` is unset ) throw+ broken reference, pattern `p` not found + Set `f` to `desc`. + Unset `desc`. + Set `p` to its predecessor in `i`, if any, else unset it. return+ `f` and any `mF` ━━━━━━━━━━━━━━ Indent blind ────────────── - A sequence of lines whose first non-plain-space character (non-20) is a no-break space (A0). : see `^^character identification$` @ `^^ Notes$` ·   ┌───╴◀────────┐   start ┊ │ │ ┌─── end of line ───┐   of ┊╶──┬── S ──┬── A0 ──┬─┴─ character ─┴─┬──┤ ├───▶   line ┊ │ │ │ │ └── S ── comment ───┘   └───────┘ └─────────────────┘ appender : re `(comment).+\R.+(appender)` see `^^comment appender$` 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 associative reference with a referential command of `join`. : cf. `^^Pointer$` - In effect it stands for the fractal body of its referent. - Any referrer clause in a jointer indicates the referrer in particular as the rationale for writing the jointer into the text. compile( jointer ) : join `^^simulacral reference$` @ `^^ Notes$` if( the referent of the jointer is a non-fractal resource ) return+ deem+ `sub` the fractum to subjoin if( the referent is a fractum ) + Set `sub` to the referent. else( the referent is a text sequence ) + Set `sub` to the fractum whose head contains the referent. - Each parent of the jointer gains for a subjoint child, which is not an actual child, each child of `sub` that does not duplicate a pre-existing child. - Here the duplication test ignores differences in whitespacing and comment carriage. - If in the source code `sub` itself has a jointer as its child, then the effect applies recursively. / Processors may at times treat subjoint children in a manner similar to actual children. ━━━━━━━━━━━━━ Plain point ───────────── - A catch-all designation for points of no defined subtype. : see `^^ 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 `(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$` : re `divider-drawing character` see `^^divider drawing character$` 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 `alphanumeric` see `^^alphanumeric$` @ `^^ Notes$` : re `A0` see `^^character identification$` @ `^^ Notes$` - 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 `^^character identification$` @ `^^ Notes$` : re `(comment).+\R.+(appender)` see `^^comment appender$` 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 `^^character identification$` @ `^^ Notes$` 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$` @ `^^ Fractum$` : e.g. `^^ Command point$` ━━━━━━━━━ Pointer ───────── - An associative reference whose referential command is other than ‘join’. : cf. `^^Jointer$` ━━━━━━━━━━━━ Privatizer ──────────── - A command point that makes a private fractum of its simulacral parent. / So pertaining soley to the author, or authors. : cf. `^^ Comment carrier$` / The effect applies to the parent and all its descendants. - Its command has this form:   ╶──╴‘private’╶───▶ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Regular-expression pattern matching ───────────────────────────────────── literalized pattern( string ) : join `^^simulacral reference$` @ `^^ Notes$` 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   ┌──╴‘m’╶──┐   ╶──┤ ├───▶   └──╴‘s’╶──┘ : re `(m)` see https://perldoc.perl.org/perlre#m : re `(s)` see https://perldoc.perl.org/perlre#s ────────────────── pattern language ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ - The language in which patterns are defined. : re `patterns` see `^^- Its form is:$.*(pattern)`ms @ `^^ 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. \  - 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 \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 \R - Line break. : see https://perldoc.perl.org/perlrebackslash#%5CR \t - Four spaces, viz. one unit of perfect indentation. : see `^^perfect indent$` @ `^^ Separation$` / As opposed to (Perl) a tab character. : see https://perldoc.perl.org/perlrebackslash#Fixed-characters : cf. `^^\^\^$` \N{⋯} - Character or character sequence by name or number. : see https://perldoc.perl.org/perlrebackslash#Named-or-numbered-characters-and-character-sequences ^ - The beginning (zero width) of the text in which a match is sought, or of a line if `m` is used. : re `\`(m)\`` see `^^(match modifier)$.*(m)`ms @ `^^ pattern matcher$` : see https://perldoc.perl.org/perlre#Metacharacters ^^ - A perfect indent, equivalent to `^\t*` . - Any character except a newline, or any including a newline if `s` is used. : re `\`(s)\`` see `^^(match modifier)$.*(s)`ms @ `^^ pattern matcher$` : see https://perldoc.perl.org/perlre#Metacharacters $ - The end (zero width) of the text in which a match is sought, or of a line if `m` is used. : re `\`(m)\`` see `^^(match modifier)$.*(m)`ms @ `^^ pattern matcher$` : see https://perldoc.perl.org/perlre#Metacharacters | - 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. : 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 ━━━━━━━━━━━━━━━━━━━ Resource indicant ─────────────────── / Part of an associative reference or other referential markup. ·   ╶──┬──╴‘non-fractal’╶── P ──┬── URI reference ───▶   │ │   └────────────────────────┘ : re `URI reference` see https://datatracker.ietf.org/doc/html/rfc3986#section-4.1 diagram, The form of a resource indicant. - The `non-fractal` qualifier, if present, stops any attempt to distinguish fracta in the referent during compilation. / Authors may use it to forestall compiler errors, e.g. in cases where the referent is non-Breccian or malformed. indicated resource( resource indicant `i` if present ) : re `resource` see head @ non-fractal https://datatracker.ietf.org/doc/html/rfc3986#section-1.1 : re `resource` see `^^original resource$` @ `^^ Notes$` : join `^^simulacral reference$` @ `^^ Notes$` deem+ `r` a resource, initially the present file if( `i` is present ) unless( the URI reference of `i` resolves to a referent ) throw+ broken reference + Set `r` to the referent. return+ `r` ━━━━━━━━━━━━ Separation ──────────── allowed whitespace : see `^^character identification$` @ `^^ Notes$` plain space ‘ ’ (20) newline comprising either a line feed (A), or carriage return followed by a line feed (D, A) 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. 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 `^^comment appender$` perfect indent - A separator comprising zero or more plain space characters (20) in the following form.   ┌───────────╴◀────────────┐   start ┊ │ │ ┊   of ┊╶──┬─┴─╴‘ ’╶─╴‘ ’╶─╴‘ ’╶─╴‘ ’╶─┴─┬───▶ ┊ non-whitespace   line ┊ │ │ ┊ character   └─────────────────────────────┘ : re `20` see `^^character identification$` @ `^^ Notes$` S - A separator comprising plain space characters (20) in the following form.   ┌─╴◀────┐   │ │   ╶──┴─╴‘ ’╶─┴───▶ : re `20` see `^^character identification$` @ `^^ Notes$` ━━━━━━━━━━━━ Simulacrum ──────────── - The compiled, executable form of a Breccian file, as opposed to the initial, written form of its source code. - It is a more literal form of the file, one step closer to the meaning of its text. - It results from a process of compilation. : re `compilation` see default referent: source code or simulacrum? - Except where defined otherwise, the default referent in the language definition is the source code. - Where it is unclear whether the definition refers to the simulacum versus the source code, take it as referring to the source code. ━━━━━━━━━━━━ 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 `^^character identification$` @ `^^ Notes$` - 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 inline 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$` ━━━━━━━ Notes ─────── alphanumeric - An alphanumeric character is a grapheme cluster wherein the base character either has Unicode property `alphabetic` or belongs to general category `Nd`. : re `alphabetic` see https://www.unicode.org/reports/tr44/tr44-26.html#Alphabetic : re `Nd` see https://www.unicode.org/reports/tr44/tr44-26.html#General_Category_Values character identification - Characters are identified by the hexadecimal codes of the Unicode standard. : re `Unicode standard` see https://www.unicode.org/standard/standard.html \\ \ - The present text uses syntax diagrams because it is aimed at Breccian authors in general, \ who are not expected to be comfortable with a textual notation such as Backus-Naur Form. original resource - Each text sequence, markup element or other resource here mentioned is that of the original in its place, not a separate copy of it. pattern-matcher compilation based on referrer similarity : see @ http://reluk.ca/project/Breccia/notepad.brec - How the compiler should construct inferred pattern definitions according to referrer similarity (`same` or `similar`) has yet to be defined, pending implementation trials. : re `referrer\R +similarity` see @ `^^- An inferential referent indicant comprises` @ `^^inferential referent indicant$` @ `^^ referent clause$` simulacral reference - Herein the default referent is the simulacrum, not the source code. : cf. `^^default referent` @ `^^ Simulacrum$` \\ \ - Simple plain-space separators (S) before the command, that parsers may reach the command \ and reify the fractal type without having to navigate the complex form of a postgap (P). \ Copyright © 2019-2022 Michael Allan. Licence MIT.