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 note   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 an 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. - A local associative reference to a privatized referent must itself be privatized, else the reference is malformed. : cf. `should be possible.+remove.+privatized fracta.+without impairing.+integrity` @ `^^privatizer$`i / In order to correct it, the reference must be privatized, made remote or qualified as non-fractal. ───────────────── 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 ) / One 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()` trimmed of its perfect indent; `tt` a list of text sequences, intitally empty if( no referrer clause is present ) + Append `h` to `tt`. else deem+ `p` a pattern matcher, that of the referrer clause + Put `p` into multiple-line mode. : re `multiple-line mode` see https://perldoc.perl.org/perlre#m for( each match `m` of `p` against `h` ) if( `m` is an empty text sequence ) throw+ incomplete back reference, `p` matches an empty text sequence else if( `p` contains no capture groups ) + Append to `tt` the whole text sequence of `m`. else if( any group fails in `m` to capture a non-empty text sequence ) throw+ incomplete back reference, group captures nothing in the parent head else + Append to `tt` a disjoint text sequence comprising the union of all captured text sequences of `m`. if( `tt` is empty ) throw+ broken back reference, no such text `p` in parent head return+ `tt` parental head text() - 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 text if( `p` is headless ) / The parent is a headless file fractum. throw+ misplaced back reference, no parent head to refer to 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 meaning. : re `overall type of associative reference` see `^*. associative reference$` @ `^+fractal types$` ·   ┌── 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 (`q.v.`) or comprises an inferential referent indicant (`q.v. @ foo.brec`, for example). 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 both clauses, the fractal head of the parent implies the referent. - The form of a referent clause is:   ┌── inferential referent indicant ──┐   ╶──┤ ├────▶   └───────── fractum indicant ────────┘ inferential referent indicant - An inferential referent indicant indicates a fractum based on a pattern constructed by inference from the pattern of the referrer, or referrers. - In form, it comprises a containment clause that delimits the context in which this inferred pattern is sought.   ╶──╴‘@’╶── P ── fractum indicant ────▶ / Examples of its use are:   : re `foo` see @ `^*bar$`   : cf. @ `^*foo$` indicated referent( inferential referent indicant `iIR` if present ) - 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; `defaultPM` a pattern matcher if( a referrer clause is present ) + Set `defaultPM` to `${same}`ip else + Set `defaultPM` to `^^${same}`ip if( `iIR` is present ) + Set `iF` to `defaultPM` in space-delimited conjunction with `iIR`. else + Set `iF` to `defaultPM`. return+ `indicated fractum( iF )` interpolation variables - In the fractum-indicant patterns of a referent clause, the following interpolation variables are recognized. ${1}, ${2}, ${3}, … ${9} - Equates to the text sequence captured by the correspondingly numbered capture group of the referrer-clause pattern. - Valid only in the presence of a referrer clause whose pattern matcher contains at least that number of capture groups. ${same} - Equates thus: if( a referrer clause is present ) : see `^*referrers\( associative reference \)$` @ `^^referrer clause$`i : for the procedure of applying the pattern matcher return+ the plain-space-delimited sequence of the captures of its pattern matcher, if any; otherwise its match modified thus: ⁃ Trimmed of leading and trailing whitespace ⁃ Any remaining sequences of whitespace each collapsed to a single plain space ‘ ’ (20) : re `20` see `^*character identification$` @ `^+Notes$` ⁃ Reconstituted, if the above has emptied it, as a single plain space else if( the parent of the present associative reference 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 is a file fractum or point ) return+ `parental head text()` modified thus: : see `^*parental head text` @ `^^referrer clause$`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 plain space ‘ ’ (20) : re `20` see `^*character identification$` @ `^+Notes$` referent( associative reference `rA` ) - 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 @ non-fractal https://www.rfc-editor.org/rfc/rfc3986#section-1.1 / One 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 an inferential referent indicant ) + Set `iIR` to the inferential referent indicant. break+ `if( a referent clause is present )` else( the referent clause comprises a fractum indicant ) + Set `iF` to the fractum indicant. 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 )` indicated fractum( fractum indicant `i` of an associative reference `rA` ) deem+ `f` a fractum, that of `indicated fractum( fractum indicant `i`, parent of `rA` )` : re `indicated fractum.+(parent)`s see `^*no associative self-reference$` @ `^+Notes$` if( `f` is privatized and `rA` local and unprivatized ) throw+ malformed local reference: `rA` is unprivatized yet refers to a privatized referent `f` : see `local.+reference to.+privatized referent must.+be privatized` @ `^^associative reference$`i return+ `f` ━━━━━━━━━━━━━━━ 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. 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). - 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). : re `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)$`s see `^^${same}$`i ━━━━━━━━━━ 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). : re `20` see `^*character identification$` @ `^+Notes$` 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`. - 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+ `bLast` a division label, `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 `^*character identification$` @ `^+Notes$` - 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` ──────────────── 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 sequence of 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 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 `^*character identification$` @ `^+Notes$` ━━━━━━━━━ 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 text. - A fractum indicant comprises one or both of a pattern-matcher series and a resource indicant.   ┌────────────────────────────────────┐   ╶──┤ │   └──┬── pattern matcher ──┬──┬── CS ──┴── resource indicant ──┬───▶   │ │ │ │   └───────╴◀── CS ──────┘ └────────────────────────────────┘ - In the namesake case — absent a `non-fractal` resource indicant, that is — the fractum indicant indicates a fractum. - Any pattern-matcher series pinpoints with each matcher a fractal head, while any resource indicant resolves to a Breccian file and therewith a file fractum. - Each pattern matcher of the series operates in multiple-line mode, regardless of whether match modifier `m` is given. : re `multiple-line mode` see https://perldoc.perl.org/perlre#m : re `match modifier .m.` see `^*m$` @ `^+match modifier$` @ `^+Regular-expression pattern matching$` - 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 matcher pattern matcher resource indicant - Otherwise no fractum is indicated. - The only definite indication in the presence of a `non-fractal` resource indicant is the indicated resource as a whole, namely the referent of the URI reference. : re `URI reference` see @ `^*·$` @ `^^resource indicant$`i / It may be left to the reader of the text to determine what more, if anything, the author intended. CS - A containment separator. - It comprises a containment operator ‘@’ between two postgaps.   ╶── P ──╴‘@’╶── P ───▶ indicated fractum( fractum indicant `i` if present, any fractum `fIgnore` to be excluded from the indication ) - The fractum indicated, together with any match that occurred to pinpoint it. : re `fractum` see `^*original resource$` @ `^+Notes$` deem+ `p` a pattern matcher / The one defining 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-matcher series ) + Set `p` to its final pattern matcher 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+ `fLast` a fractum, initially the file fractum of `r`; `mLast` a match while( `p` is set ) + Put `p` into multiple-line mode. : re `multiple-line mode` see https://perldoc.perl.org/perlre#m for( each match `m` of `p` against the body of `fLast` ) deem+ `f` the fractum in whose head `m` starts if( end boundary(`m`) exceeds end boundary(head of `f`) ) / Then `m` extends across multiple heads. continue+ `for`, ignoring `m` : re `ignoring .m.` see `^*ignoring a pattern match$` @ `^+Notes$` / Fractum-indicant pattern matches are confined to a single head. \ Match modifier `s` would tend to match too broadly otherwise, \ making it largely useless. if( `p` leads the pattern-matcher series, taken in linear order ) if( `i` lies within the head of `f` ) continue+ `for`, ignoring `m` : re `ignoring .m.` see `^*ignoring a pattern match$` @ `^+Notes$` / Fractum indicants do not indicate the fracta in whose heads they are contained. \ Patterns would be liable to match themselves otherwise, \ making them difficult to disambiguate. if( `i` lies within the head of `fIgnore` ) continue+ `for`, ignoring `m` : re `ignoring .m.` see `^*ignoring a pattern match$` @ `^+Notes$` if( `mLast` is unset ) + Set `mLast` to `m`. + Set `fLast` to `f`. else if( `fLast` is equal to `f` ) / Then `m` is a further match in the same head. continue+ `for`, ignoring `m` : re `ignoring .m.` see `^*ignoring a pattern match$` @ `^+Notes$` / In the context of a single fractal head, match ambiguity is allowed. throw+ ambiguous reference, `p` matches multiple fracta / Outside the narrow context of a single fractal head, pattern ambiguity is disallowed. \ Else faced with mutable \ referent texts, patterns would be too liable to silently \ miss their targets and match the wrong fracta. if( `mLast` is unset ) throw+ broken reference, pattern of `p` not found if( `p` has a predecessor in `i` ) + Set `p` to the predecessor. + Unset `mLast`. else + Unset `p`. return+ `fLast` and any `mLast` ━━━━━━━━━━━━━━ 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 may stand for the fractal body of its referent. - Each parent of the jointer gains for a subjoint child (which is not an actual child) each child of the referent fractum that does not duplicate a pre-existing child. - Here the duplication test ignores differences in whitespacing and comment carriage. - If the referent fractum itself has a jointer as its child, then the effect applies recursively. - Any referrer clause in a jointer indicates the referrer in particular as the rationale for writing the jointer into the text. ━━━━━━━━━━━━━ 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)$.+(appender)$`s see `^^${same}$`i 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 privatizes its parent, marking it (and thereby all text within it) as pertaining soley to the author, or authors. : cf. `^+Comment carrier$` - Its command has this form:   ╶──╴‘private’╶───▶ - It should be possible 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’╶──┐   │ │   ├──╴‘m’╶──┤   ╶──┤ ├───▶   ├──╴‘s’╶──┤   │ │   └──╴‘p’╶──┘ i - Enables case-insensitive matching. : see https://perldoc.perl.org/perlre#i m - Enables multiline mode. : see https://perldoc.perl.org/perlre#m s - Enables dot-all mode. : see https://perldoc.perl.org/perlre#s p - Enables expansive space mode. - The pattern is read such that any sequence of unquoted plain space characters (20) is effectively interpreted as `(?: |\N{A}|\N{D}\N{A}|\N{A0})+`. : re `20` see `^*character identification$` @ `^+Notes$` / With this, a single space in the pattern (or sequence of spaces) will match any sequence of whitespace. ────────────────── 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 \R - Line break. : see https://perldoc.perl.org/perlrebackslash#%5CR \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 `^*m$` @ `^+match modifier$` : see https://perldoc.perl.org/perlre#Metacharacters ^* - A perfect indent, equivalent to `^(?: )*`. : re `perfect indent` see `^^${same}$`i @ `^^separation$`i ^+  - An anchored prefix to where the first titling label of a division might start. : re `first titling label` cf. `^*return.+${same}` @ `^*\$\{same\}$` @ `^^interpolation variables$`i @ `^^referent clause$`i : Compatible by design. - Equivalent to `^(?: )*[\x2500-\x259F].*?\R(?: )* {1,3}` in Perl syntax. ^^ - An anchored prefix that first tries to match as `^+`, then as `^*`. - Equivalent to `^(?: )*(?:[\x2500-\x259F].*?\R(?: )* {1,3})?` in Perl syntax. . - 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 the text in which a match is sought, or of a line if `m` is used. : re `\`(m)\`` see `^*m$` @ `^+match modifier$` : see https://perldoc.perl.org/perlre#Metacharacters ${⋯} - 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 @ `^^referent clause$`i @ `^^associative reference$`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 ━━━━━━━━━━━━━━━━━━━ Resource indicant ─────────────────── / Part of an associative reference or other referential text. ·   ╶──┬──╴‘non-fractal’╶── P ──┬── URI reference ───▶   │ │   └────────────────────────┘ : re `URI reference` see https://www.rfc-editor.org/rfc/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 text processing. / Authors may use it to forestall processor errors, e.g. where the referent is malformed or non-Breccian. indicated resource( resource indicant `i` if present ) : re `resource` see @ non-fractal https://www.rfc-editor.org/rfc/rfc3986#section-1.1 : re `resource` see `^*original resource$` @ `^+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 tetrads of plain space characters (20) at the start of a line, as follows.   ┌───────────╴◀────────────┐   start ┊ │ │ ┊   of ┊╶──┬─┴─╴‘ ’╶─╴‘ ’╶─╴‘ ’╶─╴‘ ’╶─┴─┬───▶ ┊ non-whitespace   line ┊ │ │ ┊ character   └─────────────────────────────┘ : re `20` see `^*character identification$` @ `^+Notes$` / 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 `^*character identification$` @ `^+Notes$` ━━━━━━━━━━━━ 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 \\ [graphical syntax notation] \ - 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. ignoring a pattern match - The method of ignoring a pattern match is under trial. : see e.g. http://reluk.ca/project/Breccia/Web/imager/BreccianFileTranslator.java : `seek(Matcher, ImagedBodyFractum[], int, int)` no associative self-reference - Fractum indicants of associative references do not indicate the parent of the associative reference. / That would be a self reference, for the parent is considered (by association) to be part of the reference, its head containing the referrer. \ Allowing such self reference (for whatever slight utility it offers) \ would make the patterns of fractum indicants difficult to disambiguate. original resource - A text element, text sequence or other resource in its original place, not a separate copy of it. \\ [S not P] \ - 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.