kaleidl 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +621 -0
- package/dist/index.d.cts +78 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +608 -0
- package/dist/lml-artifact.cjs +11 -0
- package/dist/lml-artifact.d.cts +8 -0
- package/dist/lml-artifact.d.ts +8 -0
- package/dist/lml-artifact.js +8 -0
- package/dist/lml.cjs +68 -0
- package/dist/lml.d.cts +5 -0
- package/dist/lml.d.ts +5 -0
- package/dist/lml.js +63 -0
- package/dist/node-loaders.cjs +42 -0
- package/dist/node-loaders.d.cts +7 -0
- package/dist/node-loaders.d.ts +7 -0
- package/dist/node-loaders.js +39 -0
- package/dist/node.cjs +12 -0
- package/dist/node.d.cts +1 -0
- package/dist/node.d.ts +1 -0
- package/dist/node.js +12 -0
- package/package.json +22 -4
- package/src/lml.ts +15 -5
- package/src/node-cjs.ts +11 -0
- package/src/node-loaders.ts +49 -0
- package/src/node.ts +11 -32
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LML_ARTIFACT = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The sealed parsanol `lml` grammar artifact, byte-exact as baked
|
|
6
|
+
* by parsanol/grammars (grammar Lml, compiler 1.5.26, artifact
|
|
7
|
+
* sha256:2be6267c036caef844bb7abb7dd4f3d38613a9126647a1eb8c4b8cca4cfe2d4e).
|
|
8
|
+
* The seal is a raw-byte digest, so this travels as a string —
|
|
9
|
+
* re-vendor from parsanol/grammars on re-seal, never hand-edit.
|
|
10
|
+
*/
|
|
11
|
+
exports.LML_ARTIFACT = "{\"bindings\":null,\"version\":\"1.0.0\",\"grammar\":\"Lml\",\"shape\":\"parsanol-tree/v2\",\"binding_version\":1,\"entries\":{\"main\":{\"root\":\"lml\",\"grammar\":{\"atoms\":[{\"Entity\":{\"atom\":13}},{\"Re\":{\"pattern\":\"[ ]\"}},{\"Re\":{\"pattern\":\"[\\\\x09]\"}},{\"Re\":{\"pattern\":\"[\\\\x0d]\"}},{\"Re\":{\"pattern\":\"[\\\\x0a]\"}},{\"Entity\":{\"atom\":11}},{\"Str\":{\"pattern\":\"//\"}},{\"Re\":{\"pattern\":\"[\\\\x20-\\\\u{10ffff}]\"}},{\"Repetition\":{\"atom\":7,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Re\":{\"pattern\":\"[\\\\x0a]\"}},{\"Repetition\":{\"atom\":9,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[6,8,10]}},{\"Alternative\":{\"atoms\":[1,2,3,4,5]}},{\"Repetition\":{\"atom\":12,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":193}},{\"Re\":{\"pattern\":\"(?i:instance)\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":25}},{\"Entity\":{\"atom\":23}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Re\":{\"pattern\":\"[\\\\x61-\\\\x7a]\"}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[_]\"}},{\"Alternative\":{\"atoms\":[19,20,21,22]}},{\"Repetition\":{\"atom\":18,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"name\",\"atom\":24}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"<\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":32}},{\"Entity\":{\"atom\":23}},{\"Repetition\":{\"atom\":30,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"type\",\"atom\":31}},{\"Sequence\":{\"atoms\":[15,16,17,26,27,28,29]}},{\"Entity\":{\"atom\":32}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":64}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Entity\":{\"atom\":61}},{\"Re\":{\"pattern\":\"[ !]\"}},{\"Re\":{\"pattern\":\"[\\\\x23-\\\\x5b]\"}},{\"Re\":{\"pattern\":\"[\\\\x5d-\\\\u{10ffff}]\"}},{\"Re\":{\"pattern\":\"[\\\\\\\\]\"}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Re\":{\"pattern\":\"[\\\\\\\\]\"}},{\"Re\":{\"pattern\":\"[/]\"}},{\"Re\":{\"pattern\":\"[b]\"}},{\"Re\":{\"pattern\":\"[f]\"}},{\"Re\":{\"pattern\":\"[n]\"}},{\"Re\":{\"pattern\":\"[r]\"}},{\"Re\":{\"pattern\":\"[t]\"}},{\"Re\":{\"pattern\":\"[u]\"}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x46]\"}},{\"Re\":{\"pattern\":\"[\\\\x61-\\\\x66]\"}},{\"Alternative\":{\"atoms\":[52,53,54]}},{\"Repetition\":{\"atom\":55,\"min\":4,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[51,56]}},{\"Alternative\":{\"atoms\":[43,44,45,46,47,48,49,50,57]}},{\"Sequence\":{\"atoms\":[42,58]}},{\"Alternative\":{\"atoms\":[39,40,41,59]}},{\"Repetition\":{\"atom\":60,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Sequence\":{\"atoms\":[37,38,62]}},{\"Named\":{\"name\":\"name\",\"atom\":63}},{\"Sequence\":{\"atoms\":[34,35,36]}},{\"Alternative\":{\"atoms\":[33,65]}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":191}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":181}},{\"Entity\":{\"atom\":75}},{\"Entity\":{\"atom\":23}},{\"Repetition\":{\"atom\":73,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"key\",\"atom\":74}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":178}},{\"Str\":{\"pattern\":\"=\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":177}},{\"Entity\":{\"atom\":86}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Entity\":{\"atom\":61}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Sequence\":{\"atoms\":[82,83,84]}},{\"Named\":{\"name\":\"string\",\"atom\":85}},{\"Entity\":{\"atom\":90}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Repetition\":{\"atom\":88,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"integer\",\"atom\":89}},{\"Entity\":{\"atom\":124}},{\"Str\":{\"pattern\":\"[\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":109}},{\"Entity\":{\"atom\":86}},{\"Entity\":{\"atom\":107}},{\"Str\":{\"pattern\":\"ref:\"}},{\"Str\":{\"pattern\":\"(\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":103}},{\"Entity\":{\"atom\":23}},{\"Repetition\":{\"atom\":101,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"symbol\",\"atom\":102}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\")\"}},{\"Sequence\":{\"atoms\":[97,98,99,100,104,105]}},{\"Named\":{\"name\":\"ref\",\"atom\":106}},{\"Entity\":{\"atom\":103}},{\"Alternative\":{\"atoms\":[95,96,108]}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\",\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":109}},{\"Sequence\":{\"atoms\":[110,111,112,113]}},{\"Repetition\":{\"atom\":114,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[94,115]}},{\"Repetition\":{\"atom\":116,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\",\"}},{\"Repetition\":{\"atom\":119,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"]\"}},{\"Sequence\":{\"atoms\":[92,93,117,118,120,121,122]}},{\"Named\":{\"name\":\"array\",\"atom\":123}},{\"Entity\":{\"atom\":174}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":164}},{\"Sequence\":{\"atoms\":[72,76,77]}},{\"Entity\":{\"atom\":75}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":161}},{\"Entity\":{\"atom\":159}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":155}},{\"Entity\":{\"atom\":153}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":150}},{\"Str\":{\"pattern\":\"{\"}},{\"Lookahead\":{\"atom\":139,\"positive\":false}},{\"Str\":{\"pattern\":\"}\"}},{\"Lookahead\":{\"atom\":141,\"positive\":false}},{\"Re\":{\"pattern\":\"[\\\\x20-\\\\u{10ffff}]\"}},{\"Sequence\":{\"atoms\":[140,142,143]}},{\"Re\":{\"pattern\":\"[\\\\x09]\"}},{\"Re\":{\"pattern\":\"[\\\\x0d]\"}},{\"Re\":{\"pattern\":\"[\\\\x0a]\"}},{\"Alternative\":{\"atoms\":[144,145,146,147]}},{\"Alternative\":{\"atoms\":[136,148]}},{\"Repetition\":{\"atom\":149,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[137,138,151,152]}},{\"Alternative\":{\"atoms\":[136,148]}},{\"Repetition\":{\"atom\":154,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[134,135,156,157]}},{\"Named\":{\"name\":\"prose\",\"atom\":158}},{\"Entity\":{\"atom\":86}},{\"Alternative\":{\"atoms\":[133,160]}},{\"Sequence\":{\"atoms\":[130,131,132]}},{\"Alternative\":{\"atoms\":[129,162]}},{\"Named\":{\"name\":\"attr\",\"atom\":163}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":164}},{\"Sequence\":{\"atoms\":[165,166]}},{\"Repetition\":{\"atom\":167,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[128,168]}},{\"Repetition\":{\"atom\":169,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[126,127,170,171,172]}},{\"Named\":{\"name\":\"block\",\"atom\":173}},{\"Entity\":{\"atom\":107}},{\"Entity\":{\"atom\":103}},{\"Alternative\":{\"atoms\":[81,87,91,125,175,176]}},{\"Sequence\":{\"atoms\":[78,79,80]}},{\"Sequence\":{\"atoms\":[72,76,77]}},{\"Alternative\":{\"atoms\":[179,162]}},{\"Named\":{\"name\":\"attr\",\"atom\":180}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":181}},{\"Sequence\":{\"atoms\":[182,183]}},{\"Repetition\":{\"atom\":184,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[71,185]}},{\"Repetition\":{\"atom\":186,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[69,70,187,188,189]}},{\"Named\":{\"name\":\"block\",\"atom\":190}},{\"Sequence\":{\"atoms\":[66,67,68]}},{\"Named\":{\"name\":\"instance\",\"atom\":192}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":193}},{\"Sequence\":{\"atoms\":[194,195]}},{\"Repetition\":{\"atom\":196,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[14,197]}},{\"Repetition\":{\"atom\":198,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Sequence\":{\"atoms\":[0,199,200]}}],\"root\":201},\"bindings\":[]}},\"preprocess\":{},\"tables\":{},\"lint\":{\"order_warnings\":[\"rule value: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule value: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule item: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)\"]},\"default_entry\":\"main\",\"render\":{},\"derive\":{},\"tests\":[{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n name = \\\"A\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n pattern = \\\"{clause} %n\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelTemplate {\\n pattern = \\\"%pn.%n\\\"\\n definition \\\"one-line string shorthand\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelTemplate {\\n definition {\\n free prose with\\n * bullets\\n }\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < Labeller {\\n condition = {\\n type = \\\"element_count_gt\\\"\\n threshold = 1\\n }\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n sequences = [\\n DecimalNumericSequence,\\n AlphaUpperNumericSequence,\\n ]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n labellers = [\\n \\\"id:clause_labeller\\\",\\n \\\"id:annex_labeller\\\"\\n ]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"// leading comment\\ninstance A < LabelContext {\\n parent = B // trailing comment\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelContext {\\n name = \\\"document\\\"\\n definition {\\n top context\\n }\\n}\\n\\ninstance B < LabelContext {\\n parent = A\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance AnnexLabeller < Labeller {\\n template = [NoteSingleLabelTemplate, NoteMultipleLabelTemplate]\\n global_template = [NoteSingleGlobalLabelTemplate, NoteMultipleGlobalLabelTemplate]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"LabelStyle \\\"ISOIECLabelStyle\\\" {\\n name = \\\"ISO/IEC Label Style\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"LabelContext \\\"DocumentContext\\\" {\\n name = \\\"document\\\"\\n}\\n\\nLabelTemplate \\\"ClauseLabelTemplate\\\" {\\n pattern = \\\"{clause} %n\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"LabelStyle \\\"S\\\" {\\n sequences = [\\n ref:(DecimalNumericSequence),\\n ref:(AlphaUpperNumericSequence)\\n ]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A LabelStyle {\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n name =\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n = \\\"value\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"stray text\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n name = \\\"unterminated\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n condition = {\\n threshold = 1\\n\",\"expect\":{}}],\"docs\":{\"sp\":\"sp = whitespace and comments \u2014 legal between all tokens.\",\"lml\":\"lml = sp [instance *(sp instance)] sp \u2014 the whole document.\\nRepetitions over capturing rules use the separated form\\n([ x *(sp x) ]); a bare repetition of a dict-producing rule\\ntrips the native VM's subtree merge.\",\"instance\":\"instance = a typed profile instance with a block body, in either\\nheader form: `instance Name < Type` (the LADL worked profile) or\\n`Type \\\"Name\\\"` (the spec-annex style). Both bind {name, type}.\",\"attr_block\":\"attr_block = the { ... } body of an instance: attributes and comments.\",\"attr\":\"attr = key = value, or a shorthand (prose block / one-line string).\",\"attr_eq\":\"attr_eq = the = value half of an attribute.\",\"attr_shorthand\":\"shorthand without \\\"=\\\": a prose block or a one-line string\",\"value\":\"value = string / integer / array / inline block / reference /\\nsymbol reference.\",\"reference\":\"reference = the explicit reference form ref:(Name) used by the\\nspec-annex style (bound as ref).\",\"inline_block\":\"inline_block = a nested attribute block as a value (conditional templates).\",\"array\":\"array = comma-separated strings and symbols; a trailing comma is legal.\",\"item\":\"item = one array element: a string, a reference, or a symbol\\nreference.\",\"prose_block\":\"prose = free text with balanced braces (definition blocks,\\nbullet lists); nests so {key} tokens cannot terminate the block.\",\"prose\":\"prose = free text with balanced braces (definition bodies).\",\"prose_nested\":\"prose_nested = a brace-nested span inside prose ({key} tokens cannot close a block).\",\"key\":\"key = an attribute name.\",\"instance_name\":\"instance_name = the declaring name of an instance (bound as name).\",\"instance_quoted_name\":\"instance_quoted_name = the quoted declaring name in the Type \\\"Name\\\"\\nheader form (bound as name, same capture as the keyword form).\",\"type_name\":\"type_name = the supertype after <, or the leading type of the\\nType \\\"Name\\\" header form (bound as type).\",\"symbol\":\"symbol = a bare reference to a sibling instance or a built-in sequence.\",\"integer\":\"integer = a bare non-negative integer (condition thresholds).\",\"string\":\"string = a single-line double-quoted string with backslash escapes.\",\"string_body\":\"string_body = the string character run (shared by string and the\\nquoted instance-name header form).\",\"comment\":\"comment = // to end of line, consuming the terminator.\",\"name_char\":\"name_char = the shared identifier class: A-Z a-z 0-9 _.\"},\"source\":\"# LML: the LutaML textual realization of the MN 112 (LADL) labeling\\n# profile \u2014 the kaleidl fleet's source format. A document is a stream\\n# of typed instances with two header forms \u2014 `instance Name < Type { }`\\n# (the LADL worked profile) and `Type \\\"Name\\\" { }` (the spec-annex\\n# style); both bind {name, type}. Attributes\\n# take five value shapes: quoted strings (label words carry {key}\\n# tokens and %n placeholders as plain string content), integers, bare\\n# symbol references (built-in sequences, sibling instances), arrays of\\n# strings and symbols (trailing comma allowed), and inline attribute\\n# blocks (conditional templates: condition = { type = ... threshold = 1 }).\\n# Two attribute shorthands bind without \\\"=\\\": a prose definition block\\n# (`definition { free text with * bullets }`) and a one-line string\\n# (`definition \\\"...\\\"`). \\\"//\\\" comments run to end of line and are legal\\n# wherever whitespace is. Instances may appear in any order; an empty\\n# document parses.\\n#\\n# Dialect notes: names are [A-Za-z0-9_] runs (instance names, types,\\n# keys, symbols share the class \u2014 the integer rule wins on ordered\\n# choice); strings are single-line with backslash escapes; braces\\n# balance recursively inside prose blocks; CRLF is tolerated as\\n# whitespace. Parsed but not validated: cross-references between\\n# instances (a name may reference an instance defined anywhere or a\\n# host-declared built-in sequence).\\n\\ngrammar Lml version \\\"1.0.0\\\" edition 2 {\\n ## sp = whitespace and comments \u2014 legal between all tokens.\\n sp = *( %x20 / %x09 / %x0D / %x0A / comment )\\n\\n ## lml = sp [instance *(sp instance)] sp \u2014 the whole document.\\n ## Repetitions over capturing rules use the separated form\\n ## ([ x *(sp x) ]); a bare repetition of a dict-producing rule\\n ## trips the native VM's subtree merge.\\n lml = sp [ instance *( sp instance ) ] sp\\n\\n ## instance = a typed profile instance with a block body, in either\\n ## header form: `instance Name < Type` (the LADL worked profile) or\\n ## `Type \\\"Name\\\"` (the spec-annex style). Both bind {name, type}.\\n instance = ( ( %i\\\"instance\\\" sp instance_name sp \\\"<\\\" sp type_name / type_name sp instance_quoted_name ) sp attr_block ) as instance\\n\\n ## attr_block = the { ... } body of an instance: attributes and comments.\\n attr_block = ( \\\"{\\\" sp [ attr *( sp attr ) ] sp \\\"}\\\" ) as block\\n\\n ## attr = key = value, or a shorthand (prose block / one-line string).\\n attr = ( key sp attr_eq / key sp attr_shorthand ) as attr\\n ## attr_eq = the = value half of an attribute.\\n attr_eq = \\\"=\\\" sp value\\n ## shorthand without \\\"=\\\": a prose block or a one-line string\\n attr_shorthand = prose_block / string\\n\\n ## value = string / integer / array / inline block / reference /\\n ## symbol reference.\\n value = string / integer / array / inline_block / reference / symbol\\n ## reference = the explicit reference form ref:(Name) used by the\\n ## spec-annex style (bound as ref).\\n reference = ( \\\"ref:\\\" \\\"(\\\" sp symbol sp \\\")\\\" ) as ref\\n ## inline_block = a nested attribute block as a value (conditional templates).\\n inline_block = ( \\\"{\\\" sp [ attr *( sp attr ) ] sp \\\"}\\\" ) as block\\n\\n ## array = comma-separated strings and symbols; a trailing comma is legal.\\n array = ( \\\"[\\\" sp [ item *( sp \\\",\\\" sp item ) ] sp [ \\\",\\\" ] sp \\\"]\\\" ) as array\\n ## item = one array element: a string, a reference, or a symbol\\n ## reference.\\n item = string / reference / symbol\\n\\n ## prose = free text with balanced braces (definition blocks,\\n ## bullet lists); nests so {key} tokens cannot terminate the block.\\n prose_block = ( \\\"{\\\" prose sp \\\"}\\\" ) as prose\\n ## prose = free text with balanced braces (definition bodies).\\n prose = *( prose_nested / ( !\\\"{\\\" !\\\"}\\\" %x20-10FFFF / %x09 / %x0D / %x0A ) )\\n ## prose_nested = a brace-nested span inside prose ({key} tokens cannot close a block).\\n prose_nested = \\\"{\\\" prose sp \\\"}\\\"\\n\\n ## key = an attribute name.\\n key = ( 1*name_char ) as key\\n ## instance_name = the declaring name of an instance (bound as name).\\n instance_name = ( 1*name_char ) as name\\n ## instance_quoted_name = the quoted declaring name in the Type \\\"Name\\\"\\n ## header form (bound as name, same capture as the keyword form).\\n instance_quoted_name = ( %x22 string_body %x22 ) as name\\n ## type_name = the supertype after <, or the leading type of the\\n ## Type \\\"Name\\\" header form (bound as type).\\n type_name = ( 1*name_char ) as type\\n ## symbol = a bare reference to a sibling instance or a built-in sequence.\\n symbol = ( 1*name_char ) as symbol\\n ## integer = a bare non-negative integer (condition thresholds).\\n integer = ( 1*%x30-39 ) as integer\\n\\n ## string = a single-line double-quoted string with backslash escapes.\\n string = ( %x22 string_body %x22 ) as string\\n ## string_body = the string character run (shared by string and the\\n ## quoted instance-name header form).\\n string_body = *( %x20-21 / %x23-5B / %x5D-10FFFF / %x5C ( %x22 / %x5C / %x2F / %x62 / %x66 / %x6E / %x72 / %x74 / ( %x75 4*( %x30-39 / %x41-46 / %x61-66 ) ) ) )\\n\\n ## comment = // to end of line, consuming the terminator.\\n comment = \\\"//\\\" *( %x20-10FFFF ) [ %x0A ]\\n\\n ## name_char = the shared identifier class: A-Z a-z 0-9 _.\\n name_char = %x41-5A / %x61-7A / %x30-39 / %x5F\\n\\n entry main: lml\\n\\n test {\\n accept \\\"instance A < LabelStyle {\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n name = \\\\\\\"A\\\\\\\"\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n pattern = \\\\\\\"{clause} %n\\\\\\\"\\\\n}\\\"\\n accept \\\"instance A < LabelTemplate {\\\\n pattern = \\\\\\\"%pn.%n\\\\\\\"\\\\n definition \\\\\\\"one-line string shorthand\\\\\\\"\\\\n}\\\"\\n accept \\\"instance A < LabelTemplate {\\\\n definition {\\\\n free prose with\\\\n * bullets\\\\n }\\\\n}\\\"\\n accept \\\"instance A < Labeller {\\\\n condition = {\\\\n type = \\\\\\\"element_count_gt\\\\\\\"\\\\n threshold = 1\\\\n }\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n sequences = [\\\\n DecimalNumericSequence,\\\\n AlphaUpperNumericSequence,\\\\n ]\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n labellers = [\\\\n \\\\\\\"id:clause_labeller\\\\\\\",\\\\n \\\\\\\"id:annex_labeller\\\\\\\"\\\\n ]\\\\n}\\\"\\n accept \\\"// leading comment\\\\ninstance A < LabelContext {\\\\n parent = B // trailing comment\\\\n}\\\"\\n accept \\\"instance A < LabelContext {\\\\n name = \\\\\\\"document\\\\\\\"\\\\n definition {\\\\n top context\\\\n }\\\\n}\\\\n\\\\ninstance B < LabelContext {\\\\n parent = A\\\\n}\\\"\\n accept \\\"instance AnnexLabeller < Labeller {\\\\n template = [NoteSingleLabelTemplate, NoteMultipleLabelTemplate]\\\\n global_template = [NoteSingleGlobalLabelTemplate, NoteMultipleGlobalLabelTemplate]\\\\n}\\\"\\n accept \\\"\\\"\\n accept \\\"LabelStyle \\\\\\\"ISOIECLabelStyle\\\\\\\" {\\\\n name = \\\\\\\"ISO/IEC Label Style\\\\\\\"\\\\n}\\\"\\n accept \\\"LabelContext \\\\\\\"DocumentContext\\\\\\\" {\\\\n name = \\\\\\\"document\\\\\\\"\\\\n}\\\\n\\\\nLabelTemplate \\\\\\\"ClauseLabelTemplate\\\\\\\" {\\\\n pattern = \\\\\\\"{clause} %n\\\\\\\"\\\\n}\\\"\\n accept \\\"LabelStyle \\\\\\\"S\\\\\\\" {\\\\n sequences = [\\\\n ref:(DecimalNumericSequence),\\\\n ref:(AlphaUpperNumericSequence)\\\\n ]\\\\n}\\\"\\n reject \\\"instance A LabelStyle {\\\\n}\\\"\\n reject \\\"instance A < LabelStyle {\\\\n name =\\\\n}\\\"\\n reject \\\"instance A < LabelStyle {\\\\n = \\\\\\\"value\\\\\\\"\\\\n}\\\"\\n reject \\\"stray text\\\"\\n reject \\\"instance A < LabelStyle {\\\\n name = \\\\\\\"unterminated\\\\n}\\\"\\n reject \\\"instance A < LabelStyle {\\\\n condition = {\\\\n threshold = 1\\\\n\\\"\\n }\\n}\\n\",\"source_hash\":\"3d1955259129bce3745d88fad983864853d94649c73f9626b2191592f5199e8a\",\"unicode_tables\":\"onigmo (Ruby 4.0.7)\",\"compiler_version\":\"1.5.26\",\"edition\":2,\"semantics_hash\":\"sha256:078b27121f2d50d096c68999311dd8a7058752450d4cd5d90f0439adcd754778\",\"checksum\":\"sha256:2be6267c036caef844bb7abb7dd4f3d38613a9126647a1eb8c4b8cca4cfe2d4e\",\"validated\":{\"lint_errors\":0,\"lint_warnings\":3,\"tests_total\":21,\"tests_failures\":0,\"self_test\":true},\"byte_checksum\":\"sha256:3a1f029e0e8716dc4680e29adb31ebfa0afea33755ec6ff5d6c815910d036f2b\"}\n";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sealed parsanol `lml` grammar artifact, byte-exact as baked
|
|
3
|
+
* by parsanol/grammars (grammar Lml, compiler 1.5.26, artifact
|
|
4
|
+
* sha256:2be6267c036caef844bb7abb7dd4f3d38613a9126647a1eb8c4b8cca4cfe2d4e).
|
|
5
|
+
* The seal is a raw-byte digest, so this travels as a string —
|
|
6
|
+
* re-vendor from parsanol/grammars on re-seal, never hand-edit.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LML_ARTIFACT = "{\"bindings\":null,\"version\":\"1.0.0\",\"grammar\":\"Lml\",\"shape\":\"parsanol-tree/v2\",\"binding_version\":1,\"entries\":{\"main\":{\"root\":\"lml\",\"grammar\":{\"atoms\":[{\"Entity\":{\"atom\":13}},{\"Re\":{\"pattern\":\"[ ]\"}},{\"Re\":{\"pattern\":\"[\\\\x09]\"}},{\"Re\":{\"pattern\":\"[\\\\x0d]\"}},{\"Re\":{\"pattern\":\"[\\\\x0a]\"}},{\"Entity\":{\"atom\":11}},{\"Str\":{\"pattern\":\"//\"}},{\"Re\":{\"pattern\":\"[\\\\x20-\\\\u{10ffff}]\"}},{\"Repetition\":{\"atom\":7,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Re\":{\"pattern\":\"[\\\\x0a]\"}},{\"Repetition\":{\"atom\":9,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[6,8,10]}},{\"Alternative\":{\"atoms\":[1,2,3,4,5]}},{\"Repetition\":{\"atom\":12,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":193}},{\"Re\":{\"pattern\":\"(?i:instance)\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":25}},{\"Entity\":{\"atom\":23}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Re\":{\"pattern\":\"[\\\\x61-\\\\x7a]\"}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[_]\"}},{\"Alternative\":{\"atoms\":[19,20,21,22]}},{\"Repetition\":{\"atom\":18,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"name\",\"atom\":24}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"<\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":32}},{\"Entity\":{\"atom\":23}},{\"Repetition\":{\"atom\":30,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"type\",\"atom\":31}},{\"Sequence\":{\"atoms\":[15,16,17,26,27,28,29]}},{\"Entity\":{\"atom\":32}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":64}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Entity\":{\"atom\":61}},{\"Re\":{\"pattern\":\"[ !]\"}},{\"Re\":{\"pattern\":\"[\\\\x23-\\\\x5b]\"}},{\"Re\":{\"pattern\":\"[\\\\x5d-\\\\u{10ffff}]\"}},{\"Re\":{\"pattern\":\"[\\\\\\\\]\"}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Re\":{\"pattern\":\"[\\\\\\\\]\"}},{\"Re\":{\"pattern\":\"[/]\"}},{\"Re\":{\"pattern\":\"[b]\"}},{\"Re\":{\"pattern\":\"[f]\"}},{\"Re\":{\"pattern\":\"[n]\"}},{\"Re\":{\"pattern\":\"[r]\"}},{\"Re\":{\"pattern\":\"[t]\"}},{\"Re\":{\"pattern\":\"[u]\"}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x46]\"}},{\"Re\":{\"pattern\":\"[\\\\x61-\\\\x66]\"}},{\"Alternative\":{\"atoms\":[52,53,54]}},{\"Repetition\":{\"atom\":55,\"min\":4,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[51,56]}},{\"Alternative\":{\"atoms\":[43,44,45,46,47,48,49,50,57]}},{\"Sequence\":{\"atoms\":[42,58]}},{\"Alternative\":{\"atoms\":[39,40,41,59]}},{\"Repetition\":{\"atom\":60,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Sequence\":{\"atoms\":[37,38,62]}},{\"Named\":{\"name\":\"name\",\"atom\":63}},{\"Sequence\":{\"atoms\":[34,35,36]}},{\"Alternative\":{\"atoms\":[33,65]}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":191}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":181}},{\"Entity\":{\"atom\":75}},{\"Entity\":{\"atom\":23}},{\"Repetition\":{\"atom\":73,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"key\",\"atom\":74}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":178}},{\"Str\":{\"pattern\":\"=\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":177}},{\"Entity\":{\"atom\":86}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Entity\":{\"atom\":61}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Sequence\":{\"atoms\":[82,83,84]}},{\"Named\":{\"name\":\"string\",\"atom\":85}},{\"Entity\":{\"atom\":90}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Repetition\":{\"atom\":88,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"integer\",\"atom\":89}},{\"Entity\":{\"atom\":124}},{\"Str\":{\"pattern\":\"[\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":109}},{\"Entity\":{\"atom\":86}},{\"Entity\":{\"atom\":107}},{\"Str\":{\"pattern\":\"ref:\"}},{\"Str\":{\"pattern\":\"(\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":103}},{\"Entity\":{\"atom\":23}},{\"Repetition\":{\"atom\":101,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"symbol\",\"atom\":102}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\")\"}},{\"Sequence\":{\"atoms\":[97,98,99,100,104,105]}},{\"Named\":{\"name\":\"ref\",\"atom\":106}},{\"Entity\":{\"atom\":103}},{\"Alternative\":{\"atoms\":[95,96,108]}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\",\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":109}},{\"Sequence\":{\"atoms\":[110,111,112,113]}},{\"Repetition\":{\"atom\":114,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[94,115]}},{\"Repetition\":{\"atom\":116,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\",\"}},{\"Repetition\":{\"atom\":119,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"]\"}},{\"Sequence\":{\"atoms\":[92,93,117,118,120,121,122]}},{\"Named\":{\"name\":\"array\",\"atom\":123}},{\"Entity\":{\"atom\":174}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":164}},{\"Sequence\":{\"atoms\":[72,76,77]}},{\"Entity\":{\"atom\":75}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":161}},{\"Entity\":{\"atom\":159}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":155}},{\"Entity\":{\"atom\":153}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":150}},{\"Str\":{\"pattern\":\"{\"}},{\"Lookahead\":{\"atom\":139,\"positive\":false}},{\"Str\":{\"pattern\":\"}\"}},{\"Lookahead\":{\"atom\":141,\"positive\":false}},{\"Re\":{\"pattern\":\"[\\\\x20-\\\\u{10ffff}]\"}},{\"Sequence\":{\"atoms\":[140,142,143]}},{\"Re\":{\"pattern\":\"[\\\\x09]\"}},{\"Re\":{\"pattern\":\"[\\\\x0d]\"}},{\"Re\":{\"pattern\":\"[\\\\x0a]\"}},{\"Alternative\":{\"atoms\":[144,145,146,147]}},{\"Alternative\":{\"atoms\":[136,148]}},{\"Repetition\":{\"atom\":149,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[137,138,151,152]}},{\"Alternative\":{\"atoms\":[136,148]}},{\"Repetition\":{\"atom\":154,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[134,135,156,157]}},{\"Named\":{\"name\":\"prose\",\"atom\":158}},{\"Entity\":{\"atom\":86}},{\"Alternative\":{\"atoms\":[133,160]}},{\"Sequence\":{\"atoms\":[130,131,132]}},{\"Alternative\":{\"atoms\":[129,162]}},{\"Named\":{\"name\":\"attr\",\"atom\":163}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":164}},{\"Sequence\":{\"atoms\":[165,166]}},{\"Repetition\":{\"atom\":167,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[128,168]}},{\"Repetition\":{\"atom\":169,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[126,127,170,171,172]}},{\"Named\":{\"name\":\"block\",\"atom\":173}},{\"Entity\":{\"atom\":107}},{\"Entity\":{\"atom\":103}},{\"Alternative\":{\"atoms\":[81,87,91,125,175,176]}},{\"Sequence\":{\"atoms\":[78,79,80]}},{\"Sequence\":{\"atoms\":[72,76,77]}},{\"Alternative\":{\"atoms\":[179,162]}},{\"Named\":{\"name\":\"attr\",\"atom\":180}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":181}},{\"Sequence\":{\"atoms\":[182,183]}},{\"Repetition\":{\"atom\":184,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[71,185]}},{\"Repetition\":{\"atom\":186,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[69,70,187,188,189]}},{\"Named\":{\"name\":\"block\",\"atom\":190}},{\"Sequence\":{\"atoms\":[66,67,68]}},{\"Named\":{\"name\":\"instance\",\"atom\":192}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":193}},{\"Sequence\":{\"atoms\":[194,195]}},{\"Repetition\":{\"atom\":196,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[14,197]}},{\"Repetition\":{\"atom\":198,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Sequence\":{\"atoms\":[0,199,200]}}],\"root\":201},\"bindings\":[]}},\"preprocess\":{},\"tables\":{},\"lint\":{\"order_warnings\":[\"rule value: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule value: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule item: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)\"]},\"default_entry\":\"main\",\"render\":{},\"derive\":{},\"tests\":[{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n name = \\\"A\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n pattern = \\\"{clause} %n\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelTemplate {\\n pattern = \\\"%pn.%n\\\"\\n definition \\\"one-line string shorthand\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelTemplate {\\n definition {\\n free prose with\\n * bullets\\n }\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < Labeller {\\n condition = {\\n type = \\\"element_count_gt\\\"\\n threshold = 1\\n }\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n sequences = [\\n DecimalNumericSequence,\\n AlphaUpperNumericSequence,\\n ]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n labellers = [\\n \\\"id:clause_labeller\\\",\\n \\\"id:annex_labeller\\\"\\n ]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"// leading comment\\ninstance A < LabelContext {\\n parent = B // trailing comment\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelContext {\\n name = \\\"document\\\"\\n definition {\\n top context\\n }\\n}\\n\\ninstance B < LabelContext {\\n parent = A\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance AnnexLabeller < Labeller {\\n template = [NoteSingleLabelTemplate, NoteMultipleLabelTemplate]\\n global_template = [NoteSingleGlobalLabelTemplate, NoteMultipleGlobalLabelTemplate]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"LabelStyle \\\"ISOIECLabelStyle\\\" {\\n name = \\\"ISO/IEC Label Style\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"LabelContext \\\"DocumentContext\\\" {\\n name = \\\"document\\\"\\n}\\n\\nLabelTemplate \\\"ClauseLabelTemplate\\\" {\\n pattern = \\\"{clause} %n\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"LabelStyle \\\"S\\\" {\\n sequences = [\\n ref:(DecimalNumericSequence),\\n ref:(AlphaUpperNumericSequence)\\n ]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A LabelStyle {\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n name =\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n = \\\"value\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"stray text\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n name = \\\"unterminated\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n condition = {\\n threshold = 1\\n\",\"expect\":{}}],\"docs\":{\"sp\":\"sp = whitespace and comments \u2014 legal between all tokens.\",\"lml\":\"lml = sp [instance *(sp instance)] sp \u2014 the whole document.\\nRepetitions over capturing rules use the separated form\\n([ x *(sp x) ]); a bare repetition of a dict-producing rule\\ntrips the native VM's subtree merge.\",\"instance\":\"instance = a typed profile instance with a block body, in either\\nheader form: `instance Name < Type` (the LADL worked profile) or\\n`Type \\\"Name\\\"` (the spec-annex style). Both bind {name, type}.\",\"attr_block\":\"attr_block = the { ... } body of an instance: attributes and comments.\",\"attr\":\"attr = key = value, or a shorthand (prose block / one-line string).\",\"attr_eq\":\"attr_eq = the = value half of an attribute.\",\"attr_shorthand\":\"shorthand without \\\"=\\\": a prose block or a one-line string\",\"value\":\"value = string / integer / array / inline block / reference /\\nsymbol reference.\",\"reference\":\"reference = the explicit reference form ref:(Name) used by the\\nspec-annex style (bound as ref).\",\"inline_block\":\"inline_block = a nested attribute block as a value (conditional templates).\",\"array\":\"array = comma-separated strings and symbols; a trailing comma is legal.\",\"item\":\"item = one array element: a string, a reference, or a symbol\\nreference.\",\"prose_block\":\"prose = free text with balanced braces (definition blocks,\\nbullet lists); nests so {key} tokens cannot terminate the block.\",\"prose\":\"prose = free text with balanced braces (definition bodies).\",\"prose_nested\":\"prose_nested = a brace-nested span inside prose ({key} tokens cannot close a block).\",\"key\":\"key = an attribute name.\",\"instance_name\":\"instance_name = the declaring name of an instance (bound as name).\",\"instance_quoted_name\":\"instance_quoted_name = the quoted declaring name in the Type \\\"Name\\\"\\nheader form (bound as name, same capture as the keyword form).\",\"type_name\":\"type_name = the supertype after <, or the leading type of the\\nType \\\"Name\\\" header form (bound as type).\",\"symbol\":\"symbol = a bare reference to a sibling instance or a built-in sequence.\",\"integer\":\"integer = a bare non-negative integer (condition thresholds).\",\"string\":\"string = a single-line double-quoted string with backslash escapes.\",\"string_body\":\"string_body = the string character run (shared by string and the\\nquoted instance-name header form).\",\"comment\":\"comment = // to end of line, consuming the terminator.\",\"name_char\":\"name_char = the shared identifier class: A-Z a-z 0-9 _.\"},\"source\":\"# LML: the LutaML textual realization of the MN 112 (LADL) labeling\\n# profile \u2014 the kaleidl fleet's source format. A document is a stream\\n# of typed instances with two header forms \u2014 `instance Name < Type { }`\\n# (the LADL worked profile) and `Type \\\"Name\\\" { }` (the spec-annex\\n# style); both bind {name, type}. Attributes\\n# take five value shapes: quoted strings (label words carry {key}\\n# tokens and %n placeholders as plain string content), integers, bare\\n# symbol references (built-in sequences, sibling instances), arrays of\\n# strings and symbols (trailing comma allowed), and inline attribute\\n# blocks (conditional templates: condition = { type = ... threshold = 1 }).\\n# Two attribute shorthands bind without \\\"=\\\": a prose definition block\\n# (`definition { free text with * bullets }`) and a one-line string\\n# (`definition \\\"...\\\"`). \\\"//\\\" comments run to end of line and are legal\\n# wherever whitespace is. Instances may appear in any order; an empty\\n# document parses.\\n#\\n# Dialect notes: names are [A-Za-z0-9_] runs (instance names, types,\\n# keys, symbols share the class \u2014 the integer rule wins on ordered\\n# choice); strings are single-line with backslash escapes; braces\\n# balance recursively inside prose blocks; CRLF is tolerated as\\n# whitespace. Parsed but not validated: cross-references between\\n# instances (a name may reference an instance defined anywhere or a\\n# host-declared built-in sequence).\\n\\ngrammar Lml version \\\"1.0.0\\\" edition 2 {\\n ## sp = whitespace and comments \u2014 legal between all tokens.\\n sp = *( %x20 / %x09 / %x0D / %x0A / comment )\\n\\n ## lml = sp [instance *(sp instance)] sp \u2014 the whole document.\\n ## Repetitions over capturing rules use the separated form\\n ## ([ x *(sp x) ]); a bare repetition of a dict-producing rule\\n ## trips the native VM's subtree merge.\\n lml = sp [ instance *( sp instance ) ] sp\\n\\n ## instance = a typed profile instance with a block body, in either\\n ## header form: `instance Name < Type` (the LADL worked profile) or\\n ## `Type \\\"Name\\\"` (the spec-annex style). Both bind {name, type}.\\n instance = ( ( %i\\\"instance\\\" sp instance_name sp \\\"<\\\" sp type_name / type_name sp instance_quoted_name ) sp attr_block ) as instance\\n\\n ## attr_block = the { ... } body of an instance: attributes and comments.\\n attr_block = ( \\\"{\\\" sp [ attr *( sp attr ) ] sp \\\"}\\\" ) as block\\n\\n ## attr = key = value, or a shorthand (prose block / one-line string).\\n attr = ( key sp attr_eq / key sp attr_shorthand ) as attr\\n ## attr_eq = the = value half of an attribute.\\n attr_eq = \\\"=\\\" sp value\\n ## shorthand without \\\"=\\\": a prose block or a one-line string\\n attr_shorthand = prose_block / string\\n\\n ## value = string / integer / array / inline block / reference /\\n ## symbol reference.\\n value = string / integer / array / inline_block / reference / symbol\\n ## reference = the explicit reference form ref:(Name) used by the\\n ## spec-annex style (bound as ref).\\n reference = ( \\\"ref:\\\" \\\"(\\\" sp symbol sp \\\")\\\" ) as ref\\n ## inline_block = a nested attribute block as a value (conditional templates).\\n inline_block = ( \\\"{\\\" sp [ attr *( sp attr ) ] sp \\\"}\\\" ) as block\\n\\n ## array = comma-separated strings and symbols; a trailing comma is legal.\\n array = ( \\\"[\\\" sp [ item *( sp \\\",\\\" sp item ) ] sp [ \\\",\\\" ] sp \\\"]\\\" ) as array\\n ## item = one array element: a string, a reference, or a symbol\\n ## reference.\\n item = string / reference / symbol\\n\\n ## prose = free text with balanced braces (definition blocks,\\n ## bullet lists); nests so {key} tokens cannot terminate the block.\\n prose_block = ( \\\"{\\\" prose sp \\\"}\\\" ) as prose\\n ## prose = free text with balanced braces (definition bodies).\\n prose = *( prose_nested / ( !\\\"{\\\" !\\\"}\\\" %x20-10FFFF / %x09 / %x0D / %x0A ) )\\n ## prose_nested = a brace-nested span inside prose ({key} tokens cannot close a block).\\n prose_nested = \\\"{\\\" prose sp \\\"}\\\"\\n\\n ## key = an attribute name.\\n key = ( 1*name_char ) as key\\n ## instance_name = the declaring name of an instance (bound as name).\\n instance_name = ( 1*name_char ) as name\\n ## instance_quoted_name = the quoted declaring name in the Type \\\"Name\\\"\\n ## header form (bound as name, same capture as the keyword form).\\n instance_quoted_name = ( %x22 string_body %x22 ) as name\\n ## type_name = the supertype after <, or the leading type of the\\n ## Type \\\"Name\\\" header form (bound as type).\\n type_name = ( 1*name_char ) as type\\n ## symbol = a bare reference to a sibling instance or a built-in sequence.\\n symbol = ( 1*name_char ) as symbol\\n ## integer = a bare non-negative integer (condition thresholds).\\n integer = ( 1*%x30-39 ) as integer\\n\\n ## string = a single-line double-quoted string with backslash escapes.\\n string = ( %x22 string_body %x22 ) as string\\n ## string_body = the string character run (shared by string and the\\n ## quoted instance-name header form).\\n string_body = *( %x20-21 / %x23-5B / %x5D-10FFFF / %x5C ( %x22 / %x5C / %x2F / %x62 / %x66 / %x6E / %x72 / %x74 / ( %x75 4*( %x30-39 / %x41-46 / %x61-66 ) ) ) )\\n\\n ## comment = // to end of line, consuming the terminator.\\n comment = \\\"//\\\" *( %x20-10FFFF ) [ %x0A ]\\n\\n ## name_char = the shared identifier class: A-Z a-z 0-9 _.\\n name_char = %x41-5A / %x61-7A / %x30-39 / %x5F\\n\\n entry main: lml\\n\\n test {\\n accept \\\"instance A < LabelStyle {\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n name = \\\\\\\"A\\\\\\\"\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n pattern = \\\\\\\"{clause} %n\\\\\\\"\\\\n}\\\"\\n accept \\\"instance A < LabelTemplate {\\\\n pattern = \\\\\\\"%pn.%n\\\\\\\"\\\\n definition \\\\\\\"one-line string shorthand\\\\\\\"\\\\n}\\\"\\n accept \\\"instance A < LabelTemplate {\\\\n definition {\\\\n free prose with\\\\n * bullets\\\\n }\\\\n}\\\"\\n accept \\\"instance A < Labeller {\\\\n condition = {\\\\n type = \\\\\\\"element_count_gt\\\\\\\"\\\\n threshold = 1\\\\n }\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n sequences = [\\\\n DecimalNumericSequence,\\\\n AlphaUpperNumericSequence,\\\\n ]\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n labellers = [\\\\n \\\\\\\"id:clause_labeller\\\\\\\",\\\\n \\\\\\\"id:annex_labeller\\\\\\\"\\\\n ]\\\\n}\\\"\\n accept \\\"// leading comment\\\\ninstance A < LabelContext {\\\\n parent = B // trailing comment\\\\n}\\\"\\n accept \\\"instance A < LabelContext {\\\\n name = \\\\\\\"document\\\\\\\"\\\\n definition {\\\\n top context\\\\n }\\\\n}\\\\n\\\\ninstance B < LabelContext {\\\\n parent = A\\\\n}\\\"\\n accept \\\"instance AnnexLabeller < Labeller {\\\\n template = [NoteSingleLabelTemplate, NoteMultipleLabelTemplate]\\\\n global_template = [NoteSingleGlobalLabelTemplate, NoteMultipleGlobalLabelTemplate]\\\\n}\\\"\\n accept \\\"\\\"\\n accept \\\"LabelStyle \\\\\\\"ISOIECLabelStyle\\\\\\\" {\\\\n name = \\\\\\\"ISO/IEC Label Style\\\\\\\"\\\\n}\\\"\\n accept \\\"LabelContext \\\\\\\"DocumentContext\\\\\\\" {\\\\n name = \\\\\\\"document\\\\\\\"\\\\n}\\\\n\\\\nLabelTemplate \\\\\\\"ClauseLabelTemplate\\\\\\\" {\\\\n pattern = \\\\\\\"{clause} %n\\\\\\\"\\\\n}\\\"\\n accept \\\"LabelStyle \\\\\\\"S\\\\\\\" {\\\\n sequences = [\\\\n ref:(DecimalNumericSequence),\\\\n ref:(AlphaUpperNumericSequence)\\\\n ]\\\\n}\\\"\\n reject \\\"instance A LabelStyle {\\\\n}\\\"\\n reject \\\"instance A < LabelStyle {\\\\n name =\\\\n}\\\"\\n reject \\\"instance A < LabelStyle {\\\\n = \\\\\\\"value\\\\\\\"\\\\n}\\\"\\n reject \\\"stray text\\\"\\n reject \\\"instance A < LabelStyle {\\\\n name = \\\\\\\"unterminated\\\\n}\\\"\\n reject \\\"instance A < LabelStyle {\\\\n condition = {\\\\n threshold = 1\\\\n\\\"\\n }\\n}\\n\",\"source_hash\":\"3d1955259129bce3745d88fad983864853d94649c73f9626b2191592f5199e8a\",\"unicode_tables\":\"onigmo (Ruby 4.0.7)\",\"compiler_version\":\"1.5.26\",\"edition\":2,\"semantics_hash\":\"sha256:078b27121f2d50d096c68999311dd8a7058752450d4cd5d90f0439adcd754778\",\"checksum\":\"sha256:2be6267c036caef844bb7abb7dd4f3d38613a9126647a1eb8c4b8cca4cfe2d4e\",\"validated\":{\"lint_errors\":0,\"lint_warnings\":3,\"tests_total\":21,\"tests_failures\":0,\"self_test\":true},\"byte_checksum\":\"sha256:3a1f029e0e8716dc4680e29adb31ebfa0afea33755ec6ff5d6c815910d036f2b\"}\n";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sealed parsanol `lml` grammar artifact, byte-exact as baked
|
|
3
|
+
* by parsanol/grammars (grammar Lml, compiler 1.5.26, artifact
|
|
4
|
+
* sha256:2be6267c036caef844bb7abb7dd4f3d38613a9126647a1eb8c4b8cca4cfe2d4e).
|
|
5
|
+
* The seal is a raw-byte digest, so this travels as a string —
|
|
6
|
+
* re-vendor from parsanol/grammars on re-seal, never hand-edit.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LML_ARTIFACT = "{\"bindings\":null,\"version\":\"1.0.0\",\"grammar\":\"Lml\",\"shape\":\"parsanol-tree/v2\",\"binding_version\":1,\"entries\":{\"main\":{\"root\":\"lml\",\"grammar\":{\"atoms\":[{\"Entity\":{\"atom\":13}},{\"Re\":{\"pattern\":\"[ ]\"}},{\"Re\":{\"pattern\":\"[\\\\x09]\"}},{\"Re\":{\"pattern\":\"[\\\\x0d]\"}},{\"Re\":{\"pattern\":\"[\\\\x0a]\"}},{\"Entity\":{\"atom\":11}},{\"Str\":{\"pattern\":\"//\"}},{\"Re\":{\"pattern\":\"[\\\\x20-\\\\u{10ffff}]\"}},{\"Repetition\":{\"atom\":7,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Re\":{\"pattern\":\"[\\\\x0a]\"}},{\"Repetition\":{\"atom\":9,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[6,8,10]}},{\"Alternative\":{\"atoms\":[1,2,3,4,5]}},{\"Repetition\":{\"atom\":12,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":193}},{\"Re\":{\"pattern\":\"(?i:instance)\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":25}},{\"Entity\":{\"atom\":23}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Re\":{\"pattern\":\"[\\\\x61-\\\\x7a]\"}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[_]\"}},{\"Alternative\":{\"atoms\":[19,20,21,22]}},{\"Repetition\":{\"atom\":18,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"name\",\"atom\":24}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"<\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":32}},{\"Entity\":{\"atom\":23}},{\"Repetition\":{\"atom\":30,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"type\",\"atom\":31}},{\"Sequence\":{\"atoms\":[15,16,17,26,27,28,29]}},{\"Entity\":{\"atom\":32}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":64}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Entity\":{\"atom\":61}},{\"Re\":{\"pattern\":\"[ !]\"}},{\"Re\":{\"pattern\":\"[\\\\x23-\\\\x5b]\"}},{\"Re\":{\"pattern\":\"[\\\\x5d-\\\\u{10ffff}]\"}},{\"Re\":{\"pattern\":\"[\\\\\\\\]\"}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Re\":{\"pattern\":\"[\\\\\\\\]\"}},{\"Re\":{\"pattern\":\"[/]\"}},{\"Re\":{\"pattern\":\"[b]\"}},{\"Re\":{\"pattern\":\"[f]\"}},{\"Re\":{\"pattern\":\"[n]\"}},{\"Re\":{\"pattern\":\"[r]\"}},{\"Re\":{\"pattern\":\"[t]\"}},{\"Re\":{\"pattern\":\"[u]\"}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x46]\"}},{\"Re\":{\"pattern\":\"[\\\\x61-\\\\x66]\"}},{\"Alternative\":{\"atoms\":[52,53,54]}},{\"Repetition\":{\"atom\":55,\"min\":4,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[51,56]}},{\"Alternative\":{\"atoms\":[43,44,45,46,47,48,49,50,57]}},{\"Sequence\":{\"atoms\":[42,58]}},{\"Alternative\":{\"atoms\":[39,40,41,59]}},{\"Repetition\":{\"atom\":60,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Sequence\":{\"atoms\":[37,38,62]}},{\"Named\":{\"name\":\"name\",\"atom\":63}},{\"Sequence\":{\"atoms\":[34,35,36]}},{\"Alternative\":{\"atoms\":[33,65]}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":191}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":181}},{\"Entity\":{\"atom\":75}},{\"Entity\":{\"atom\":23}},{\"Repetition\":{\"atom\":73,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"key\",\"atom\":74}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":178}},{\"Str\":{\"pattern\":\"=\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":177}},{\"Entity\":{\"atom\":86}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Entity\":{\"atom\":61}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Sequence\":{\"atoms\":[82,83,84]}},{\"Named\":{\"name\":\"string\",\"atom\":85}},{\"Entity\":{\"atom\":90}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Repetition\":{\"atom\":88,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"integer\",\"atom\":89}},{\"Entity\":{\"atom\":124}},{\"Str\":{\"pattern\":\"[\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":109}},{\"Entity\":{\"atom\":86}},{\"Entity\":{\"atom\":107}},{\"Str\":{\"pattern\":\"ref:\"}},{\"Str\":{\"pattern\":\"(\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":103}},{\"Entity\":{\"atom\":23}},{\"Repetition\":{\"atom\":101,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"symbol\",\"atom\":102}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\")\"}},{\"Sequence\":{\"atoms\":[97,98,99,100,104,105]}},{\"Named\":{\"name\":\"ref\",\"atom\":106}},{\"Entity\":{\"atom\":103}},{\"Alternative\":{\"atoms\":[95,96,108]}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\",\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":109}},{\"Sequence\":{\"atoms\":[110,111,112,113]}},{\"Repetition\":{\"atom\":114,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[94,115]}},{\"Repetition\":{\"atom\":116,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\",\"}},{\"Repetition\":{\"atom\":119,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"]\"}},{\"Sequence\":{\"atoms\":[92,93,117,118,120,121,122]}},{\"Named\":{\"name\":\"array\",\"atom\":123}},{\"Entity\":{\"atom\":174}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":164}},{\"Sequence\":{\"atoms\":[72,76,77]}},{\"Entity\":{\"atom\":75}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":161}},{\"Entity\":{\"atom\":159}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":155}},{\"Entity\":{\"atom\":153}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":150}},{\"Str\":{\"pattern\":\"{\"}},{\"Lookahead\":{\"atom\":139,\"positive\":false}},{\"Str\":{\"pattern\":\"}\"}},{\"Lookahead\":{\"atom\":141,\"positive\":false}},{\"Re\":{\"pattern\":\"[\\\\x20-\\\\u{10ffff}]\"}},{\"Sequence\":{\"atoms\":[140,142,143]}},{\"Re\":{\"pattern\":\"[\\\\x09]\"}},{\"Re\":{\"pattern\":\"[\\\\x0d]\"}},{\"Re\":{\"pattern\":\"[\\\\x0a]\"}},{\"Alternative\":{\"atoms\":[144,145,146,147]}},{\"Alternative\":{\"atoms\":[136,148]}},{\"Repetition\":{\"atom\":149,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[137,138,151,152]}},{\"Alternative\":{\"atoms\":[136,148]}},{\"Repetition\":{\"atom\":154,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[134,135,156,157]}},{\"Named\":{\"name\":\"prose\",\"atom\":158}},{\"Entity\":{\"atom\":86}},{\"Alternative\":{\"atoms\":[133,160]}},{\"Sequence\":{\"atoms\":[130,131,132]}},{\"Alternative\":{\"atoms\":[129,162]}},{\"Named\":{\"name\":\"attr\",\"atom\":163}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":164}},{\"Sequence\":{\"atoms\":[165,166]}},{\"Repetition\":{\"atom\":167,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[128,168]}},{\"Repetition\":{\"atom\":169,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[126,127,170,171,172]}},{\"Named\":{\"name\":\"block\",\"atom\":173}},{\"Entity\":{\"atom\":107}},{\"Entity\":{\"atom\":103}},{\"Alternative\":{\"atoms\":[81,87,91,125,175,176]}},{\"Sequence\":{\"atoms\":[78,79,80]}},{\"Sequence\":{\"atoms\":[72,76,77]}},{\"Alternative\":{\"atoms\":[179,162]}},{\"Named\":{\"name\":\"attr\",\"atom\":180}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":181}},{\"Sequence\":{\"atoms\":[182,183]}},{\"Repetition\":{\"atom\":184,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[71,185]}},{\"Repetition\":{\"atom\":186,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[69,70,187,188,189]}},{\"Named\":{\"name\":\"block\",\"atom\":190}},{\"Sequence\":{\"atoms\":[66,67,68]}},{\"Named\":{\"name\":\"instance\",\"atom\":192}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":193}},{\"Sequence\":{\"atoms\":[194,195]}},{\"Repetition\":{\"atom\":196,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[14,197]}},{\"Repetition\":{\"atom\":198,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Sequence\":{\"atoms\":[0,199,200]}}],\"root\":201},\"bindings\":[]}},\"preprocess\":{},\"tables\":{},\"lint\":{\"order_warnings\":[\"rule value: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule value: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule item: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)\"]},\"default_entry\":\"main\",\"render\":{},\"derive\":{},\"tests\":[{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n name = \\\"A\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n pattern = \\\"{clause} %n\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelTemplate {\\n pattern = \\\"%pn.%n\\\"\\n definition \\\"one-line string shorthand\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelTemplate {\\n definition {\\n free prose with\\n * bullets\\n }\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < Labeller {\\n condition = {\\n type = \\\"element_count_gt\\\"\\n threshold = 1\\n }\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n sequences = [\\n DecimalNumericSequence,\\n AlphaUpperNumericSequence,\\n ]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n labellers = [\\n \\\"id:clause_labeller\\\",\\n \\\"id:annex_labeller\\\"\\n ]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"// leading comment\\ninstance A < LabelContext {\\n parent = B // trailing comment\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelContext {\\n name = \\\"document\\\"\\n definition {\\n top context\\n }\\n}\\n\\ninstance B < LabelContext {\\n parent = A\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance AnnexLabeller < Labeller {\\n template = [NoteSingleLabelTemplate, NoteMultipleLabelTemplate]\\n global_template = [NoteSingleGlobalLabelTemplate, NoteMultipleGlobalLabelTemplate]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"LabelStyle \\\"ISOIECLabelStyle\\\" {\\n name = \\\"ISO/IEC Label Style\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"LabelContext \\\"DocumentContext\\\" {\\n name = \\\"document\\\"\\n}\\n\\nLabelTemplate \\\"ClauseLabelTemplate\\\" {\\n pattern = \\\"{clause} %n\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"LabelStyle \\\"S\\\" {\\n sequences = [\\n ref:(DecimalNumericSequence),\\n ref:(AlphaUpperNumericSequence)\\n ]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A LabelStyle {\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n name =\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n = \\\"value\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"stray text\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n name = \\\"unterminated\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n condition = {\\n threshold = 1\\n\",\"expect\":{}}],\"docs\":{\"sp\":\"sp = whitespace and comments \u2014 legal between all tokens.\",\"lml\":\"lml = sp [instance *(sp instance)] sp \u2014 the whole document.\\nRepetitions over capturing rules use the separated form\\n([ x *(sp x) ]); a bare repetition of a dict-producing rule\\ntrips the native VM's subtree merge.\",\"instance\":\"instance = a typed profile instance with a block body, in either\\nheader form: `instance Name < Type` (the LADL worked profile) or\\n`Type \\\"Name\\\"` (the spec-annex style). Both bind {name, type}.\",\"attr_block\":\"attr_block = the { ... } body of an instance: attributes and comments.\",\"attr\":\"attr = key = value, or a shorthand (prose block / one-line string).\",\"attr_eq\":\"attr_eq = the = value half of an attribute.\",\"attr_shorthand\":\"shorthand without \\\"=\\\": a prose block or a one-line string\",\"value\":\"value = string / integer / array / inline block / reference /\\nsymbol reference.\",\"reference\":\"reference = the explicit reference form ref:(Name) used by the\\nspec-annex style (bound as ref).\",\"inline_block\":\"inline_block = a nested attribute block as a value (conditional templates).\",\"array\":\"array = comma-separated strings and symbols; a trailing comma is legal.\",\"item\":\"item = one array element: a string, a reference, or a symbol\\nreference.\",\"prose_block\":\"prose = free text with balanced braces (definition blocks,\\nbullet lists); nests so {key} tokens cannot terminate the block.\",\"prose\":\"prose = free text with balanced braces (definition bodies).\",\"prose_nested\":\"prose_nested = a brace-nested span inside prose ({key} tokens cannot close a block).\",\"key\":\"key = an attribute name.\",\"instance_name\":\"instance_name = the declaring name of an instance (bound as name).\",\"instance_quoted_name\":\"instance_quoted_name = the quoted declaring name in the Type \\\"Name\\\"\\nheader form (bound as name, same capture as the keyword form).\",\"type_name\":\"type_name = the supertype after <, or the leading type of the\\nType \\\"Name\\\" header form (bound as type).\",\"symbol\":\"symbol = a bare reference to a sibling instance or a built-in sequence.\",\"integer\":\"integer = a bare non-negative integer (condition thresholds).\",\"string\":\"string = a single-line double-quoted string with backslash escapes.\",\"string_body\":\"string_body = the string character run (shared by string and the\\nquoted instance-name header form).\",\"comment\":\"comment = // to end of line, consuming the terminator.\",\"name_char\":\"name_char = the shared identifier class: A-Z a-z 0-9 _.\"},\"source\":\"# LML: the LutaML textual realization of the MN 112 (LADL) labeling\\n# profile \u2014 the kaleidl fleet's source format. A document is a stream\\n# of typed instances with two header forms \u2014 `instance Name < Type { }`\\n# (the LADL worked profile) and `Type \\\"Name\\\" { }` (the spec-annex\\n# style); both bind {name, type}. Attributes\\n# take five value shapes: quoted strings (label words carry {key}\\n# tokens and %n placeholders as plain string content), integers, bare\\n# symbol references (built-in sequences, sibling instances), arrays of\\n# strings and symbols (trailing comma allowed), and inline attribute\\n# blocks (conditional templates: condition = { type = ... threshold = 1 }).\\n# Two attribute shorthands bind without \\\"=\\\": a prose definition block\\n# (`definition { free text with * bullets }`) and a one-line string\\n# (`definition \\\"...\\\"`). \\\"//\\\" comments run to end of line and are legal\\n# wherever whitespace is. Instances may appear in any order; an empty\\n# document parses.\\n#\\n# Dialect notes: names are [A-Za-z0-9_] runs (instance names, types,\\n# keys, symbols share the class \u2014 the integer rule wins on ordered\\n# choice); strings are single-line with backslash escapes; braces\\n# balance recursively inside prose blocks; CRLF is tolerated as\\n# whitespace. Parsed but not validated: cross-references between\\n# instances (a name may reference an instance defined anywhere or a\\n# host-declared built-in sequence).\\n\\ngrammar Lml version \\\"1.0.0\\\" edition 2 {\\n ## sp = whitespace and comments \u2014 legal between all tokens.\\n sp = *( %x20 / %x09 / %x0D / %x0A / comment )\\n\\n ## lml = sp [instance *(sp instance)] sp \u2014 the whole document.\\n ## Repetitions over capturing rules use the separated form\\n ## ([ x *(sp x) ]); a bare repetition of a dict-producing rule\\n ## trips the native VM's subtree merge.\\n lml = sp [ instance *( sp instance ) ] sp\\n\\n ## instance = a typed profile instance with a block body, in either\\n ## header form: `instance Name < Type` (the LADL worked profile) or\\n ## `Type \\\"Name\\\"` (the spec-annex style). Both bind {name, type}.\\n instance = ( ( %i\\\"instance\\\" sp instance_name sp \\\"<\\\" sp type_name / type_name sp instance_quoted_name ) sp attr_block ) as instance\\n\\n ## attr_block = the { ... } body of an instance: attributes and comments.\\n attr_block = ( \\\"{\\\" sp [ attr *( sp attr ) ] sp \\\"}\\\" ) as block\\n\\n ## attr = key = value, or a shorthand (prose block / one-line string).\\n attr = ( key sp attr_eq / key sp attr_shorthand ) as attr\\n ## attr_eq = the = value half of an attribute.\\n attr_eq = \\\"=\\\" sp value\\n ## shorthand without \\\"=\\\": a prose block or a one-line string\\n attr_shorthand = prose_block / string\\n\\n ## value = string / integer / array / inline block / reference /\\n ## symbol reference.\\n value = string / integer / array / inline_block / reference / symbol\\n ## reference = the explicit reference form ref:(Name) used by the\\n ## spec-annex style (bound as ref).\\n reference = ( \\\"ref:\\\" \\\"(\\\" sp symbol sp \\\")\\\" ) as ref\\n ## inline_block = a nested attribute block as a value (conditional templates).\\n inline_block = ( \\\"{\\\" sp [ attr *( sp attr ) ] sp \\\"}\\\" ) as block\\n\\n ## array = comma-separated strings and symbols; a trailing comma is legal.\\n array = ( \\\"[\\\" sp [ item *( sp \\\",\\\" sp item ) ] sp [ \\\",\\\" ] sp \\\"]\\\" ) as array\\n ## item = one array element: a string, a reference, or a symbol\\n ## reference.\\n item = string / reference / symbol\\n\\n ## prose = free text with balanced braces (definition blocks,\\n ## bullet lists); nests so {key} tokens cannot terminate the block.\\n prose_block = ( \\\"{\\\" prose sp \\\"}\\\" ) as prose\\n ## prose = free text with balanced braces (definition bodies).\\n prose = *( prose_nested / ( !\\\"{\\\" !\\\"}\\\" %x20-10FFFF / %x09 / %x0D / %x0A ) )\\n ## prose_nested = a brace-nested span inside prose ({key} tokens cannot close a block).\\n prose_nested = \\\"{\\\" prose sp \\\"}\\\"\\n\\n ## key = an attribute name.\\n key = ( 1*name_char ) as key\\n ## instance_name = the declaring name of an instance (bound as name).\\n instance_name = ( 1*name_char ) as name\\n ## instance_quoted_name = the quoted declaring name in the Type \\\"Name\\\"\\n ## header form (bound as name, same capture as the keyword form).\\n instance_quoted_name = ( %x22 string_body %x22 ) as name\\n ## type_name = the supertype after <, or the leading type of the\\n ## Type \\\"Name\\\" header form (bound as type).\\n type_name = ( 1*name_char ) as type\\n ## symbol = a bare reference to a sibling instance or a built-in sequence.\\n symbol = ( 1*name_char ) as symbol\\n ## integer = a bare non-negative integer (condition thresholds).\\n integer = ( 1*%x30-39 ) as integer\\n\\n ## string = a single-line double-quoted string with backslash escapes.\\n string = ( %x22 string_body %x22 ) as string\\n ## string_body = the string character run (shared by string and the\\n ## quoted instance-name header form).\\n string_body = *( %x20-21 / %x23-5B / %x5D-10FFFF / %x5C ( %x22 / %x5C / %x2F / %x62 / %x66 / %x6E / %x72 / %x74 / ( %x75 4*( %x30-39 / %x41-46 / %x61-66 ) ) ) )\\n\\n ## comment = // to end of line, consuming the terminator.\\n comment = \\\"//\\\" *( %x20-10FFFF ) [ %x0A ]\\n\\n ## name_char = the shared identifier class: A-Z a-z 0-9 _.\\n name_char = %x41-5A / %x61-7A / %x30-39 / %x5F\\n\\n entry main: lml\\n\\n test {\\n accept \\\"instance A < LabelStyle {\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n name = \\\\\\\"A\\\\\\\"\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n pattern = \\\\\\\"{clause} %n\\\\\\\"\\\\n}\\\"\\n accept \\\"instance A < LabelTemplate {\\\\n pattern = \\\\\\\"%pn.%n\\\\\\\"\\\\n definition \\\\\\\"one-line string shorthand\\\\\\\"\\\\n}\\\"\\n accept \\\"instance A < LabelTemplate {\\\\n definition {\\\\n free prose with\\\\n * bullets\\\\n }\\\\n}\\\"\\n accept \\\"instance A < Labeller {\\\\n condition = {\\\\n type = \\\\\\\"element_count_gt\\\\\\\"\\\\n threshold = 1\\\\n }\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n sequences = [\\\\n DecimalNumericSequence,\\\\n AlphaUpperNumericSequence,\\\\n ]\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n labellers = [\\\\n \\\\\\\"id:clause_labeller\\\\\\\",\\\\n \\\\\\\"id:annex_labeller\\\\\\\"\\\\n ]\\\\n}\\\"\\n accept \\\"// leading comment\\\\ninstance A < LabelContext {\\\\n parent = B // trailing comment\\\\n}\\\"\\n accept \\\"instance A < LabelContext {\\\\n name = \\\\\\\"document\\\\\\\"\\\\n definition {\\\\n top context\\\\n }\\\\n}\\\\n\\\\ninstance B < LabelContext {\\\\n parent = A\\\\n}\\\"\\n accept \\\"instance AnnexLabeller < Labeller {\\\\n template = [NoteSingleLabelTemplate, NoteMultipleLabelTemplate]\\\\n global_template = [NoteSingleGlobalLabelTemplate, NoteMultipleGlobalLabelTemplate]\\\\n}\\\"\\n accept \\\"\\\"\\n accept \\\"LabelStyle \\\\\\\"ISOIECLabelStyle\\\\\\\" {\\\\n name = \\\\\\\"ISO/IEC Label Style\\\\\\\"\\\\n}\\\"\\n accept \\\"LabelContext \\\\\\\"DocumentContext\\\\\\\" {\\\\n name = \\\\\\\"document\\\\\\\"\\\\n}\\\\n\\\\nLabelTemplate \\\\\\\"ClauseLabelTemplate\\\\\\\" {\\\\n pattern = \\\\\\\"{clause} %n\\\\\\\"\\\\n}\\\"\\n accept \\\"LabelStyle \\\\\\\"S\\\\\\\" {\\\\n sequences = [\\\\n ref:(DecimalNumericSequence),\\\\n ref:(AlphaUpperNumericSequence)\\\\n ]\\\\n}\\\"\\n reject \\\"instance A LabelStyle {\\\\n}\\\"\\n reject \\\"instance A < LabelStyle {\\\\n name =\\\\n}\\\"\\n reject \\\"instance A < LabelStyle {\\\\n = \\\\\\\"value\\\\\\\"\\\\n}\\\"\\n reject \\\"stray text\\\"\\n reject \\\"instance A < LabelStyle {\\\\n name = \\\\\\\"unterminated\\\\n}\\\"\\n reject \\\"instance A < LabelStyle {\\\\n condition = {\\\\n threshold = 1\\\\n\\\"\\n }\\n}\\n\",\"source_hash\":\"3d1955259129bce3745d88fad983864853d94649c73f9626b2191592f5199e8a\",\"unicode_tables\":\"onigmo (Ruby 4.0.7)\",\"compiler_version\":\"1.5.26\",\"edition\":2,\"semantics_hash\":\"sha256:078b27121f2d50d096c68999311dd8a7058752450d4cd5d90f0439adcd754778\",\"checksum\":\"sha256:2be6267c036caef844bb7abb7dd4f3d38613a9126647a1eb8c4b8cca4cfe2d4e\",\"validated\":{\"lint_errors\":0,\"lint_warnings\":3,\"tests_total\":21,\"tests_failures\":0,\"self_test\":true},\"byte_checksum\":\"sha256:3a1f029e0e8716dc4680e29adb31ebfa0afea33755ec6ff5d6c815910d036f2b\"}\n";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sealed parsanol `lml` grammar artifact, byte-exact as baked
|
|
3
|
+
* by parsanol/grammars (grammar Lml, compiler 1.5.26, artifact
|
|
4
|
+
* sha256:2be6267c036caef844bb7abb7dd4f3d38613a9126647a1eb8c4b8cca4cfe2d4e).
|
|
5
|
+
* The seal is a raw-byte digest, so this travels as a string —
|
|
6
|
+
* re-vendor from parsanol/grammars on re-seal, never hand-edit.
|
|
7
|
+
*/
|
|
8
|
+
export const LML_ARTIFACT = "{\"bindings\":null,\"version\":\"1.0.0\",\"grammar\":\"Lml\",\"shape\":\"parsanol-tree/v2\",\"binding_version\":1,\"entries\":{\"main\":{\"root\":\"lml\",\"grammar\":{\"atoms\":[{\"Entity\":{\"atom\":13}},{\"Re\":{\"pattern\":\"[ ]\"}},{\"Re\":{\"pattern\":\"[\\\\x09]\"}},{\"Re\":{\"pattern\":\"[\\\\x0d]\"}},{\"Re\":{\"pattern\":\"[\\\\x0a]\"}},{\"Entity\":{\"atom\":11}},{\"Str\":{\"pattern\":\"//\"}},{\"Re\":{\"pattern\":\"[\\\\x20-\\\\u{10ffff}]\"}},{\"Repetition\":{\"atom\":7,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Re\":{\"pattern\":\"[\\\\x0a]\"}},{\"Repetition\":{\"atom\":9,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Sequence\":{\"atoms\":[6,8,10]}},{\"Alternative\":{\"atoms\":[1,2,3,4,5]}},{\"Repetition\":{\"atom\":12,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":193}},{\"Re\":{\"pattern\":\"(?i:instance)\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":25}},{\"Entity\":{\"atom\":23}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x5a]\"}},{\"Re\":{\"pattern\":\"[\\\\x61-\\\\x7a]\"}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[_]\"}},{\"Alternative\":{\"atoms\":[19,20,21,22]}},{\"Repetition\":{\"atom\":18,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"name\",\"atom\":24}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"<\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":32}},{\"Entity\":{\"atom\":23}},{\"Repetition\":{\"atom\":30,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"type\",\"atom\":31}},{\"Sequence\":{\"atoms\":[15,16,17,26,27,28,29]}},{\"Entity\":{\"atom\":32}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":64}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Entity\":{\"atom\":61}},{\"Re\":{\"pattern\":\"[ !]\"}},{\"Re\":{\"pattern\":\"[\\\\x23-\\\\x5b]\"}},{\"Re\":{\"pattern\":\"[\\\\x5d-\\\\u{10ffff}]\"}},{\"Re\":{\"pattern\":\"[\\\\\\\\]\"}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Re\":{\"pattern\":\"[\\\\\\\\]\"}},{\"Re\":{\"pattern\":\"[/]\"}},{\"Re\":{\"pattern\":\"[b]\"}},{\"Re\":{\"pattern\":\"[f]\"}},{\"Re\":{\"pattern\":\"[n]\"}},{\"Re\":{\"pattern\":\"[r]\"}},{\"Re\":{\"pattern\":\"[t]\"}},{\"Re\":{\"pattern\":\"[u]\"}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Re\":{\"pattern\":\"[\\\\x41-\\\\x46]\"}},{\"Re\":{\"pattern\":\"[\\\\x61-\\\\x66]\"}},{\"Alternative\":{\"atoms\":[52,53,54]}},{\"Repetition\":{\"atom\":55,\"min\":4,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[51,56]}},{\"Alternative\":{\"atoms\":[43,44,45,46,47,48,49,50,57]}},{\"Sequence\":{\"atoms\":[42,58]}},{\"Alternative\":{\"atoms\":[39,40,41,59]}},{\"Repetition\":{\"atom\":60,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Sequence\":{\"atoms\":[37,38,62]}},{\"Named\":{\"name\":\"name\",\"atom\":63}},{\"Sequence\":{\"atoms\":[34,35,36]}},{\"Alternative\":{\"atoms\":[33,65]}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":191}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":181}},{\"Entity\":{\"atom\":75}},{\"Entity\":{\"atom\":23}},{\"Repetition\":{\"atom\":73,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"key\",\"atom\":74}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":178}},{\"Str\":{\"pattern\":\"=\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":177}},{\"Entity\":{\"atom\":86}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Entity\":{\"atom\":61}},{\"Re\":{\"pattern\":\"[\\\"]\"}},{\"Sequence\":{\"atoms\":[82,83,84]}},{\"Named\":{\"name\":\"string\",\"atom\":85}},{\"Entity\":{\"atom\":90}},{\"Re\":{\"pattern\":\"[\\\\x30-\\\\x39]\"}},{\"Repetition\":{\"atom\":88,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"integer\",\"atom\":89}},{\"Entity\":{\"atom\":124}},{\"Str\":{\"pattern\":\"[\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":109}},{\"Entity\":{\"atom\":86}},{\"Entity\":{\"atom\":107}},{\"Str\":{\"pattern\":\"ref:\"}},{\"Str\":{\"pattern\":\"(\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":103}},{\"Entity\":{\"atom\":23}},{\"Repetition\":{\"atom\":101,\"min\":1,\"max\":null,\"tag\":\"Repetition\"}},{\"Named\":{\"name\":\"symbol\",\"atom\":102}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\")\"}},{\"Sequence\":{\"atoms\":[97,98,99,100,104,105]}},{\"Named\":{\"name\":\"ref\",\"atom\":106}},{\"Entity\":{\"atom\":103}},{\"Alternative\":{\"atoms\":[95,96,108]}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\",\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":109}},{\"Sequence\":{\"atoms\":[110,111,112,113]}},{\"Repetition\":{\"atom\":114,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[94,115]}},{\"Repetition\":{\"atom\":116,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\",\"}},{\"Repetition\":{\"atom\":119,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"]\"}},{\"Sequence\":{\"atoms\":[92,93,117,118,120,121,122]}},{\"Named\":{\"name\":\"array\",\"atom\":123}},{\"Entity\":{\"atom\":174}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":164}},{\"Sequence\":{\"atoms\":[72,76,77]}},{\"Entity\":{\"atom\":75}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":161}},{\"Entity\":{\"atom\":159}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":155}},{\"Entity\":{\"atom\":153}},{\"Str\":{\"pattern\":\"{\"}},{\"Entity\":{\"atom\":150}},{\"Str\":{\"pattern\":\"{\"}},{\"Lookahead\":{\"atom\":139,\"positive\":false}},{\"Str\":{\"pattern\":\"}\"}},{\"Lookahead\":{\"atom\":141,\"positive\":false}},{\"Re\":{\"pattern\":\"[\\\\x20-\\\\u{10ffff}]\"}},{\"Sequence\":{\"atoms\":[140,142,143]}},{\"Re\":{\"pattern\":\"[\\\\x09]\"}},{\"Re\":{\"pattern\":\"[\\\\x0d]\"}},{\"Re\":{\"pattern\":\"[\\\\x0a]\"}},{\"Alternative\":{\"atoms\":[144,145,146,147]}},{\"Alternative\":{\"atoms\":[136,148]}},{\"Repetition\":{\"atom\":149,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[137,138,151,152]}},{\"Alternative\":{\"atoms\":[136,148]}},{\"Repetition\":{\"atom\":154,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[134,135,156,157]}},{\"Named\":{\"name\":\"prose\",\"atom\":158}},{\"Entity\":{\"atom\":86}},{\"Alternative\":{\"atoms\":[133,160]}},{\"Sequence\":{\"atoms\":[130,131,132]}},{\"Alternative\":{\"atoms\":[129,162]}},{\"Named\":{\"name\":\"attr\",\"atom\":163}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":164}},{\"Sequence\":{\"atoms\":[165,166]}},{\"Repetition\":{\"atom\":167,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[128,168]}},{\"Repetition\":{\"atom\":169,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[126,127,170,171,172]}},{\"Named\":{\"name\":\"block\",\"atom\":173}},{\"Entity\":{\"atom\":107}},{\"Entity\":{\"atom\":103}},{\"Alternative\":{\"atoms\":[81,87,91,125,175,176]}},{\"Sequence\":{\"atoms\":[78,79,80]}},{\"Sequence\":{\"atoms\":[72,76,77]}},{\"Alternative\":{\"atoms\":[179,162]}},{\"Named\":{\"name\":\"attr\",\"atom\":180}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":181}},{\"Sequence\":{\"atoms\":[182,183]}},{\"Repetition\":{\"atom\":184,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[71,185]}},{\"Repetition\":{\"atom\":186,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Str\":{\"pattern\":\"}\"}},{\"Sequence\":{\"atoms\":[69,70,187,188,189]}},{\"Named\":{\"name\":\"block\",\"atom\":190}},{\"Sequence\":{\"atoms\":[66,67,68]}},{\"Named\":{\"name\":\"instance\",\"atom\":192}},{\"Entity\":{\"atom\":13}},{\"Entity\":{\"atom\":193}},{\"Sequence\":{\"atoms\":[194,195]}},{\"Repetition\":{\"atom\":196,\"min\":0,\"max\":null,\"tag\":\"Repetition\"}},{\"Sequence\":{\"atoms\":[14,197]}},{\"Repetition\":{\"atom\":198,\"min\":0,\"max\":1,\"tag\":\"Maybe\"}},{\"Entity\":{\"atom\":13}},{\"Sequence\":{\"atoms\":[0,199,200]}}],\"root\":201},\"bindings\":[]}},\"preprocess\":{},\"tables\":{},\"lint\":{\"order_warnings\":[\"rule value: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule value: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)\",\"rule item: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)\"]},\"default_entry\":\"main\",\"render\":{},\"derive\":{},\"tests\":[{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n name = \\\"A\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n pattern = \\\"{clause} %n\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelTemplate {\\n pattern = \\\"%pn.%n\\\"\\n definition \\\"one-line string shorthand\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelTemplate {\\n definition {\\n free prose with\\n * bullets\\n }\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < Labeller {\\n condition = {\\n type = \\\"element_count_gt\\\"\\n threshold = 1\\n }\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n sequences = [\\n DecimalNumericSequence,\\n AlphaUpperNumericSequence,\\n ]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelStyle {\\n labellers = [\\n \\\"id:clause_labeller\\\",\\n \\\"id:annex_labeller\\\"\\n ]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"// leading comment\\ninstance A < LabelContext {\\n parent = B // trailing comment\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance A < LabelContext {\\n name = \\\"document\\\"\\n definition {\\n top context\\n }\\n}\\n\\ninstance B < LabelContext {\\n parent = A\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"instance AnnexLabeller < Labeller {\\n template = [NoteSingleLabelTemplate, NoteMultipleLabelTemplate]\\n global_template = [NoteSingleGlobalLabelTemplate, NoteMultipleGlobalLabelTemplate]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"LabelStyle \\\"ISOIECLabelStyle\\\" {\\n name = \\\"ISO/IEC Label Style\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"LabelContext \\\"DocumentContext\\\" {\\n name = \\\"document\\\"\\n}\\n\\nLabelTemplate \\\"ClauseLabelTemplate\\\" {\\n pattern = \\\"{clause} %n\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"accept\",\"input\":\"LabelStyle \\\"S\\\" {\\n sequences = [\\n ref:(DecimalNumericSequence),\\n ref:(AlphaUpperNumericSequence)\\n ]\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A LabelStyle {\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n name =\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n = \\\"value\\\"\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"stray text\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n name = \\\"unterminated\\n}\",\"expect\":{}},{\"entry\":\"main\",\"kind\":\"reject\",\"input\":\"instance A < LabelStyle {\\n condition = {\\n threshold = 1\\n\",\"expect\":{}}],\"docs\":{\"sp\":\"sp = whitespace and comments \u2014 legal between all tokens.\",\"lml\":\"lml = sp [instance *(sp instance)] sp \u2014 the whole document.\\nRepetitions over capturing rules use the separated form\\n([ x *(sp x) ]); a bare repetition of a dict-producing rule\\ntrips the native VM's subtree merge.\",\"instance\":\"instance = a typed profile instance with a block body, in either\\nheader form: `instance Name < Type` (the LADL worked profile) or\\n`Type \\\"Name\\\"` (the spec-annex style). Both bind {name, type}.\",\"attr_block\":\"attr_block = the { ... } body of an instance: attributes and comments.\",\"attr\":\"attr = key = value, or a shorthand (prose block / one-line string).\",\"attr_eq\":\"attr_eq = the = value half of an attribute.\",\"attr_shorthand\":\"shorthand without \\\"=\\\": a prose block or a one-line string\",\"value\":\"value = string / integer / array / inline block / reference /\\nsymbol reference.\",\"reference\":\"reference = the explicit reference form ref:(Name) used by the\\nspec-annex style (bound as ref).\",\"inline_block\":\"inline_block = a nested attribute block as a value (conditional templates).\",\"array\":\"array = comma-separated strings and symbols; a trailing comma is legal.\",\"item\":\"item = one array element: a string, a reference, or a symbol\\nreference.\",\"prose_block\":\"prose = free text with balanced braces (definition blocks,\\nbullet lists); nests so {key} tokens cannot terminate the block.\",\"prose\":\"prose = free text with balanced braces (definition bodies).\",\"prose_nested\":\"prose_nested = a brace-nested span inside prose ({key} tokens cannot close a block).\",\"key\":\"key = an attribute name.\",\"instance_name\":\"instance_name = the declaring name of an instance (bound as name).\",\"instance_quoted_name\":\"instance_quoted_name = the quoted declaring name in the Type \\\"Name\\\"\\nheader form (bound as name, same capture as the keyword form).\",\"type_name\":\"type_name = the supertype after <, or the leading type of the\\nType \\\"Name\\\" header form (bound as type).\",\"symbol\":\"symbol = a bare reference to a sibling instance or a built-in sequence.\",\"integer\":\"integer = a bare non-negative integer (condition thresholds).\",\"string\":\"string = a single-line double-quoted string with backslash escapes.\",\"string_body\":\"string_body = the string character run (shared by string and the\\nquoted instance-name header form).\",\"comment\":\"comment = // to end of line, consuming the terminator.\",\"name_char\":\"name_char = the shared identifier class: A-Z a-z 0-9 _.\"},\"source\":\"# LML: the LutaML textual realization of the MN 112 (LADL) labeling\\n# profile \u2014 the kaleidl fleet's source format. A document is a stream\\n# of typed instances with two header forms \u2014 `instance Name < Type { }`\\n# (the LADL worked profile) and `Type \\\"Name\\\" { }` (the spec-annex\\n# style); both bind {name, type}. Attributes\\n# take five value shapes: quoted strings (label words carry {key}\\n# tokens and %n placeholders as plain string content), integers, bare\\n# symbol references (built-in sequences, sibling instances), arrays of\\n# strings and symbols (trailing comma allowed), and inline attribute\\n# blocks (conditional templates: condition = { type = ... threshold = 1 }).\\n# Two attribute shorthands bind without \\\"=\\\": a prose definition block\\n# (`definition { free text with * bullets }`) and a one-line string\\n# (`definition \\\"...\\\"`). \\\"//\\\" comments run to end of line and are legal\\n# wherever whitespace is. Instances may appear in any order; an empty\\n# document parses.\\n#\\n# Dialect notes: names are [A-Za-z0-9_] runs (instance names, types,\\n# keys, symbols share the class \u2014 the integer rule wins on ordered\\n# choice); strings are single-line with backslash escapes; braces\\n# balance recursively inside prose blocks; CRLF is tolerated as\\n# whitespace. Parsed but not validated: cross-references between\\n# instances (a name may reference an instance defined anywhere or a\\n# host-declared built-in sequence).\\n\\ngrammar Lml version \\\"1.0.0\\\" edition 2 {\\n ## sp = whitespace and comments \u2014 legal between all tokens.\\n sp = *( %x20 / %x09 / %x0D / %x0A / comment )\\n\\n ## lml = sp [instance *(sp instance)] sp \u2014 the whole document.\\n ## Repetitions over capturing rules use the separated form\\n ## ([ x *(sp x) ]); a bare repetition of a dict-producing rule\\n ## trips the native VM's subtree merge.\\n lml = sp [ instance *( sp instance ) ] sp\\n\\n ## instance = a typed profile instance with a block body, in either\\n ## header form: `instance Name < Type` (the LADL worked profile) or\\n ## `Type \\\"Name\\\"` (the spec-annex style). Both bind {name, type}.\\n instance = ( ( %i\\\"instance\\\" sp instance_name sp \\\"<\\\" sp type_name / type_name sp instance_quoted_name ) sp attr_block ) as instance\\n\\n ## attr_block = the { ... } body of an instance: attributes and comments.\\n attr_block = ( \\\"{\\\" sp [ attr *( sp attr ) ] sp \\\"}\\\" ) as block\\n\\n ## attr = key = value, or a shorthand (prose block / one-line string).\\n attr = ( key sp attr_eq / key sp attr_shorthand ) as attr\\n ## attr_eq = the = value half of an attribute.\\n attr_eq = \\\"=\\\" sp value\\n ## shorthand without \\\"=\\\": a prose block or a one-line string\\n attr_shorthand = prose_block / string\\n\\n ## value = string / integer / array / inline block / reference /\\n ## symbol reference.\\n value = string / integer / array / inline_block / reference / symbol\\n ## reference = the explicit reference form ref:(Name) used by the\\n ## spec-annex style (bound as ref).\\n reference = ( \\\"ref:\\\" \\\"(\\\" sp symbol sp \\\")\\\" ) as ref\\n ## inline_block = a nested attribute block as a value (conditional templates).\\n inline_block = ( \\\"{\\\" sp [ attr *( sp attr ) ] sp \\\"}\\\" ) as block\\n\\n ## array = comma-separated strings and symbols; a trailing comma is legal.\\n array = ( \\\"[\\\" sp [ item *( sp \\\",\\\" sp item ) ] sp [ \\\",\\\" ] sp \\\"]\\\" ) as array\\n ## item = one array element: a string, a reference, or a symbol\\n ## reference.\\n item = string / reference / symbol\\n\\n ## prose = free text with balanced braces (definition blocks,\\n ## bullet lists); nests so {key} tokens cannot terminate the block.\\n prose_block = ( \\\"{\\\" prose sp \\\"}\\\" ) as prose\\n ## prose = free text with balanced braces (definition bodies).\\n prose = *( prose_nested / ( !\\\"{\\\" !\\\"}\\\" %x20-10FFFF / %x09 / %x0D / %x0A ) )\\n ## prose_nested = a brace-nested span inside prose ({key} tokens cannot close a block).\\n prose_nested = \\\"{\\\" prose sp \\\"}\\\"\\n\\n ## key = an attribute name.\\n key = ( 1*name_char ) as key\\n ## instance_name = the declaring name of an instance (bound as name).\\n instance_name = ( 1*name_char ) as name\\n ## instance_quoted_name = the quoted declaring name in the Type \\\"Name\\\"\\n ## header form (bound as name, same capture as the keyword form).\\n instance_quoted_name = ( %x22 string_body %x22 ) as name\\n ## type_name = the supertype after <, or the leading type of the\\n ## Type \\\"Name\\\" header form (bound as type).\\n type_name = ( 1*name_char ) as type\\n ## symbol = a bare reference to a sibling instance or a built-in sequence.\\n symbol = ( 1*name_char ) as symbol\\n ## integer = a bare non-negative integer (condition thresholds).\\n integer = ( 1*%x30-39 ) as integer\\n\\n ## string = a single-line double-quoted string with backslash escapes.\\n string = ( %x22 string_body %x22 ) as string\\n ## string_body = the string character run (shared by string and the\\n ## quoted instance-name header form).\\n string_body = *( %x20-21 / %x23-5B / %x5D-10FFFF / %x5C ( %x22 / %x5C / %x2F / %x62 / %x66 / %x6E / %x72 / %x74 / ( %x75 4*( %x30-39 / %x41-46 / %x61-66 ) ) ) )\\n\\n ## comment = // to end of line, consuming the terminator.\\n comment = \\\"//\\\" *( %x20-10FFFF ) [ %x0A ]\\n\\n ## name_char = the shared identifier class: A-Z a-z 0-9 _.\\n name_char = %x41-5A / %x61-7A / %x30-39 / %x5F\\n\\n entry main: lml\\n\\n test {\\n accept \\\"instance A < LabelStyle {\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n name = \\\\\\\"A\\\\\\\"\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n pattern = \\\\\\\"{clause} %n\\\\\\\"\\\\n}\\\"\\n accept \\\"instance A < LabelTemplate {\\\\n pattern = \\\\\\\"%pn.%n\\\\\\\"\\\\n definition \\\\\\\"one-line string shorthand\\\\\\\"\\\\n}\\\"\\n accept \\\"instance A < LabelTemplate {\\\\n definition {\\\\n free prose with\\\\n * bullets\\\\n }\\\\n}\\\"\\n accept \\\"instance A < Labeller {\\\\n condition = {\\\\n type = \\\\\\\"element_count_gt\\\\\\\"\\\\n threshold = 1\\\\n }\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n sequences = [\\\\n DecimalNumericSequence,\\\\n AlphaUpperNumericSequence,\\\\n ]\\\\n}\\\"\\n accept \\\"instance A < LabelStyle {\\\\n labellers = [\\\\n \\\\\\\"id:clause_labeller\\\\\\\",\\\\n \\\\\\\"id:annex_labeller\\\\\\\"\\\\n ]\\\\n}\\\"\\n accept \\\"// leading comment\\\\ninstance A < LabelContext {\\\\n parent = B // trailing comment\\\\n}\\\"\\n accept \\\"instance A < LabelContext {\\\\n name = \\\\\\\"document\\\\\\\"\\\\n definition {\\\\n top context\\\\n }\\\\n}\\\\n\\\\ninstance B < LabelContext {\\\\n parent = A\\\\n}\\\"\\n accept \\\"instance AnnexLabeller < Labeller {\\\\n template = [NoteSingleLabelTemplate, NoteMultipleLabelTemplate]\\\\n global_template = [NoteSingleGlobalLabelTemplate, NoteMultipleGlobalLabelTemplate]\\\\n}\\\"\\n accept \\\"\\\"\\n accept \\\"LabelStyle \\\\\\\"ISOIECLabelStyle\\\\\\\" {\\\\n name = \\\\\\\"ISO/IEC Label Style\\\\\\\"\\\\n}\\\"\\n accept \\\"LabelContext \\\\\\\"DocumentContext\\\\\\\" {\\\\n name = \\\\\\\"document\\\\\\\"\\\\n}\\\\n\\\\nLabelTemplate \\\\\\\"ClauseLabelTemplate\\\\\\\" {\\\\n pattern = \\\\\\\"{clause} %n\\\\\\\"\\\\n}\\\"\\n accept \\\"LabelStyle \\\\\\\"S\\\\\\\" {\\\\n sequences = [\\\\n ref:(DecimalNumericSequence),\\\\n ref:(AlphaUpperNumericSequence)\\\\n ]\\\\n}\\\"\\n reject \\\"instance A LabelStyle {\\\\n}\\\"\\n reject \\\"instance A < LabelStyle {\\\\n name =\\\\n}\\\"\\n reject \\\"instance A < LabelStyle {\\\\n = \\\\\\\"value\\\\\\\"\\\\n}\\\"\\n reject \\\"stray text\\\"\\n reject \\\"instance A < LabelStyle {\\\\n name = \\\\\\\"unterminated\\\\n}\\\"\\n reject \\\"instance A < LabelStyle {\\\\n condition = {\\\\n threshold = 1\\\\n\\\"\\n }\\n}\\n\",\"source_hash\":\"3d1955259129bce3745d88fad983864853d94649c73f9626b2191592f5199e8a\",\"unicode_tables\":\"onigmo (Ruby 4.0.7)\",\"compiler_version\":\"1.5.26\",\"edition\":2,\"semantics_hash\":\"sha256:078b27121f2d50d096c68999311dd8a7058752450d4cd5d90f0439adcd754778\",\"checksum\":\"sha256:2be6267c036caef844bb7abb7dd4f3d38613a9126647a1eb8c4b8cca4cfe2d4e\",\"validated\":{\"lint_errors\":0,\"lint_warnings\":3,\"tests_total\":21,\"tests_failures\":0,\"self_test\":true},\"byte_checksum\":\"sha256:3a1f029e0e8716dc4680e29adb31ebfa0afea33755ec6ff5d6c815910d036f2b\"}\n";
|
package/dist/lml.cjs
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LML_ARTIFACT_CHECKSUM = exports.LML_ARTIFACT = void 0;
|
|
4
|
+
exports.profileFromLmlTree = profileFromLmlTree;
|
|
5
|
+
var lml_artifact_js_1 = require("./lml-artifact.cjs");
|
|
6
|
+
Object.defineProperty(exports, "LML_ARTIFACT", { enumerable: true, get: function () { return lml_artifact_js_1.LML_ARTIFACT; } });
|
|
7
|
+
exports.LML_ARTIFACT_CHECKSUM = "sha256:2be6267c036caef844bb7abb7dd4f3d38613a9126647a1eb8c4b8cca4cfe2d4e";
|
|
8
|
+
function unquote(raw) {
|
|
9
|
+
return raw.slice(1, -1).replace(/\\(.)/g, "$1");
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The items of a repetition site (the instance spine, `block`,
|
|
13
|
+
* `array`). The parslet shape law flattens a single iteration to the
|
|
14
|
+
* bare node and an empty repetition to null — normalize to a list.
|
|
15
|
+
*/
|
|
16
|
+
function items(node) {
|
|
17
|
+
if (Array.isArray(node))
|
|
18
|
+
return node;
|
|
19
|
+
if (node && typeof node === "object")
|
|
20
|
+
return [node];
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
function mapValue(node) {
|
|
24
|
+
if ("string" in node)
|
|
25
|
+
return unquote(node.string.value);
|
|
26
|
+
if ("integer" in node)
|
|
27
|
+
return Number(node.integer.value);
|
|
28
|
+
if ("symbol" in node)
|
|
29
|
+
return { ref: node.symbol.value };
|
|
30
|
+
if ("ref" in node)
|
|
31
|
+
return { ref: node.ref.symbol.value };
|
|
32
|
+
if ("prose" in node)
|
|
33
|
+
return node.prose.value.replace(/^[{ \n\r\t]+/, "").replace(/[}\s]+$/, "");
|
|
34
|
+
if ("array" in node)
|
|
35
|
+
return items(node.array).map(mapValue);
|
|
36
|
+
if ("block" in node) {
|
|
37
|
+
const out = {};
|
|
38
|
+
for (const entry of items(node.block))
|
|
39
|
+
out[entry.attr.key.value] = mapValue(entry.attr);
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
throw new Error("unreachable LML value kind");
|
|
43
|
+
}
|
|
44
|
+
/** Map a parsanol `lml` parse tree to the Profile the engine consumes. */
|
|
45
|
+
function profileFromLmlTree(tree) {
|
|
46
|
+
const instances = {};
|
|
47
|
+
for (const node of items(tree)) {
|
|
48
|
+
const inst = node?.instance;
|
|
49
|
+
if (!inst)
|
|
50
|
+
throw new Error("LML parse tree: expected an instance node");
|
|
51
|
+
// The quoted-name header form (Type "Name") captures the name with
|
|
52
|
+
// its quotes; normalize to the bare identifier.
|
|
53
|
+
const rawName = inst.name?.value ?? "";
|
|
54
|
+
const name = rawName.startsWith('"') ? unquote(rawName) : rawName;
|
|
55
|
+
const type = inst.type?.value;
|
|
56
|
+
if (!name || !type)
|
|
57
|
+
throw new Error("LML parse tree: instance needs name and type");
|
|
58
|
+
const properties = {};
|
|
59
|
+
for (const entry of items(inst.block)) {
|
|
60
|
+
const attr = entry?.attr;
|
|
61
|
+
if (!attr)
|
|
62
|
+
continue;
|
|
63
|
+
properties[attr.key.value] = mapValue(attr);
|
|
64
|
+
}
|
|
65
|
+
instances[name] = { name, type, properties };
|
|
66
|
+
}
|
|
67
|
+
return { instances };
|
|
68
|
+
}
|
package/dist/lml.d.cts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Profile } from "./index.cjs";
|
|
2
|
+
export { LML_ARTIFACT } from "./lml-artifact.cjs";
|
|
3
|
+
export declare const LML_ARTIFACT_CHECKSUM = "sha256:2be6267c036caef844bb7abb7dd4f3d38613a9126647a1eb8c4b8cca4cfe2d4e";
|
|
4
|
+
/** Map a parsanol `lml` parse tree to the Profile the engine consumes. */
|
|
5
|
+
export declare function profileFromLmlTree(tree: any): Profile;
|
package/dist/lml.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Profile } from "./index.js";
|
|
2
|
+
export { LML_ARTIFACT } from "./lml-artifact.js";
|
|
3
|
+
export declare const LML_ARTIFACT_CHECKSUM = "sha256:2be6267c036caef844bb7abb7dd4f3d38613a9126647a1eb8c4b8cca4cfe2d4e";
|
|
4
|
+
/** Map a parsanol `lml` parse tree to the Profile the engine consumes. */
|
|
5
|
+
export declare function profileFromLmlTree(tree: any): Profile;
|
package/dist/lml.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export { LML_ARTIFACT } from "./lml-artifact.js";
|
|
2
|
+
export const LML_ARTIFACT_CHECKSUM = "sha256:2be6267c036caef844bb7abb7dd4f3d38613a9126647a1eb8c4b8cca4cfe2d4e";
|
|
3
|
+
function unquote(raw) {
|
|
4
|
+
return raw.slice(1, -1).replace(/\\(.)/g, "$1");
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The items of a repetition site (the instance spine, `block`,
|
|
8
|
+
* `array`). The parslet shape law flattens a single iteration to the
|
|
9
|
+
* bare node and an empty repetition to null — normalize to a list.
|
|
10
|
+
*/
|
|
11
|
+
function items(node) {
|
|
12
|
+
if (Array.isArray(node))
|
|
13
|
+
return node;
|
|
14
|
+
if (node && typeof node === "object")
|
|
15
|
+
return [node];
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
function mapValue(node) {
|
|
19
|
+
if ("string" in node)
|
|
20
|
+
return unquote(node.string.value);
|
|
21
|
+
if ("integer" in node)
|
|
22
|
+
return Number(node.integer.value);
|
|
23
|
+
if ("symbol" in node)
|
|
24
|
+
return { ref: node.symbol.value };
|
|
25
|
+
if ("ref" in node)
|
|
26
|
+
return { ref: node.ref.symbol.value };
|
|
27
|
+
if ("prose" in node)
|
|
28
|
+
return node.prose.value.replace(/^[{ \n\r\t]+/, "").replace(/[}\s]+$/, "");
|
|
29
|
+
if ("array" in node)
|
|
30
|
+
return items(node.array).map(mapValue);
|
|
31
|
+
if ("block" in node) {
|
|
32
|
+
const out = {};
|
|
33
|
+
for (const entry of items(node.block))
|
|
34
|
+
out[entry.attr.key.value] = mapValue(entry.attr);
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
throw new Error("unreachable LML value kind");
|
|
38
|
+
}
|
|
39
|
+
/** Map a parsanol `lml` parse tree to the Profile the engine consumes. */
|
|
40
|
+
export function profileFromLmlTree(tree) {
|
|
41
|
+
const instances = {};
|
|
42
|
+
for (const node of items(tree)) {
|
|
43
|
+
const inst = node?.instance;
|
|
44
|
+
if (!inst)
|
|
45
|
+
throw new Error("LML parse tree: expected an instance node");
|
|
46
|
+
// The quoted-name header form (Type "Name") captures the name with
|
|
47
|
+
// its quotes; normalize to the bare identifier.
|
|
48
|
+
const rawName = inst.name?.value ?? "";
|
|
49
|
+
const name = rawName.startsWith('"') ? unquote(rawName) : rawName;
|
|
50
|
+
const type = inst.type?.value;
|
|
51
|
+
if (!name || !type)
|
|
52
|
+
throw new Error("LML parse tree: instance needs name and type");
|
|
53
|
+
const properties = {};
|
|
54
|
+
for (const entry of items(inst.block)) {
|
|
55
|
+
const attr = entry?.attr;
|
|
56
|
+
if (!attr)
|
|
57
|
+
continue;
|
|
58
|
+
properties[attr.key.value] = mapValue(attr);
|
|
59
|
+
}
|
|
60
|
+
instances[name] = { name, type, properties };
|
|
61
|
+
}
|
|
62
|
+
return { instances };
|
|
63
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nodeLoaders = nodeLoaders;
|
|
4
|
+
/**
|
|
5
|
+
* Shared node loaders over the pure core, parameterized by the host
|
|
6
|
+
* module system's bare-specifier resolver. The ESM entry (node.ts)
|
|
7
|
+
* injects createRequire(import.meta.url) and the CJS entry (node-cjs.ts)
|
|
8
|
+
* injects the real CommonJS require: import.meta cannot appear in the
|
|
9
|
+
* CJS build, so the resolver cannot live in this shared file.
|
|
10
|
+
*
|
|
11
|
+
* The browser-facing entry is src/index.ts — it must stay platform-free,
|
|
12
|
+
* the same split rhoella-ts uses.
|
|
13
|
+
*/
|
|
14
|
+
const fs = require("node:fs");
|
|
15
|
+
const index_js_1 = require("./index.cjs");
|
|
16
|
+
const lml_js_1 = require("./lml.cjs");
|
|
17
|
+
function nodeLoaders(resolve) {
|
|
18
|
+
let lmlRuntime = null;
|
|
19
|
+
async function lmlParse(source) {
|
|
20
|
+
if (!lmlRuntime) {
|
|
21
|
+
lmlRuntime = (async () => {
|
|
22
|
+
const { initialize, PargRuntime } = await Promise.resolve().then(() => require("parsanol/browser"));
|
|
23
|
+
await initialize(fs.readFileSync(resolve("parsanol/wasm")));
|
|
24
|
+
return new PargRuntime(lml_js_1.LML_ARTIFACT);
|
|
25
|
+
})();
|
|
26
|
+
}
|
|
27
|
+
const runtime = await lmlRuntime;
|
|
28
|
+
return runtime.parseShape(source, "main");
|
|
29
|
+
}
|
|
30
|
+
async function loadLml(source) {
|
|
31
|
+
return (0, lml_js_1.profileFromLmlTree)(await lmlParse(source));
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
loadProfileFile(path) {
|
|
35
|
+
return (0, index_js_1.loadProfile)(fs.readFileSync(path, "utf-8"));
|
|
36
|
+
},
|
|
37
|
+
loadLml,
|
|
38
|
+
loadLmlFile(path) {
|
|
39
|
+
return loadLml(fs.readFileSync(path, "utf-8"));
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Profile } from "./index.cjs";
|
|
2
|
+
export interface NodeLoaders {
|
|
3
|
+
loadProfileFile(path: string): Profile;
|
|
4
|
+
loadLml(source: string): Promise<Profile>;
|
|
5
|
+
loadLmlFile(path: string): Promise<Profile>;
|
|
6
|
+
}
|
|
7
|
+
export declare function nodeLoaders(resolve: (spec: string) => string): NodeLoaders;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Profile } from "./index.js";
|
|
2
|
+
export interface NodeLoaders {
|
|
3
|
+
loadProfileFile(path: string): Profile;
|
|
4
|
+
loadLml(source: string): Promise<Profile>;
|
|
5
|
+
loadLmlFile(path: string): Promise<Profile>;
|
|
6
|
+
}
|
|
7
|
+
export declare function nodeLoaders(resolve: (spec: string) => string): NodeLoaders;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared node loaders over the pure core, parameterized by the host
|
|
3
|
+
* module system's bare-specifier resolver. The ESM entry (node.ts)
|
|
4
|
+
* injects createRequire(import.meta.url) and the CJS entry (node-cjs.ts)
|
|
5
|
+
* injects the real CommonJS require: import.meta cannot appear in the
|
|
6
|
+
* CJS build, so the resolver cannot live in this shared file.
|
|
7
|
+
*
|
|
8
|
+
* The browser-facing entry is src/index.ts — it must stay platform-free,
|
|
9
|
+
* the same split rhoella-ts uses.
|
|
10
|
+
*/
|
|
11
|
+
import * as fs from "node:fs";
|
|
12
|
+
import { loadProfile } from "./index.js";
|
|
13
|
+
import { LML_ARTIFACT, profileFromLmlTree } from "./lml.js";
|
|
14
|
+
export function nodeLoaders(resolve) {
|
|
15
|
+
let lmlRuntime = null;
|
|
16
|
+
async function lmlParse(source) {
|
|
17
|
+
if (!lmlRuntime) {
|
|
18
|
+
lmlRuntime = (async () => {
|
|
19
|
+
const { initialize, PargRuntime } = await import("parsanol/browser");
|
|
20
|
+
await initialize(fs.readFileSync(resolve("parsanol/wasm")));
|
|
21
|
+
return new PargRuntime(LML_ARTIFACT);
|
|
22
|
+
})();
|
|
23
|
+
}
|
|
24
|
+
const runtime = await lmlRuntime;
|
|
25
|
+
return runtime.parseShape(source, "main");
|
|
26
|
+
}
|
|
27
|
+
async function loadLml(source) {
|
|
28
|
+
return profileFromLmlTree(await lmlParse(source));
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
loadProfileFile(path) {
|
|
32
|
+
return loadProfile(fs.readFileSync(path, "utf-8"));
|
|
33
|
+
},
|
|
34
|
+
loadLml,
|
|
35
|
+
loadLmlFile(path) {
|
|
36
|
+
return loadLml(fs.readFileSync(path, "utf-8"));
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
package/dist/node.cjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.loadLmlFile = exports.loadLml = exports.loadProfileFile = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* kaleidl node entry (CJS build): the twin of node.ts. The emitted
|
|
7
|
+
* file is CommonJS, so the bare-specifier resolver is the real
|
|
8
|
+
* `require` — import.meta cannot appear here, and the loaders live
|
|
9
|
+
* in node-loaders.ts. The ESM build excludes this file.
|
|
10
|
+
*/
|
|
11
|
+
const node_loaders_js_1 = require("./node-loaders.cjs");
|
|
12
|
+
_a = (0, node_loaders_js_1.nodeLoaders)((spec) => require.resolve(spec)), exports.loadProfileFile = _a.loadProfileFile, exports.loadLml = _a.loadLml, exports.loadLmlFile = _a.loadLmlFile;
|
package/dist/node.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadProfileFile: (path: string) => import("./index.cjs").Profile, loadLml: (source: string) => Promise<import("./index.cjs").Profile>, loadLmlFile: (path: string) => Promise<import("./index.cjs").Profile>;
|
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadProfileFile: (path: string) => import("./index.js").Profile, loadLml: (source: string) => Promise<import("./index.js").Profile>, loadLmlFile: (path: string) => Promise<import("./index.js").Profile>;
|
package/dist/node.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* kaleidl node entry (ESM build): file-system loaders over the pure
|
|
3
|
+
* core. The browser-facing entry is src/index.ts — it must stay
|
|
4
|
+
* platform-free.
|
|
5
|
+
*
|
|
6
|
+
* The CJS twin lives in node-cjs.ts: import.meta cannot appear in the
|
|
7
|
+
* CJS build, so each module system provides its own bare-specifier
|
|
8
|
+
* resolver and the loaders themselves live in node-loaders.ts.
|
|
9
|
+
*/
|
|
10
|
+
import { createRequire } from "node:module";
|
|
11
|
+
import { nodeLoaders } from "./node-loaders.js";
|
|
12
|
+
export const { loadProfileFile, loadLml, loadLmlFile } = nodeLoaders((spec) => createRequire(import.meta.url).resolve(spec));
|