@gmb/bitmark-parser-generator 4.13.0 → 4.14.0

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.js CHANGED
@@ -573,6 +573,7 @@ var BitType = superenum({
573
573
  surveyRatingOnce: "survey-rating-once",
574
574
  table: "table",
575
575
  tableAlt: "table-alt",
576
+ tableExtended: "table-extended",
576
577
  tableImage: "table-image",
577
578
  tableImageAlt: "table-image-alt",
578
579
  takePicture: "take-picture",
@@ -703,6 +704,7 @@ var CardSetConfigKey = superenum7({
703
704
  matchImagePairs: "matchImagePairs",
704
705
  matchMatrix: "matchMatrix",
705
706
  table: "table",
707
+ tableExtended: "tableExtended",
706
708
  pronunciationTable: "pronunciationTable",
707
709
  botActionResponses: "botActionResponses",
708
710
  exampleBitList: "exampleBitList",
@@ -1193,6 +1195,7 @@ var propertyKeys = {
1193
1195
  property_index: "@index",
1194
1196
  property_internalComment: "@internalComment",
1195
1197
  property_internalPrintPdf: "@internalPrintPdf",
1198
+ property_hasPrintRestriction: "@hasPrintRestriction",
1196
1199
  property_isCaseSensitive: "@isCaseSensitive",
1197
1200
  property_isInfoOnly: "@isInfoOnly",
1198
1201
  property_isPublic: "@isPublic",
@@ -1316,6 +1319,10 @@ var propertyKeys = {
1316
1319
  property_tableSearch: "@tableSearch",
1317
1320
  property_tableSort: "@tableSort",
1318
1321
  property_tableWhitespaceNoWrap: "@tableWhitespaceNoWrap",
1322
+ property_tableCellType: "@tableCellType",
1323
+ property_tableRowSpan: "@tableRowSpan",
1324
+ property_tableColSpan: "@tableColSpan",
1325
+ property_tableScope: "@tableScope",
1319
1326
  property_tag: "@tag",
1320
1327
  property_target: "@target",
1321
1328
  property_technicalTerm: "@technicalTerm",
@@ -2398,6 +2405,47 @@ var CARDSETS = {
2398
2405
  ]
2399
2406
  ]
2400
2407
  },
2408
+ [CardSetConfigKey.tableExtended]: {
2409
+ variants: [
2410
+ // Side 1
2411
+ [
2412
+ // Variant 1..N
2413
+ {
2414
+ tags: [
2415
+ {
2416
+ key: ConfigKey.group_standardItemLeadInstructionHint,
2417
+ description: "Standard tags for lead, instruction, and hint."
2418
+ },
2419
+ {
2420
+ key: ConfigKey.tag_title,
2421
+ description: "Title of the table."
2422
+ },
2423
+ {
2424
+ key: ConfigKey.property_tableCellType,
2425
+ description: "Table cell type (th/td).",
2426
+ format: TagFormat.plainText
2427
+ },
2428
+ {
2429
+ key: ConfigKey.property_tableRowSpan,
2430
+ description: "Number of rows the cell spans.",
2431
+ format: TagFormat.number
2432
+ },
2433
+ {
2434
+ key: ConfigKey.property_tableColSpan,
2435
+ description: "Number of columns the cell spans.",
2436
+ format: TagFormat.number
2437
+ },
2438
+ {
2439
+ key: ConfigKey.property_tableScope,
2440
+ description: "Scope attribute for header cells.",
2441
+ format: TagFormat.plainText
2442
+ }
2443
+ ],
2444
+ repeatCount: Count.infinity
2445
+ }
2446
+ ]
2447
+ ]
2448
+ },
2401
2449
  [CardSetConfigKey.pronunciationTable]: {
2402
2450
  variants: [
2403
2451
  // Side 1
@@ -3272,6 +3320,12 @@ var GROUPS = {
3272
3320
  key: ConfigKey.property_internalPrintPdf,
3273
3321
  description: "Url of the internal print PDF for the book",
3274
3322
  format: TagFormat.plainText
3323
+ },
3324
+ {
3325
+ key: ConfigKey.property_hasPrintRestriction,
3326
+ description: "If true, the book has print restrictions",
3327
+ format: TagFormat.boolean,
3328
+ defaultValue: "true"
3275
3329
  }
3276
3330
  ]
3277
3331
  },
@@ -8519,6 +8573,12 @@ var BITS = {
8519
8573
  ],
8520
8574
  cardSet: CardSetConfigKey.table
8521
8575
  },
8576
+ [BitType.tableExtended]: {
8577
+ since: "4.14.0",
8578
+ baseBitType: BitType.table,
8579
+ description: "Extended table bit, used to create complex tables with all HTML table features",
8580
+ cardSet: CardSetConfigKey.tableExtended
8581
+ },
8522
8582
  [BitType.tableAlt]: {
8523
8583
  since: "1.16.0",
8524
8584
  baseBitType: BitType.table,
@@ -9500,7 +9560,7 @@ var instance2 = new Config();
9500
9560
  // src/generated/package_info.ts
9501
9561
  var PACKAGE_INFO = {
9502
9562
  "name": "@gmb/bitmark-parser-generator",
9503
- "version": "4.13.0",
9563
+ "version": "4.14.0",
9504
9564
  "author": "Get More Brain Ltd",
9505
9565
  "license": "ISC",
9506
9566
  "description": "A bitmark parser and generator using Peggy.js"
@@ -10001,6 +10061,7 @@ var NodeType = superenum20({
10001
10061
  durationValue: "durationValue",
10002
10062
  elements: "elements",
10003
10063
  elementsValue: "elementsValue",
10064
+ elementsValueValue: "elementsValueValue",
10004
10065
  emphasis: "emphasis",
10005
10066
  end: "end",
10006
10067
  errors: "errors",
@@ -10029,6 +10090,7 @@ var NodeType = superenum20({
10029
10090
  focusY: "focusY",
10030
10091
  focusYValue: "focusYValue",
10031
10092
  footer: "footer",
10093
+ footerValue: "footerValue",
10032
10094
  footerText: "footerText",
10033
10095
  forKeys: "forKeys",
10034
10096
  format: "format",
@@ -10051,11 +10113,13 @@ var NodeType = superenum20({
10051
10113
  hasBookNavigationValue: "hasBookNavigationValue",
10052
10114
  hasMarkAsDone: "hasMarkAsDone",
10053
10115
  hasMarkAsDoneValue: "hasMarkAsDoneValue",
10116
+ head: "head",
10054
10117
  heading: "heading",
10055
10118
  height: "height",
10056
10119
  heightValue: "heightValue",
10057
10120
  highlight: "highlight",
10058
10121
  hint: "hint",
10122
+ hintValue: "hintValue",
10059
10123
  href: "href",
10060
10124
  icon: "icon",
10061
10125
  iconTag: "iconTag",
@@ -10077,10 +10141,13 @@ var NodeType = superenum20({
10077
10141
  ingredients: "ingredients",
10078
10142
  ingredientsValue: "ingredientsValue",
10079
10143
  instruction: "instruction",
10144
+ instructionValue: "instructionValue",
10080
10145
  internalComment: "internalComment",
10081
10146
  internalCommentValue: "internalCommentValue",
10082
10147
  internalPrintPdf: "internalPrintPdf",
10083
10148
  internalPrintPdfValue: "internalPrintPdfValue",
10149
+ hasPrintRestriction: "hasPrintRestriction",
10150
+ hasPrintRestrictionValue: "hasPrintRestrictionValue",
10084
10151
  isCaseSensitive: "isCaseSensitive",
10085
10152
  isCommented: "isCommented",
10086
10153
  isCorrect: "isCorrect",
@@ -10099,6 +10166,7 @@ var NodeType = superenum20({
10099
10166
  isTracked: "isTracked",
10100
10167
  isTrackedValue: "isTrackedValue",
10101
10168
  item: "item",
10169
+ itemValue: "itemValue",
10102
10170
  itemLead: "itemLead",
10103
10171
  jobTitle: "jobTitle",
10104
10172
  jobTitleValue: "jobTitleValue",
@@ -10125,6 +10193,7 @@ var NodeType = superenum20({
10125
10193
  layerRoleValue: "layerRoleValue",
10126
10194
  layerValue: "layerValue",
10127
10195
  lead: "lead",
10196
+ leadValue: "leadValue",
10128
10197
  level: "level",
10129
10198
  levelACTFL: "levelACTFL",
10130
10199
  levelACTFLValue: "levelACTFLValue",
@@ -10146,6 +10215,7 @@ var NodeType = superenum20({
10146
10215
  machineTranslatedValue: "machineTranslatedValue",
10147
10216
  mailingList: "mailingList",
10148
10217
  marginNumber: "marginNumber",
10218
+ marginNumberValue: "marginNumberValue",
10149
10219
  mark: "mark",
10150
10220
  markConfig: "markConfig",
10151
10221
  markConfigValue: "markConfigValue",
@@ -10174,6 +10244,7 @@ var NodeType = superenum20({
10174
10244
  pageNo: "pageNo",
10175
10245
  pageNoValue: "pageNoValue",
10176
10246
  pageNumber: "pageNumber",
10247
+ pageNumberValue: "pageNumberValue",
10177
10248
  pageValue: "pageValue",
10178
10249
  pairs: "pairs",
10179
10250
  pairsValue: "pairsValue",
@@ -10257,6 +10328,7 @@ var NodeType = superenum20({
10257
10328
  publisherValue: "publisherValue",
10258
10329
  quantity: "quantity",
10259
10330
  question: "question",
10331
+ questionValue: "questionValue",
10260
10332
  questions: "questions",
10261
10333
  questionsValue: "questionsValue",
10262
10334
  quizCountItems: "quizCountItems",
@@ -10309,6 +10381,10 @@ var NodeType = superenum20({
10309
10381
  revealSolutions: "revealSolutions",
10310
10382
  root: "root",
10311
10383
  // bit type (root)
10384
+ rows: "rows",
10385
+ rowsValue: "rowsValue",
10386
+ rubric: "rubric",
10387
+ rubricValue: "rubricValue",
10312
10388
  sampleSolution: "sampleSolution",
10313
10389
  sampleSolutionValue: "sampleSolutionValue",
10314
10390
  scormSource: "scormSource",
@@ -10914,6 +10990,103 @@ var DeprecatedTextFormat = superenum23({
10914
10990
  // bitmark-- text format, deprecated
10915
10991
  });
10916
10992
 
10993
+ // src/parser/json/TableUtils.ts
10994
+ function isTableBasicFormat(table) {
10995
+ const t = table;
10996
+ return !!(t.columns || t.data) && !(t.head || t.body || t.foot);
10997
+ }
10998
+ function isTableExtendedFormat(table) {
10999
+ const t = table;
11000
+ return !!(t.head || t.body || t.foot);
11001
+ }
11002
+ function isMixedTableFormat(table) {
11003
+ const t = table;
11004
+ const hasOld = !!(t.columns || t.data);
11005
+ const hasNew = !!(t.head || t.body || t.foot);
11006
+ return hasOld && hasNew;
11007
+ }
11008
+ function convertBasicToExtendedTableFormat(table) {
11009
+ const tableExtended = {};
11010
+ if (table.columns && table.columns.length > 0) {
11011
+ tableExtended.head = {
11012
+ rows: [
11013
+ {
11014
+ cells: table.columns.map((col) => ({
11015
+ content: col,
11016
+ title: true
11017
+ }))
11018
+ }
11019
+ ]
11020
+ };
11021
+ }
11022
+ if (table.data && table.data.length > 0) {
11023
+ tableExtended.body = {
11024
+ rows: table.data.map((row) => ({
11025
+ cells: row.map((cell) => ({
11026
+ content: cell
11027
+ }))
11028
+ }))
11029
+ };
11030
+ }
11031
+ return tableExtended;
11032
+ }
11033
+ function convertExtendedToBasicTableFormat(tableExtended) {
11034
+ const table = {};
11035
+ const extractRowCells = (row) => {
11036
+ if (!row || !Array.isArray(row.cells)) {
11037
+ return [];
11038
+ }
11039
+ return row.cells.map((cell) => cell?.content).filter((content) => content !== void 0);
11040
+ };
11041
+ const dataRows = [];
11042
+ const headRows = tableExtended.head?.rows ?? [];
11043
+ if (headRows.length > 0) {
11044
+ const primaryHeader = extractRowCells(headRows[0]);
11045
+ if (primaryHeader.length > 0) {
11046
+ table.columns = primaryHeader;
11047
+ }
11048
+ const remainingHeadRows = headRows.slice(1);
11049
+ remainingHeadRows.forEach((row) => {
11050
+ const cells = extractRowCells(row);
11051
+ if (cells.length > 0) {
11052
+ dataRows.push(cells);
11053
+ }
11054
+ });
11055
+ }
11056
+ const appendSectionRows = (section) => {
11057
+ if (!section || !Array.isArray(section.rows)) {
11058
+ return;
11059
+ }
11060
+ section.rows.forEach((row) => {
11061
+ const cells = extractRowCells(row);
11062
+ if (cells.length > 0) {
11063
+ dataRows.push(cells);
11064
+ }
11065
+ });
11066
+ };
11067
+ appendSectionRows(tableExtended.body);
11068
+ appendSectionRows(tableExtended.foot);
11069
+ if (dataRows.length > 0) {
11070
+ table.data = dataRows;
11071
+ }
11072
+ return table;
11073
+ }
11074
+ function normalizeTableFormat(bitType, table) {
11075
+ if (isMixedTableFormat(table)) {
11076
+ const t = table;
11077
+ delete t.columns;
11078
+ delete t.data;
11079
+ }
11080
+ const isExtended = instance2.isOfBitType(bitType, BitType.tableExtended);
11081
+ if (isExtended && isTableBasicFormat(table)) {
11082
+ return convertBasicToExtendedTableFormat(table);
11083
+ }
11084
+ if (!isExtended && isTableExtendedFormat(table)) {
11085
+ return convertExtendedToBasicTableFormat(table);
11086
+ }
11087
+ return table;
11088
+ }
11089
+
10917
11090
  // src/utils/ArrayUtils.ts
10918
11091
  var ArrayUtils = class {
10919
11092
  /**
@@ -22707,6 +22880,7 @@ var Builder = class extends BaseBuilder {
22707
22880
  * @returns
22708
22881
  */
22709
22882
  buildBit(data, options) {
22883
+ data = structuredClone(data);
22710
22884
  const bitType = data.bitType;
22711
22885
  const bitConfig = instance2.getBitConfig(bitType);
22712
22886
  const deprecatedTextFormat = DeprecatedTextFormat.fromValue(data.textFormat);
@@ -23375,6 +23549,12 @@ var Builder = class extends BaseBuilder {
23375
23549
  data.internalPrintPdf,
23376
23550
  options
23377
23551
  ),
23552
+ hasPrintRestriction: this.toAstProperty(
23553
+ bitType,
23554
+ ConfigKey.property_hasPrintRestriction,
23555
+ data.hasPrintRestriction,
23556
+ options
23557
+ ),
23378
23558
  tocResource: this.toAstProperty(
23379
23559
  bitType,
23380
23560
  ConfigKey.property_tocResource,
@@ -24144,21 +24324,53 @@ var Builder = class extends BaseBuilder {
24144
24324
  return node;
24145
24325
  }
24146
24326
  /**
24147
- * Build table node
24327
+ * Build table / table extended node
24148
24328
  *
24149
24329
  * @param data - data for the node
24150
24330
  * @returns
24151
24331
  */
24152
24332
  buildTable(context, dataIn) {
24153
24333
  if (!dataIn) return void 0;
24154
- const node = {
24155
- columns: (dataIn.columns || []).map(
24334
+ const node = normalizeTableFormat(context.bitType, dataIn);
24335
+ const nodeTable = node;
24336
+ const nodeTableExtended = node;
24337
+ if (Array.isArray(nodeTable.columns) && nodeTable.columns.length > 0) {
24338
+ nodeTable.columns = nodeTable.columns.map(
24156
24339
  (col) => this.handleJsonText(context, TextLocation.tag, col)
24157
- ),
24158
- data: (dataIn.data || []).map(
24340
+ );
24341
+ }
24342
+ if (Array.isArray(nodeTable.data) && nodeTable.data.length > 0) {
24343
+ nodeTable.data = nodeTable.data.map(
24159
24344
  (row) => (row || []).map((cell) => this.handleJsonText(context, TextLocation.tag, cell))
24160
- )
24345
+ );
24346
+ }
24347
+ const buildSection = (section) => {
24348
+ if (!section || !Array.isArray(section.rows)) return void 0;
24349
+ const rows = section.rows.map((row) => {
24350
+ const cells = (row.cells || []).map((cell) => {
24351
+ const tableCell = {
24352
+ content: this.handleJsonText(context, TextLocation.tag, cell.content)
24353
+ };
24354
+ if (cell.title != null) tableCell.title = cell.title;
24355
+ if (cell.rowspan != null) tableCell.rowspan = cell.rowspan;
24356
+ if (cell.colspan != null) tableCell.colspan = cell.colspan;
24357
+ if (cell.scope) tableCell.scope = cell.scope;
24358
+ return tableCell;
24359
+ });
24360
+ return {
24361
+ cells
24362
+ };
24363
+ });
24364
+ return {
24365
+ rows
24366
+ };
24161
24367
  };
24368
+ const head = buildSection(nodeTableExtended.head);
24369
+ if (head && head.rows?.length > 0) nodeTableExtended.head = head;
24370
+ const body = buildSection(nodeTableExtended.body);
24371
+ if (body && body.rows?.length > 0) nodeTableExtended.body = body;
24372
+ const foot = buildSection(nodeTableExtended.foot);
24373
+ if (foot && foot.rows?.length > 0) nodeTableExtended.foot = foot;
24162
24374
  return node;
24163
24375
  }
24164
24376
  /**
@@ -24182,7 +24394,7 @@ var Builder = class extends BaseBuilder {
24182
24394
  if (!data) return void 0;
24183
24395
  const defaultExample = data.__sampleSolutionAst;
24184
24396
  const node = {
24185
- question: data.question ?? "",
24397
+ question: this.handleJsonText(context, TextLocation.body, data.question),
24186
24398
  partialAnswer: data.partialAnswer ?? "",
24187
24399
  sampleSolution: data.sampleSolution ?? "",
24188
24400
  additionalSolutions: data.additionalSolutions ?? void 0,
@@ -24196,9 +24408,9 @@ var Builder = class extends BaseBuilder {
24196
24408
  };
24197
24409
  objectUtils.removeUnwantedProperties(node, {
24198
24410
  ignoreAllFalse: true,
24199
- ignoreEmptyArrays: ["item", "hint", "instruction"],
24411
+ ignoreEmptyArrays: ["question", "item", "hint", "instruction"],
24200
24412
  ignoreUndefined: ["example"],
24201
- ignoreEmptyString: ["question", "partialAnswer", "sampleSolution"]
24413
+ ignoreEmptyString: ["partialAnswer", "sampleSolution"]
24202
24414
  });
24203
24415
  return node;
24204
24416
  }
@@ -24736,7 +24948,7 @@ var Builder = class extends BaseBuilder {
24736
24948
  buildStatement(context, data) {
24737
24949
  if (!data) return void 0;
24738
24950
  const node = {
24739
- statement: data.statement ?? "",
24951
+ statement: this.handleJsonText(context, TextLocation.tag, data.statement),
24740
24952
  isCorrect: !!data.isCorrect,
24741
24953
  item: this.handleJsonText(context, TextLocation.tag, data.item),
24742
24954
  lead: this.handleJsonText(context, TextLocation.tag, data.lead),
@@ -24746,7 +24958,7 @@ var Builder = class extends BaseBuilder {
24746
24958
  };
24747
24959
  objectUtils.removeUnwantedProperties(node, {
24748
24960
  ignoreAllFalse: true,
24749
- // ignoreAllEmptyArrays: true,
24961
+ ignoreEmptyArrays: ["statement"],
24750
24962
  ignoreUndefined: ["example"]
24751
24963
  });
24752
24964
  return node;
@@ -24958,7 +25170,7 @@ var Builder = class extends BaseBuilder {
24958
25170
  const node = {
24959
25171
  heading: this.buildHeading(context, data.heading),
24960
25172
  questions: this.buildQuestions(context, data.questions),
24961
- elements: data.elements,
25173
+ elements: this.handleJsonText(context, TextLocation.body, data.elements),
24962
25174
  flashcards: this.buildFlashcards(context, data.flashcards),
24963
25175
  definitions: this.buildDefinitionList(context, data.definitions ?? data.legend),
24964
25176
  statement: this.buildStatement(context, data.statement),
@@ -24977,7 +25189,9 @@ var Builder = class extends BaseBuilder {
24977
25189
  // captionDefinitionList: this.buildCaptionDefinitionList(context, data.captionDefinitionList),
24978
25190
  cardBits: this.buildCardBits(context, data.cardBits)
24979
25191
  };
24980
- objectUtils.removeUnwantedProperties(node);
25192
+ objectUtils.removeUnwantedProperties(node, {
25193
+ ignoreEmptyObjects: ["table"]
25194
+ });
24981
25195
  return Object.keys(node).length > 0 ? node : void 0;
24982
25196
  }
24983
25197
  /**
@@ -25481,6 +25695,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
25481
25695
  __publicField(this, "hasCardSet", false);
25482
25696
  __publicField(this, "hasFooter", false);
25483
25697
  __publicField(this, "inTag", true);
25698
+ __publicField(this, "skipTableTraversal", false);
25484
25699
  this.enter = this.enter.bind(this);
25485
25700
  this.between = this.between.bind(this);
25486
25701
  this.exit = this.exit.bind(this);
@@ -26183,7 +26398,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26183
26398
  enter_elements(_node, _route) {
26184
26399
  }
26185
26400
  between_elements(_node, _left, _right, _route) {
26186
- this.writeCardSetVariantDivider();
26401
+ this.writeCardSetSideDivider();
26187
26402
  }
26188
26403
  // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards
26189
26404
  between_flashcards(_node, _left, _right, _route) {
@@ -26310,6 +26525,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26310
26525
  enter_matrix(_node, _route) {
26311
26526
  }
26312
26527
  between_matrix(_node, _left, _right, _route) {
26528
+ if (!this.isCardAllowed) return;
26313
26529
  this.writeCardSetCardDivider();
26314
26530
  }
26315
26531
  // bitmarkAst -> bits -> bitsValue -> cardNode -> pairs -> pairsValue -> values
@@ -26330,12 +26546,83 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26330
26546
  this.writeCardSetCardDivider();
26331
26547
  }
26332
26548
  // bitmarkAst -> bits -> bitsValue -> cardNode -> table
26549
+ enter_table(node, route) {
26550
+ const parent = this.getParentNode(route);
26551
+ if (parent?.key !== NodeType.cardNode) return true;
26552
+ const table = node.value;
26553
+ if (!table) return true;
26554
+ if (this.writeAdvancedTable(table)) {
26555
+ return false;
26556
+ }
26557
+ return true;
26558
+ }
26333
26559
  between_table(_node, _left, _right, route) {
26334
26560
  const parent = this.getParentNode(route);
26335
26561
  if (parent?.key !== NodeType.cardNode) return;
26336
26562
  if (!this.isCardAllowed) return;
26337
26563
  this.writeCardSetCardDivider();
26338
26564
  }
26565
+ writeAdvancedTable(table) {
26566
+ const normalized = normalizeTableFormat(BitType.tableExtended, table);
26567
+ const sections = [
26568
+ { key: "thead", qualifier: "thead", section: normalized.head },
26569
+ { key: "tbody", qualifier: void 0, section: normalized.body },
26570
+ { key: "tfoot", qualifier: "tfoot", section: normalized.foot }
26571
+ ];
26572
+ let rowCount = 0;
26573
+ for (const { key, qualifier, section } of sections) {
26574
+ const rows = section?.rows ?? [];
26575
+ if (rows.length === 0) {
26576
+ continue;
26577
+ }
26578
+ for (const row of rows) {
26579
+ this.writeCardSetCardDivider(qualifier);
26580
+ this.writeTableRow(row, key);
26581
+ rowCount++;
26582
+ }
26583
+ }
26584
+ return rowCount > 0;
26585
+ }
26586
+ writeTableRow(row, section) {
26587
+ const cells = row?.cells ?? [];
26588
+ if (cells.length === 0) return;
26589
+ for (let index = 0; index < cells.length; index++) {
26590
+ if (index > 0) {
26591
+ this.writeCardSetSideDivider();
26592
+ }
26593
+ this.writeNL();
26594
+ this.writeTableCell(cells[index], section);
26595
+ }
26596
+ }
26597
+ writeTableCell(cell, section) {
26598
+ const defaultCellType = section === "tbody" ? "td" : "th";
26599
+ const cellType = cell.title ? "th" : "td";
26600
+ if (cellType !== defaultCellType) {
26601
+ this.writeTableCellProperty("tableCellType", cellType);
26602
+ this.writeNL();
26603
+ }
26604
+ if (cell.rowspan && cell.rowspan > 1) {
26605
+ this.writeTableCellProperty("tableRowSpan", cell.rowspan);
26606
+ this.writeNL();
26607
+ }
26608
+ if (cell.colspan && cell.colspan > 1) {
26609
+ this.writeTableCellProperty("tableColSpan", cell.colspan);
26610
+ this.writeNL();
26611
+ }
26612
+ if (cell.scope) {
26613
+ this.writeTableCellProperty("tableScope", cell.scope);
26614
+ this.writeNL();
26615
+ }
26616
+ const content = cell.content ?? instance3.EMPTY_STRING;
26617
+ this.writeTextOrValue(content, this.textFormat, TextLocation.body);
26618
+ }
26619
+ writeTableCellProperty(name, value) {
26620
+ this.writeOPA();
26621
+ this.writeTagKey(name);
26622
+ this.writeColon();
26623
+ this.writeTextOrValue(`${value}`, TextFormat.plainText, TextLocation.tag);
26624
+ this.writeCL();
26625
+ }
26339
26626
  // bitmarkAst -> bits -> bitsValue -> cardNode -> table -> data
26340
26627
  // bitmarkAst -> bits -> bitsValue -> cardNode -> pronunciationTable -> data
26341
26628
  between_data(_node, _left, _right, route) {
@@ -26857,8 +27144,8 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26857
27144
  } else {
26858
27145
  }
26859
27146
  }
26860
- // bitmarkAst -> bits -> bitsValue -> elements -> elementsValue
26861
- leaf_elementsValue(node, _route) {
27147
+ // bitmarkAst -> bits -> bitsValue -> cardNode -> elements -> elementsValue
27148
+ enter_elementsValue(node, _route) {
26862
27149
  if (node.value) {
26863
27150
  this.writeNL();
26864
27151
  this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);
@@ -26941,10 +27228,19 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26941
27228
  }
26942
27229
  }
26943
27230
  // bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> question
27231
+ // bitmarkAst -> bits -> bitsValue -> cardNode -> questions -> questionsValue -> question
27232
+ enter_question(node, route) {
27233
+ const parent = this.getParentNode(route);
27234
+ if (parent?.key !== NodeType.questionsValue) return;
27235
+ if (node.value) {
27236
+ this.writeNL();
27237
+ this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);
27238
+ }
27239
+ }
26944
27240
  // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards -> flashcardsValue -> question
26945
27241
  leaf_question(node, route) {
26946
27242
  const parent = this.getParentNode(route);
26947
- if (parent?.key !== NodeType.questionsValue && parent?.key !== NodeType.flashcardsValue) return;
27243
+ if (parent?.key !== NodeType.flashcardsValue) return;
26948
27244
  if (node.value) {
26949
27245
  this.writeNL();
26950
27246
  this.writeTextOrValue(node.value, this.textFormat, TextLocation.body);
@@ -27420,12 +27716,12 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27420
27716
  } else {
27421
27717
  }
27422
27718
  }
27423
- writeCardSetCardDivider() {
27719
+ writeCardSetCardDivider(qualifier) {
27424
27720
  this.writeNL();
27425
- if (this.options.cardSetVersion === CardSetVersion.v1) {
27426
- this.write("===");
27427
- } else {
27428
- this.write("====");
27721
+ const divider = this.getCardDividerMarker();
27722
+ this.write(divider);
27723
+ if (qualifier) {
27724
+ this.appendCardDividerQualifier(qualifier);
27429
27725
  }
27430
27726
  }
27431
27727
  writeCardSetSideDivider() {
@@ -27444,6 +27740,20 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27444
27740
  this.write("++");
27445
27741
  }
27446
27742
  }
27743
+ getCardDividerMarker() {
27744
+ return this.options.cardSetVersion === CardSetVersion.v1 ? "===" : "====";
27745
+ }
27746
+ appendCardDividerQualifier(qualifier) {
27747
+ const marker = this.getCardDividerMarker();
27748
+ const normalizedQualifier = instance3.breakscape(qualifier, {
27749
+ format: TextFormat.plainText,
27750
+ location: TextLocation.tag
27751
+ });
27752
+ this.write(" ");
27753
+ this.write(normalizedQualifier);
27754
+ this.write(" ");
27755
+ this.write(marker);
27756
+ }
27447
27757
  writeNL_IfNotChain(route) {
27448
27758
  if (!this.isChain(route)) {
27449
27759
  this.writeNL();
@@ -27548,7 +27858,10 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27548
27858
  return !!writeFormat;
27549
27859
  }
27550
27860
  calculateIsCardAllowed() {
27551
- return this.isBodyBitmarkText && !this.isOfBitType1();
27861
+ return this.isBodyBitmarkText && !this.isOfBitType1() && !this.isTableBitType();
27862
+ }
27863
+ isTableBitType() {
27864
+ return this.isOfBitType([BitType.table]);
27552
27865
  }
27553
27866
  isOfBitType1() {
27554
27867
  return this.isOfBitType([
@@ -28065,7 +28378,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
28065
28378
  const parent = this.getParentNode(route);
28066
28379
  if (parent?.key !== NodeType.cardNode) return;
28067
28380
  if (statement) {
28068
- this.bitJson.statement = statement.statement ?? "";
28381
+ this.bitJson.statement = statement.statement ?? [];
28069
28382
  this.bitJson.isCorrect = statement.isCorrect ?? false;
28070
28383
  this.bitJson.example = statement.example;
28071
28384
  this.bitJson.isExample = statement.isExample;
@@ -28687,6 +29000,9 @@ var JsonGenerator = class extends AstWalkerGenerator {
28687
29000
  if (bitJson.footer == null) bitJson.footer = this.textDefault;
28688
29001
  if (bitJson.questions == null) bitJson.questions = [];
28689
29002
  }
29003
+ if (instance2.isOfBitType(bitType, BitType.sequence)) {
29004
+ if (bitJson.elements == null) bitJson.elements = [];
29005
+ }
28690
29006
  if (bitType === BitType.matchMatrix) {
28691
29007
  isTopLevelExample = true;
28692
29008
  }
@@ -28747,6 +29063,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
28747
29063
  }
28748
29064
  if (instance2.isOfBitType(bitType, BitType.book)) {
28749
29065
  if (bitJson.maxTocChapterLevel == null) bitJson.maxTocChapterLevel = -1;
29066
+ if (bitJson.hasPrintRestriction == null) bitJson.hasPrintRestriction = true;
28750
29067
  if (bitJson.hasMarkAsDone == null) bitJson.hasMarkAsDone = false;
28751
29068
  if (bitJson.processHandIn == null) bitJson.processHandIn = false;
28752
29069
  if (bitJson.isPublic == null) bitJson.isPublic = false;
@@ -29404,6 +29721,9 @@ var BitmarkPegParserHelper = class {
29404
29721
  __publicField(this, "cardIndex", 0);
29405
29722
  __publicField(this, "cardSideIndex", 0);
29406
29723
  __publicField(this, "cardVariantIndex", 0);
29724
+ __publicField(this, "currentCardQualifier");
29725
+ __publicField(this, "currentSideQualifier");
29726
+ __publicField(this, "currentVariantQualifier");
29407
29727
  __publicField(this, "parse");
29408
29728
  __publicField(this, "parserText");
29409
29729
  __publicField(this, "parserLocation");
@@ -29572,30 +29892,43 @@ var BitmarkPegParserHelper = class {
29572
29892
  cardIndex,
29573
29893
  cardSideIndex,
29574
29894
  cardVariantIndex: cardContentIndex,
29575
- value: value2
29895
+ value: value2,
29896
+ cardQualifier,
29897
+ cardSideQualifier,
29898
+ cardVariantQualifier
29576
29899
  } = cardData;
29577
29900
  let card = unparsedCardSet.cards[cardIndex];
29578
29901
  if (!card) {
29579
29902
  card = {
29580
- sides: []
29903
+ sides: [],
29904
+ qualifier: cardQualifier
29581
29905
  };
29582
29906
  unparsedCardSet.cards[cardIndex] = card;
29907
+ } else if (cardQualifier && !card.qualifier) {
29908
+ card.qualifier = cardQualifier;
29583
29909
  }
29584
29910
  let side = card.sides[cardSideIndex];
29585
29911
  if (!side) {
29586
29912
  side = {
29587
- variants: []
29913
+ variants: [],
29914
+ qualifier: cardSideQualifier
29588
29915
  };
29589
29916
  card.sides[cardSideIndex] = side;
29917
+ } else if (cardSideQualifier && !side.qualifier) {
29918
+ side.qualifier = cardSideQualifier;
29590
29919
  }
29591
29920
  const variant = side.variants[cardContentIndex];
29592
29921
  if (!variant) {
29593
29922
  side.variants[cardContentIndex] = {
29594
29923
  value: value2,
29595
- parser: parser3
29924
+ parser: parser3,
29925
+ qualifier: cardVariantQualifier
29596
29926
  };
29597
29927
  } else {
29598
29928
  side.variants[cardContentIndex].value += value2;
29929
+ if (cardVariantQualifier && !variant.qualifier) {
29930
+ variant.qualifier = cardVariantQualifier;
29931
+ }
29599
29932
  }
29600
29933
  }
29601
29934
  unparsedCardSet.cards = unparsedCardSet.cards.filter((card) => {
@@ -29608,12 +29941,14 @@ var BitmarkPegParserHelper = class {
29608
29941
  });
29609
29942
  for (const unparsedCard of unparsedCardSet.cards) {
29610
29943
  const card = {
29611
- sides: []
29944
+ sides: [],
29945
+ qualifier: unparsedCard.qualifier
29612
29946
  };
29613
29947
  cardSet.cards.push(card);
29614
29948
  for (const unparsedSide of unparsedCard.sides) {
29615
29949
  const side = {
29616
- variants: []
29950
+ variants: [],
29951
+ qualifier: unparsedSide.qualifier
29617
29952
  };
29618
29953
  card.sides.push(side);
29619
29954
  for (const unparsedContent of unparsedSide.variants) {
@@ -29638,7 +29973,8 @@ var BitmarkPegParserHelper = class {
29638
29973
  if (DEBUG_TRACE_CARD_PARSED) this.debugPrint("parsedCardContent", content);
29639
29974
  side.variants.push({
29640
29975
  parser: parser2,
29641
- content
29976
+ content,
29977
+ qualifier: unparsedContent.qualifier
29642
29978
  });
29643
29979
  }
29644
29980
  }
@@ -29658,12 +29994,18 @@ var BitmarkPegParserHelper = class {
29658
29994
  this.cardIndex = -1;
29659
29995
  this.cardSideIndex = 0;
29660
29996
  this.cardVariantIndex = 0;
29997
+ this.currentCardQualifier = void 0;
29998
+ this.currentSideQualifier = void 0;
29999
+ this.currentVariantQualifier = void 0;
29661
30000
  }
29662
30001
  handleCardSetEnd() {
29663
30002
  if (DEBUG_TRACE_CARD_SET_END) this.debugPrint("CardSetEnd");
29664
30003
  this.cardIndex = 0;
29665
30004
  this.cardSideIndex = 0;
29666
30005
  this.cardVariantIndex = 0;
30006
+ this.currentCardQualifier = void 0;
30007
+ this.currentSideQualifier = void 0;
30008
+ this.currentVariantQualifier = void 0;
29667
30009
  }
29668
30010
  handleCards(value) {
29669
30011
  return value;
@@ -29673,27 +30015,45 @@ var BitmarkPegParserHelper = class {
29673
30015
  let isCardDivider = false;
29674
30016
  let isSideDivider = false;
29675
30017
  let isVariantDivider = false;
30018
+ let qualifier;
29676
30019
  if (Array.isArray(value) && value.length === 2) {
29677
- value = value[0];
29678
- if (version === CardSetVersion.v1) {
29679
- isCardDivider = value === CARD_DIVIDER_V1;
29680
- isSideDivider = value === CARD_SIDE_DIVIDER_V1;
29681
- isVariantDivider = value === CARD_VARIANT_DIVIDER_V1;
30020
+ const [divider, maybeQualifier] = value;
30021
+ if (typeof divider === "string") {
30022
+ value = divider;
30023
+ if (typeof maybeQualifier === "string" && maybeQualifier.trim() === maybeQualifier && maybeQualifier.length > 0) {
30024
+ qualifier = maybeQualifier;
30025
+ }
29682
30026
  } else {
29683
- isCardDivider = value === CARD_DIVIDER_V2;
29684
- isSideDivider = value === CARD_SIDE_DIVIDER_V2;
29685
- isVariantDivider = value === CARD_VARIANT_DIVIDER_V2;
30027
+ value = divider;
29686
30028
  }
30029
+ } else if (Array.isArray(value) && value.length === 1) {
30030
+ const [divider] = value;
30031
+ value = divider;
30032
+ }
30033
+ if (version === CardSetVersion.v1) {
30034
+ isCardDivider = value === CARD_DIVIDER_V1;
30035
+ isSideDivider = value === CARD_SIDE_DIVIDER_V1;
30036
+ isVariantDivider = value === CARD_VARIANT_DIVIDER_V1;
30037
+ } else {
30038
+ isCardDivider = value === CARD_DIVIDER_V2;
30039
+ isSideDivider = value === CARD_SIDE_DIVIDER_V2;
30040
+ isVariantDivider = value === CARD_VARIANT_DIVIDER_V2;
29687
30041
  }
29688
30042
  if (isCardDivider) {
29689
30043
  this.cardIndex++;
29690
30044
  this.cardSideIndex = 0;
29691
30045
  this.cardVariantIndex = 0;
30046
+ this.currentCardQualifier = qualifier;
30047
+ this.currentSideQualifier = void 0;
30048
+ this.currentVariantQualifier = void 0;
29692
30049
  } else if (isSideDivider) {
29693
30050
  this.cardSideIndex++;
29694
30051
  this.cardVariantIndex = 0;
30052
+ this.currentSideQualifier = qualifier;
30053
+ this.currentVariantQualifier = void 0;
29695
30054
  } else if (isVariantDivider) {
29696
30055
  this.cardVariantIndex++;
30056
+ this.currentVariantQualifier = qualifier;
29697
30057
  }
29698
30058
  if (this.isType(value, TypeKey.Card)) return value;
29699
30059
  return {
@@ -29702,7 +30062,10 @@ var BitmarkPegParserHelper = class {
29702
30062
  cardIndex: this.cardIndex,
29703
30063
  cardSideIndex: this.cardSideIndex,
29704
30064
  cardVariantIndex: this.cardVariantIndex,
29705
- value: ""
30065
+ value: "",
30066
+ cardQualifier: this.currentCardQualifier,
30067
+ cardSideQualifier: this.currentSideQualifier,
30068
+ cardVariantQualifier: this.currentVariantQualifier
29706
30069
  },
29707
30070
  parser: {
29708
30071
  text: this.parserText(),
@@ -29723,7 +30086,10 @@ var BitmarkPegParserHelper = class {
29723
30086
  cardIndex: this.cardIndex,
29724
30087
  cardSideIndex: this.cardSideIndex,
29725
30088
  cardVariantIndex: this.cardVariantIndex,
29726
- value
30089
+ value,
30090
+ cardQualifier: this.currentCardQualifier,
30091
+ cardSideQualifier: this.currentSideQualifier,
30092
+ cardVariantQualifier: this.currentVariantQualifier
29727
30093
  },
29728
30094
  parser: {
29729
30095
  text: this.parserText(),
@@ -30820,6 +31186,7 @@ function buildCards(context, bitType, textFormat, parsedCardSet, statementV1, st
30820
31186
  result = parsePronunciationTable(context, bitType, processedCardSet);
30821
31187
  break;
30822
31188
  case CardSetConfigKey.table:
31189
+ case CardSetConfigKey.tableExtended:
30823
31190
  result = parseTable(context, bitType, processedCardSet);
30824
31191
  break;
30825
31192
  case CardSetConfigKey.botActionResponses:
@@ -30856,20 +31223,23 @@ function processCardSet(context, parsedCardSet) {
30856
31223
  for (const card of parsedCardSet.cards) {
30857
31224
  const processedCard = {
30858
31225
  no: cardNo++,
30859
- sides: []
31226
+ sides: [],
31227
+ qualifier: card.qualifier
30860
31228
  };
30861
31229
  processedCardSet.cards.push(processedCard);
30862
31230
  for (const side of card.sides) {
30863
31231
  const processedSide = {
30864
31232
  no: sideNo++,
30865
- variants: []
31233
+ variants: [],
31234
+ qualifier: side.qualifier
30866
31235
  };
30867
31236
  processedCard.sides.push(processedSide);
30868
31237
  for (const variant of side.variants) {
30869
31238
  const { parser: parser2, content } = variant;
30870
31239
  const processedVariant = {
30871
31240
  parser: parser2,
30872
- no: variantNo++
31241
+ no: variantNo++,
31242
+ qualifier: variant.qualifier
30873
31243
  };
30874
31244
  processedSide.variants.push(processedVariant);
30875
31245
  const tagsConfig = instance2.getTagsConfigForCardSet(bitType, sideNo, variantNo);
@@ -30983,7 +31353,8 @@ function parseElements(_context, _bitType, cardSet) {
30983
31353
  for (const side of card.sides) {
30984
31354
  for (const content of side.variants) {
30985
31355
  const tags2 = content.data;
30986
- elements.push(tags2.cardBodyStr ?? "");
31356
+ const element = tags2.cardBody?.body ?? tags2.cardBodyStr ?? instance3.EMPTY_STRING;
31357
+ elements.push(element);
30987
31358
  }
30988
31359
  }
30989
31360
  }
@@ -31000,7 +31371,7 @@ function parseStatements(_context, _bitType, cardSet, statementV1, statementsV1)
31000
31371
  if (Array.isArray(chainedStatements)) {
31001
31372
  for (const s of chainedStatements) {
31002
31373
  const statement = {
31003
- statement: s.statement ?? "",
31374
+ statement: s.statement ?? [],
31004
31375
  isCorrect: s.isCorrect,
31005
31376
  item: s.item,
31006
31377
  lead: s.lead,
@@ -31142,7 +31513,7 @@ function parseQuestions(_context, _bitType, cardSet) {
31142
31513
  for (const content of side.variants) {
31143
31514
  const tags2 = content.data;
31144
31515
  const q = {
31145
- question: tags2.cardBodyStr ?? "",
31516
+ question: tags2.cardBody?.body ?? tags2.cardBodyStr ?? instance3.EMPTY_STRING,
31146
31517
  ...tags2
31147
31518
  };
31148
31519
  if (q) questions.push(q);
@@ -31346,37 +31717,158 @@ function parsePronunciationTable(_context, _bitType, cardSet) {
31346
31717
  };
31347
31718
  return { pronunciationTable: table };
31348
31719
  }
31349
- function parseTable(_context, _bitType, cardSet) {
31350
- let isHeading = false;
31351
- const columns = [];
31352
- const rows = [];
31353
- let rowValues = [];
31720
+ function parseTable(context, _bitType, cardSet) {
31721
+ const sectionRows = {
31722
+ thead: [],
31723
+ tbody: [],
31724
+ tfoot: []
31725
+ };
31726
+ const getNormalizedQualifier = (rawQualifier) => {
31727
+ if (!rawQualifier) return void 0;
31728
+ const normalized = rawQualifier.trim().toLowerCase();
31729
+ if (normalized === "thead" || normalized === "tbody" || normalized === "tfoot") {
31730
+ return normalized;
31731
+ }
31732
+ context.addWarning(`Unknown table section qualifier '${rawQualifier}', defaulting to tbody.`);
31733
+ return void 0;
31734
+ };
31735
+ const isLegacyHeadingRow = (card, cardIndex) => {
31736
+ if (cardIndex !== 0) return false;
31737
+ return card.sides.some(
31738
+ (side) => side.variants.some((variant) => {
31739
+ const titles = variant.data.title;
31740
+ return Array.isArray(titles) && titles[1]?.titleAst;
31741
+ })
31742
+ );
31743
+ };
31744
+ const readExtraProperty = (extra, key) => {
31745
+ if (!extra) return void 0;
31746
+ const value = extra[key];
31747
+ return Array.isArray(value) ? value[0] : value;
31748
+ };
31749
+ const cleanupExtraProperties = (tags2, keys) => {
31750
+ const extra = tags2.extraProperties;
31751
+ if (!extra) return;
31752
+ for (const key of keys) {
31753
+ if (Object.prototype.hasOwnProperty.call(extra, key)) delete extra[key];
31754
+ }
31755
+ if (Object.keys(extra).length === 0) {
31756
+ delete tags2.extraProperties;
31757
+ }
31758
+ };
31759
+ const normalizeCellType = (raw, section) => {
31760
+ if (typeof raw === "string") {
31761
+ const normalized = raw.trim().toLowerCase();
31762
+ if (normalized === "th" || normalized === "td") {
31763
+ return normalized;
31764
+ }
31765
+ context.addWarning(
31766
+ `Invalid table cell type '${raw}', using default for section '${section}'.`
31767
+ );
31768
+ }
31769
+ return section === "tbody" ? "td" : "th";
31770
+ };
31771
+ const normalizeSpan = (raw, kind) => {
31772
+ if (raw == null) return 1;
31773
+ const numeric = instance6.asNumber(raw);
31774
+ if (numeric == null || !Number.isInteger(numeric) || numeric < 1) {
31775
+ context.addWarning(`Invalid table ${kind} '${raw}', defaulting to 1.`);
31776
+ return 1;
31777
+ }
31778
+ return numeric;
31779
+ };
31780
+ const normalizeScope = (raw) => {
31781
+ if (raw == null) return void 0;
31782
+ if (typeof raw !== "string") {
31783
+ context.addWarning(`Invalid table scope '${raw}', ignoring.`);
31784
+ return void 0;
31785
+ }
31786
+ const normalized = raw.trim().toLowerCase();
31787
+ switch (normalized) {
31788
+ case "row":
31789
+ case "col":
31790
+ case "rowgroup":
31791
+ case "colgroup":
31792
+ return normalized;
31793
+ default:
31794
+ context.addWarning(`Invalid table scope '${raw}', ignoring.`);
31795
+ return void 0;
31796
+ }
31797
+ };
31798
+ const buildCell = (variant, section) => {
31799
+ const tags2 = variant.data;
31800
+ const heading = tags2.title && tags2.title[1]?.titleAst;
31801
+ const bodyContent = tags2.cardBody?.body ?? tags2.cardBodyStr ?? instance3.EMPTY_STRING;
31802
+ const content = heading ?? bodyContent;
31803
+ const cellTypeRaw = tags2.tableCellType ?? readExtraProperty(tags2.extraProperties, "tableCellType");
31804
+ const rowSpanRaw = tags2.tableRowSpan ?? readExtraProperty(tags2.extraProperties, "tableRowSpan");
31805
+ const colSpanRaw = tags2.tableColSpan ?? readExtraProperty(tags2.extraProperties, "tableColSpan");
31806
+ const scopeRaw = tags2.tableScope ?? readExtraProperty(tags2.extraProperties, "tableScope");
31807
+ cleanupExtraProperties(tags2, ["tableCellType", "tableRowSpan", "tableColSpan", "tableScope"]);
31808
+ const cellType = normalizeCellType(cellTypeRaw, section);
31809
+ const rowspan = normalizeSpan(rowSpanRaw, "rowspan");
31810
+ const colspan = normalizeSpan(colSpanRaw, "colspan");
31811
+ const scope = normalizeScope(scopeRaw);
31812
+ const cell = {
31813
+ content
31814
+ };
31815
+ if (cellType === "th") cell.title = true;
31816
+ if (rowspan > 1) cell.rowspan = rowspan;
31817
+ if (colspan > 1) cell.colspan = colspan;
31818
+ if (scope) cell.scope = scope;
31819
+ return cell;
31820
+ };
31821
+ const resolveSectionQualifier = (card) => {
31822
+ const cardQualifier = getNormalizedQualifier(card.qualifier);
31823
+ if (cardQualifier) return cardQualifier;
31824
+ for (const side of card.sides) {
31825
+ const sideQualifier = getNormalizedQualifier(side.qualifier);
31826
+ if (sideQualifier) return sideQualifier;
31827
+ for (const variant of side.variants) {
31828
+ const variantQualifier = getNormalizedQualifier(variant.qualifier);
31829
+ if (variantQualifier) return variantQualifier;
31830
+ }
31831
+ }
31832
+ return void 0;
31833
+ };
31354
31834
  for (let cardIdx = 0; cardIdx < cardSet.cards.length; cardIdx++) {
31355
31835
  const card = cardSet.cards[cardIdx];
31356
- isHeading = false;
31357
- rowValues = [];
31836
+ const qualifier = resolveSectionQualifier(card);
31837
+ const section = qualifier ? qualifier : isLegacyHeadingRow(card, cardIdx) ? "thead" : "tbody";
31838
+ const cells = [];
31358
31839
  for (const side of card.sides) {
31359
- for (const content of side.variants) {
31360
- const tags2 = content.data;
31361
- const { title, cardBody } = tags2;
31362
- const heading = title && title[1].titleAst;
31363
- if (cardIdx === 0 && heading != null) isHeading = true;
31364
- if (isHeading) {
31365
- columns.push(heading ?? []);
31366
- } else {
31367
- const value = cardBody?.body ?? [];
31368
- rowValues.push(value);
31369
- }
31840
+ for (const variant of side.variants) {
31841
+ cells.push(buildCell(variant, section));
31370
31842
  }
31371
31843
  }
31372
- if (!isHeading) {
31373
- rows.push(rowValues);
31374
- }
31844
+ sectionRows[section].push({
31845
+ cells
31846
+ });
31847
+ }
31848
+ const table = {};
31849
+ const hasHeadRows = sectionRows.thead.length > 0;
31850
+ const hasBodyRows = sectionRows.tbody.length > 0;
31851
+ const hasFootRows = sectionRows.tfoot.length > 0;
31852
+ if (hasHeadRows) {
31853
+ table.head = {
31854
+ rows: sectionRows.thead
31855
+ };
31856
+ }
31857
+ if (hasBodyRows) {
31858
+ table.body = {
31859
+ rows: sectionRows.tbody
31860
+ };
31861
+ }
31862
+ if (hasFootRows) {
31863
+ table.foot = {
31864
+ rows: sectionRows.tfoot
31865
+ };
31866
+ }
31867
+ if (!hasHeadRows && !hasBodyRows && !hasFootRows) {
31868
+ table.head = { rows: [] };
31869
+ table.body = { rows: [] };
31870
+ table.foot = { rows: [] };
31375
31871
  }
31376
- const table = {
31377
- columns,
31378
- data: rows
31379
- };
31380
31872
  return { table };
31381
31873
  }
31382
31874
  function parseBotActionResponses(_context, _bitType, cardSet) {
@@ -31527,11 +32019,11 @@ function extractHeadingCard(cardSet, valuesIsArray = false) {
31527
32019
  function defaultTagContentProcessor(context, _contentDepth, _tagsConfig, content, target) {
31528
32020
  const { type, value } = content;
31529
32021
  const { textFormat } = context;
31530
- const textParser9 = new TextParser();
32022
+ const textParser10 = new TextParser();
31531
32023
  const trimmedStringValue = stringUtils.trimmedString(value);
31532
32024
  switch (type) {
31533
32025
  case TypeKey.Instruction: {
31534
- target.instruction = textParser9.toAst(trimmedStringValue, {
32026
+ target.instruction = textParser10.toAst(trimmedStringValue, {
31535
32027
  format: textFormat,
31536
32028
  location: TextLocation.tag
31537
32029
  });
@@ -31542,7 +32034,7 @@ function defaultTagContentProcessor(context, _contentDepth, _tagsConfig, content
31542
32034
  break;
31543
32035
  }
31544
32036
  case TypeKey.Hint: {
31545
- target.hint = textParser9.toAst(trimmedStringValue, {
32037
+ target.hint = textParser10.toAst(trimmedStringValue, {
31546
32038
  format: textFormat,
31547
32039
  location: TextLocation.tag
31548
32040
  });
@@ -31572,7 +32064,7 @@ function defaultTagContentProcessor(context, _contentDepth, _tagsConfig, content
31572
32064
  format: TextFormat.bitmarkText,
31573
32065
  location: TextLocation.tag
31574
32066
  });
31575
- target.__sampleSolutionAst = textParser9.toAst(trimmedStringValue, {
32067
+ target.__sampleSolutionAst = textParser10.toAst(trimmedStringValue, {
31576
32068
  format: textFormat,
31577
32069
  location: TextLocation.tag
31578
32070
  });
@@ -31679,10 +32171,10 @@ function buildGap(context, _contentDepth, tagsConfig, content) {
31679
32171
  function itemLeadTagContentProcessor(context, _contentDepth, _tagsConfig, content, target) {
31680
32172
  const { textFormat } = context;
31681
32173
  const { value } = content;
31682
- const textParser9 = new TextParser();
32174
+ const textParser10 = new TextParser();
31683
32175
  const trimmedStringValue = stringUtils.trimmedString(value);
31684
32176
  if (!target.itemLead) target.itemLead = [];
31685
- const text = textParser9.toAst(trimmedStringValue, {
32177
+ const text = textParser10.toAst(trimmedStringValue, {
31686
32178
  format: textFormat,
31687
32179
  location: TextLocation.tag
31688
32180
  });
@@ -32433,7 +32925,9 @@ function buildTitles(_context, bitType, title) {
32433
32925
  }
32434
32926
 
32435
32927
  // src/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.ts
32436
- function trueFalseTagContentProcessor(_context, _contentDepth, content, target) {
32928
+ var textParser9 = new TextParser();
32929
+ function trueFalseTagContentProcessor(context, _contentDepth, content, target) {
32930
+ const { textFormat } = context;
32437
32931
  const { type, value } = content;
32438
32932
  const trueFalse = target.trueFalse;
32439
32933
  if (!trueFalse) return;
@@ -32444,8 +32938,13 @@ function trueFalseTagContentProcessor(_context, _contentDepth, content, target)
32444
32938
  location: TextLocation.tag
32445
32939
  }
32446
32940
  );
32941
+ const textAst = textParser9.toAst(trimmedStringValue ?? "", {
32942
+ format: textFormat,
32943
+ location: TextLocation.tag
32944
+ });
32447
32945
  trueFalse.push({
32448
32946
  text: trimmedStringValue,
32947
+ textAst,
32449
32948
  isCorrect: type === TypeKey.True,
32450
32949
  __isDefaultExample: false
32451
32950
  });
@@ -32549,7 +33048,7 @@ function buildStatementsChoicesResponses(context, tagsConfig, trueFalseContent)
32549
33048
  const { statement: _ignore, ...tagsRest } = tags2;
32550
33049
  const statement = {
32551
33050
  ...firstTrueFalse,
32552
- statement: firstTrueFalse.text,
33051
+ statement: firstTrueFalse.textAst ?? [],
32553
33052
  ...tagsRest
32554
33053
  };
32555
33054
  if (statement) statements.push(statement);
@@ -33334,36 +33833,39 @@ function peg$parse2(input, options) {
33334
33833
  const peg$c7 = "text";
33335
33834
  const peg$c8 = "~~~~";
33336
33835
  const peg$c9 = "footer";
33337
- const peg$c10 = "--";
33338
- const peg$c11 = "++";
33339
- const peg$c12 = "===";
33340
- const peg$c13 = "==";
33341
- const peg$c14 = "[@id";
33342
- const peg$c15 = "#";
33343
- const peg$c16 = "[\u25BC";
33344
- const peg$c17 = "[\u25BA";
33345
- const peg$c18 = "[@";
33346
- const peg$c19 = "[%";
33347
- const peg$c20 = "[!";
33348
- const peg$c21 = "[?";
33349
- const peg$c22 = "[+";
33350
- const peg$c23 = "[-";
33351
- const peg$c24 = "[$";
33352
- const peg$c25 = "[_";
33353
- const peg$c26 = "[=";
33354
- const peg$c27 = "[&";
33355
- const peg$c28 = "^]";
33356
- const peg$c29 = "id:";
33357
- const peg$c30 = ".";
33358
- const peg$c31 = "\n";
33359
- const peg$c32 = "\r\n";
33836
+ const peg$c10 = " ";
33837
+ const peg$c11 = "--";
33838
+ const peg$c12 = "++";
33839
+ const peg$c13 = "===";
33840
+ const peg$c14 = "==";
33841
+ const peg$c15 = "[@id";
33842
+ const peg$c16 = "#";
33843
+ const peg$c17 = "[\u25BC";
33844
+ const peg$c18 = "[\u25BA";
33845
+ const peg$c19 = "[@";
33846
+ const peg$c20 = "[%";
33847
+ const peg$c21 = "[!";
33848
+ const peg$c22 = "[?";
33849
+ const peg$c23 = "[+";
33850
+ const peg$c24 = "[-";
33851
+ const peg$c25 = "[$";
33852
+ const peg$c26 = "[_";
33853
+ const peg$c27 = "[=";
33854
+ const peg$c28 = "[&";
33855
+ const peg$c29 = "^]";
33856
+ const peg$c30 = "id:";
33857
+ const peg$c31 = ".";
33858
+ const peg$c32 = "\n";
33859
+ const peg$c33 = "\r\n";
33360
33860
  const peg$r0 = /^[^\]]/;
33361
- const peg$r1 = /^[^:\]]/;
33362
- const peg$r2 = /^[^&:\]]/;
33363
- const peg$r3 = /^[^\n\r\u2028\u2029]/;
33364
- const peg$r4 = /^[ \t]/;
33365
- const peg$r5 = /^[\r\u2028-\u2029]/;
33366
- const peg$r6 = /^[ \t\n\r\u2028\u2029]/;
33861
+ const peg$r1 = /^[a-z]/;
33862
+ const peg$r2 = /^[a-z0-9\-]/;
33863
+ const peg$r3 = /^[^:\]]/;
33864
+ const peg$r4 = /^[^&:\]]/;
33865
+ const peg$r5 = /^[^\n\r\u2028\u2029]/;
33866
+ const peg$r6 = /^[ \t]/;
33867
+ const peg$r7 = /^[\r\u2028-\u2029]/;
33868
+ const peg$r8 = /^[ \t\n\r\u2028\u2029]/;
33367
33869
  const peg$e0 = peg$literalExpectation("[.", false);
33368
33870
  const peg$e1 = peg$classExpectation(["]"], true, false, false);
33369
33871
  const peg$e2 = peg$literalExpectation("]", false);
@@ -33376,40 +33878,43 @@ function peg$parse2(input, options) {
33376
33878
  const peg$e9 = peg$literalExpectation("text", false);
33377
33879
  const peg$e10 = peg$literalExpectation("~~~~", false);
33378
33880
  const peg$e11 = peg$literalExpectation("footer", false);
33379
- const peg$e12 = peg$literalExpectation("--", false);
33380
- const peg$e13 = peg$literalExpectation("++", false);
33381
- const peg$e14 = peg$literalExpectation("===", false);
33382
- const peg$e15 = peg$literalExpectation("==", false);
33383
- const peg$e16 = peg$literalExpectation("[@id", false);
33384
- const peg$e17 = peg$literalExpectation("#", false);
33385
- const peg$e18 = peg$literalExpectation("[\u25BC", false);
33386
- const peg$e19 = peg$literalExpectation("[\u25BA", false);
33387
- const peg$e20 = peg$literalExpectation("[@", false);
33388
- const peg$e21 = peg$literalExpectation("[%", false);
33389
- const peg$e22 = peg$literalExpectation("[!", false);
33390
- const peg$e23 = peg$literalExpectation("[?", false);
33391
- const peg$e24 = peg$literalExpectation("[+", false);
33392
- const peg$e25 = peg$literalExpectation("[-", false);
33393
- const peg$e26 = peg$literalExpectation("[$", false);
33394
- const peg$e27 = peg$literalExpectation("[_", false);
33395
- const peg$e28 = peg$literalExpectation("[=", false);
33396
- const peg$e29 = peg$literalExpectation("[&", false);
33397
- const peg$e30 = peg$literalExpectation("^]", false);
33398
- const peg$e31 = peg$literalExpectation("id:", false);
33399
- const peg$e32 = peg$classExpectation([":", "]"], true, false, false);
33400
- const peg$e33 = peg$literalExpectation(".", false);
33401
- const peg$e34 = peg$classExpectation(["&", ":", "]"], true, false, false);
33402
- const peg$e35 = peg$otherExpectation("Character");
33403
- const peg$e36 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], true, false, false);
33404
- const peg$e37 = peg$otherExpectation("Blank Line");
33405
- const peg$e38 = peg$classExpectation([" ", " "], false, false, false);
33406
- const peg$e39 = peg$otherExpectation("Line Terminator");
33407
- const peg$e40 = peg$literalExpectation("\n", false);
33408
- const peg$e41 = peg$literalExpectation("\r\n", false);
33409
- const peg$e42 = peg$classExpectation(["\r", ["\u2028", "\u2029"]], false, false, false);
33410
- const peg$e43 = peg$otherExpectation("Whitespace, then Line Terminator");
33411
- const peg$e44 = peg$otherExpectation("whitespace");
33412
- const peg$e45 = peg$classExpectation([" ", " ", "\n", "\r", "\u2028", "\u2029"], false, false, false);
33881
+ const peg$e12 = peg$literalExpectation(" ", false);
33882
+ const peg$e13 = peg$literalExpectation("--", false);
33883
+ const peg$e14 = peg$literalExpectation("++", false);
33884
+ const peg$e15 = peg$literalExpectation("===", false);
33885
+ const peg$e16 = peg$literalExpectation("==", false);
33886
+ const peg$e17 = peg$classExpectation([["a", "z"]], false, false, false);
33887
+ const peg$e18 = peg$classExpectation([["a", "z"], ["0", "9"], "-"], false, false, false);
33888
+ const peg$e19 = peg$literalExpectation("[@id", false);
33889
+ const peg$e20 = peg$literalExpectation("#", false);
33890
+ const peg$e21 = peg$literalExpectation("[\u25BC", false);
33891
+ const peg$e22 = peg$literalExpectation("[\u25BA", false);
33892
+ const peg$e23 = peg$literalExpectation("[@", false);
33893
+ const peg$e24 = peg$literalExpectation("[%", false);
33894
+ const peg$e25 = peg$literalExpectation("[!", false);
33895
+ const peg$e26 = peg$literalExpectation("[?", false);
33896
+ const peg$e27 = peg$literalExpectation("[+", false);
33897
+ const peg$e28 = peg$literalExpectation("[-", false);
33898
+ const peg$e29 = peg$literalExpectation("[$", false);
33899
+ const peg$e30 = peg$literalExpectation("[_", false);
33900
+ const peg$e31 = peg$literalExpectation("[=", false);
33901
+ const peg$e32 = peg$literalExpectation("[&", false);
33902
+ const peg$e33 = peg$literalExpectation("^]", false);
33903
+ const peg$e34 = peg$literalExpectation("id:", false);
33904
+ const peg$e35 = peg$classExpectation([":", "]"], true, false, false);
33905
+ const peg$e36 = peg$literalExpectation(".", false);
33906
+ const peg$e37 = peg$classExpectation(["&", ":", "]"], true, false, false);
33907
+ const peg$e38 = peg$otherExpectation("Character");
33908
+ const peg$e39 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], true, false, false);
33909
+ const peg$e40 = peg$otherExpectation("Blank Line");
33910
+ const peg$e41 = peg$classExpectation([" ", " "], false, false, false);
33911
+ const peg$e42 = peg$otherExpectation("Line Terminator");
33912
+ const peg$e43 = peg$literalExpectation("\n", false);
33913
+ const peg$e44 = peg$literalExpectation("\r\n", false);
33914
+ const peg$e45 = peg$classExpectation(["\r", ["\u2028", "\u2029"]], false, false, false);
33915
+ const peg$e46 = peg$otherExpectation("Whitespace, then Line Terminator");
33916
+ const peg$e47 = peg$otherExpectation("whitespace");
33917
+ const peg$e48 = peg$classExpectation([" ", " ", "\n", "\r", "\u2028", "\u2029"], false, false, false);
33413
33918
  function peg$f0(firstBit, bits) {
33414
33919
  return processor.buildBits([firstBit, ...bits]);
33415
33920
  }
@@ -33482,91 +33987,112 @@ function peg$parse2(input, options) {
33482
33987
  function peg$f23(value) {
33483
33988
  return helper.handleCardLineOrDivider(value, 2);
33484
33989
  }
33485
- function peg$f24(value) {
33990
+ function peg$f24(qualifier) {
33991
+ return ["====", qualifier];
33992
+ }
33993
+ function peg$f25() {
33994
+ return ["===="];
33995
+ }
33996
+ function peg$f26(qualifier) {
33997
+ return ["--", qualifier];
33998
+ }
33999
+ function peg$f27() {
34000
+ return ["--"];
34001
+ }
34002
+ function peg$f28(qualifier) {
34003
+ return ["++", qualifier];
34004
+ }
34005
+ function peg$f29() {
34006
+ return ["++"];
34007
+ }
34008
+ function peg$f30(value) {
33486
34009
  return helper.handleCardLine(value);
33487
34010
  }
33488
- function peg$f25(value) {
34011
+ function peg$f31(value) {
33489
34012
  return helper.handleCardSet(value[1].flat());
33490
34013
  }
33491
- function peg$f26() {
34014
+ function peg$f32() {
33492
34015
  helper.handleCardSetStart();
33493
34016
  }
33494
- function peg$f27() {
34017
+ function peg$f33() {
33495
34018
  helper.handleCardSetEnd();
33496
34019
  }
33497
- function peg$f28(value) {
34020
+ function peg$f34(value) {
33498
34021
  return helper.handleCards(value);
33499
34022
  }
33500
- function peg$f29(value) {
34023
+ function peg$f35(value) {
33501
34024
  return helper.handleCardLineOrDivider(value, 1);
33502
34025
  }
33503
- function peg$f30(value) {
34026
+ function peg$f36(value) {
33504
34027
  return helper.handleCardLine(value);
33505
34028
  }
33506
- function peg$f31(value) {
34029
+ function peg$f37(value) {
34030
+ return value;
34031
+ }
34032
+ function peg$f38(value) {
33507
34033
  return helper.handleCardContent(value);
33508
34034
  }
33509
- function peg$f32(value) {
34035
+ function peg$f39(value) {
33510
34036
  return { type: TypeKey.CardChar, value };
33511
34037
  }
33512
- function peg$f33(value) {
34038
+ function peg$f40(value) {
33513
34039
  return helper.handlePropertyTag("id", value);
33514
34040
  }
33515
- function peg$f34(level, title) {
34041
+ function peg$f41(level, title) {
33516
34042
  return helper.handleTag(TypeKey.Title, { level, title });
33517
34043
  }
33518
- function peg$f35(value) {
34044
+ function peg$f42(value) {
33519
34045
  return helper.handleTag(TypeKey.Anchor, value);
33520
34046
  }
33521
- function peg$f36(value) {
34047
+ function peg$f43(value) {
33522
34048
  return helper.handleTag(TypeKey.Reference, value);
33523
34049
  }
33524
- function peg$f37(key, value) {
34050
+ function peg$f44(key, value) {
33525
34051
  return helper.handlePropertyTag(key, value);
33526
34052
  }
33527
- function peg$f38(value) {
34053
+ function peg$f45(value) {
33528
34054
  return helper.handleTag(TypeKey.ItemLead, value);
33529
34055
  }
33530
- function peg$f39(value) {
34056
+ function peg$f46(value) {
33531
34057
  return helper.handleTag(TypeKey.Instruction, value);
33532
34058
  }
33533
- function peg$f40(value) {
34059
+ function peg$f47(value) {
33534
34060
  return helper.handleTag(TypeKey.Hint, value);
33535
34061
  }
33536
- function peg$f41(value) {
34062
+ function peg$f48(value) {
33537
34063
  return helper.handleTag(TypeKey.True, value);
33538
34064
  }
33539
- function peg$f42(value) {
34065
+ function peg$f49(value) {
33540
34066
  return helper.handleTag(TypeKey.False, value);
33541
34067
  }
33542
- function peg$f43(value) {
34068
+ function peg$f50(value) {
33543
34069
  return helper.handleTag(TypeKey.SampleSolution, value);
33544
34070
  }
33545
- function peg$f44(value) {
34071
+ function peg$f51(value) {
33546
34072
  return helper.handleTag(TypeKey.Gap, value);
33547
34073
  }
33548
- function peg$f45(value) {
34074
+ function peg$f52(value) {
33549
34075
  return helper.handleTag(TypeKey.Mark, value);
33550
34076
  }
33551
- function peg$f46(key, value) {
34077
+ function peg$f53(key, value) {
33552
34078
  return helper.handleResourceTag(key, value);
33553
34079
  }
33554
- function peg$f47(value) {
34080
+ function peg$f54(value) {
33555
34081
  return value;
33556
34082
  }
33557
- function peg$f48(value) {
34083
+ function peg$f55(value) {
33558
34084
  return value ? value.trim() : "";
33559
34085
  }
33560
- function peg$f49(value) {
34086
+ function peg$f56(value) {
33561
34087
  return value.length;
33562
34088
  }
33563
- function peg$f50(value) {
34089
+ function peg$f57(value) {
33564
34090
  return value ? value.trim() : null;
33565
34091
  }
33566
- function peg$f51(value) {
34092
+ function peg$f58(value) {
33567
34093
  return value ? value.trim() : "";
33568
34094
  }
33569
- function peg$f52() {
34095
+ function peg$f59() {
33570
34096
  return true;
33571
34097
  }
33572
34098
  let peg$currPos = options.peg$currPos | 0;
@@ -34484,35 +35010,28 @@ function peg$parse2(input, options) {
34484
35010
  return s0;
34485
35011
  }
34486
35012
  function peg$parseCardSetStart_V2() {
34487
- let s0, s1, s2, s3, s4, s5;
35013
+ let s0, s1, s2, s3;
34488
35014
  s0 = peg$currPos;
34489
- s1 = peg$parseNL();
35015
+ s1 = [];
35016
+ s2 = peg$parseWNL();
35017
+ if (s2 === peg$FAILED) {
35018
+ s2 = peg$parseNL();
35019
+ }
35020
+ if (s2 !== peg$FAILED) {
35021
+ while (s2 !== peg$FAILED) {
35022
+ s1.push(s2);
35023
+ s2 = peg$parseWNL();
35024
+ if (s2 === peg$FAILED) {
35025
+ s2 = peg$parseNL();
35026
+ }
35027
+ }
35028
+ } else {
35029
+ s1 = peg$FAILED;
35030
+ }
34490
35031
  if (s1 !== peg$FAILED) {
34491
35032
  s2 = peg$currPos;
34492
35033
  peg$silentFails++;
34493
- s3 = peg$currPos;
34494
- if (input.substr(peg$currPos, 4) === peg$c6) {
34495
- s4 = peg$c6;
34496
- peg$currPos += 4;
34497
- } else {
34498
- s4 = peg$FAILED;
34499
- if (peg$silentFails === 0) {
34500
- peg$fail(peg$e8);
34501
- }
34502
- }
34503
- if (s4 !== peg$FAILED) {
34504
- s5 = peg$parseWNL();
34505
- if (s5 !== peg$FAILED) {
34506
- s4 = [s4, s5];
34507
- s3 = s4;
34508
- } else {
34509
- peg$currPos = s3;
34510
- s3 = peg$FAILED;
34511
- }
34512
- } else {
34513
- peg$currPos = s3;
34514
- s3 = peg$FAILED;
34515
- }
35034
+ s3 = peg$parseCardDividerLookahead_V2();
34516
35035
  peg$silentFails--;
34517
35036
  if (s3 !== peg$FAILED) {
34518
35037
  peg$currPos = s2;
@@ -34577,39 +35096,147 @@ function peg$parse2(input, options) {
34577
35096
  return s0;
34578
35097
  }
34579
35098
  function peg$parseCardLineOrDivider_V2() {
34580
- let s0, s1, s2, s3;
35099
+ let s0, s1;
35100
+ s0 = peg$currPos;
35101
+ s1 = peg$parseCardDividerToken_V2();
35102
+ if (s1 === peg$FAILED) {
35103
+ s1 = peg$parseCardSideDividerToken_V2();
35104
+ if (s1 === peg$FAILED) {
35105
+ s1 = peg$parseCardVariantDividerToken_V2();
35106
+ if (s1 === peg$FAILED) {
35107
+ s1 = peg$parseCardLine_V2();
35108
+ }
35109
+ }
35110
+ }
35111
+ if (s1 !== peg$FAILED) {
35112
+ peg$savedPos = s0;
35113
+ s1 = peg$f23(s1);
35114
+ }
35115
+ s0 = s1;
35116
+ return s0;
35117
+ }
35118
+ function peg$parseCardDividerToken_V2() {
35119
+ let s0, s1, s2, s3, s4, s5, s6;
34581
35120
  s0 = peg$currPos;
34582
- s1 = peg$currPos;
34583
35121
  if (input.substr(peg$currPos, 4) === peg$c6) {
34584
- s2 = peg$c6;
35122
+ s1 = peg$c6;
34585
35123
  peg$currPos += 4;
34586
35124
  } else {
34587
- s2 = peg$FAILED;
35125
+ s1 = peg$FAILED;
34588
35126
  if (peg$silentFails === 0) {
34589
35127
  peg$fail(peg$e8);
34590
35128
  }
34591
35129
  }
34592
- if (s2 !== peg$FAILED) {
34593
- s3 = peg$parseWNL();
34594
- if (s3 === peg$FAILED) {
34595
- s3 = peg$parseWEOL();
35130
+ if (s1 !== peg$FAILED) {
35131
+ if (input.charCodeAt(peg$currPos) === 32) {
35132
+ s2 = peg$c10;
35133
+ peg$currPos++;
35134
+ } else {
35135
+ s2 = peg$FAILED;
35136
+ if (peg$silentFails === 0) {
35137
+ peg$fail(peg$e12);
35138
+ }
34596
35139
  }
34597
- if (s3 !== peg$FAILED) {
34598
- s2 = [s2, s3];
34599
- s1 = s2;
35140
+ if (s2 !== peg$FAILED) {
35141
+ s3 = peg$parseQualifier();
35142
+ if (s3 !== peg$FAILED) {
35143
+ if (input.charCodeAt(peg$currPos) === 32) {
35144
+ s4 = peg$c10;
35145
+ peg$currPos++;
35146
+ } else {
35147
+ s4 = peg$FAILED;
35148
+ if (peg$silentFails === 0) {
35149
+ peg$fail(peg$e12);
35150
+ }
35151
+ }
35152
+ if (s4 !== peg$FAILED) {
35153
+ if (input.substr(peg$currPos, 4) === peg$c6) {
35154
+ s5 = peg$c6;
35155
+ peg$currPos += 4;
35156
+ } else {
35157
+ s5 = peg$FAILED;
35158
+ if (peg$silentFails === 0) {
35159
+ peg$fail(peg$e8);
35160
+ }
35161
+ }
35162
+ if (s5 !== peg$FAILED) {
35163
+ s6 = peg$parseWNL();
35164
+ if (s6 === peg$FAILED) {
35165
+ s6 = peg$parseWEOL();
35166
+ }
35167
+ if (s6 !== peg$FAILED) {
35168
+ peg$savedPos = s0;
35169
+ s0 = peg$f24(s3);
35170
+ } else {
35171
+ peg$currPos = s0;
35172
+ s0 = peg$FAILED;
35173
+ }
35174
+ } else {
35175
+ peg$currPos = s0;
35176
+ s0 = peg$FAILED;
35177
+ }
35178
+ } else {
35179
+ peg$currPos = s0;
35180
+ s0 = peg$FAILED;
35181
+ }
35182
+ } else {
35183
+ peg$currPos = s0;
35184
+ s0 = peg$FAILED;
35185
+ }
35186
+ } else {
35187
+ peg$currPos = s0;
35188
+ s0 = peg$FAILED;
35189
+ }
35190
+ } else {
35191
+ peg$currPos = s0;
35192
+ s0 = peg$FAILED;
35193
+ }
35194
+ if (s0 === peg$FAILED) {
35195
+ s0 = peg$currPos;
35196
+ if (input.substr(peg$currPos, 4) === peg$c6) {
35197
+ s1 = peg$c6;
35198
+ peg$currPos += 4;
34600
35199
  } else {
34601
- peg$currPos = s1;
34602
35200
  s1 = peg$FAILED;
35201
+ if (peg$silentFails === 0) {
35202
+ peg$fail(peg$e8);
35203
+ }
34603
35204
  }
35205
+ if (s1 !== peg$FAILED) {
35206
+ s2 = peg$parseWNL();
35207
+ if (s2 === peg$FAILED) {
35208
+ s2 = peg$parseWEOL();
35209
+ }
35210
+ if (s2 !== peg$FAILED) {
35211
+ peg$savedPos = s0;
35212
+ s0 = peg$f25();
35213
+ } else {
35214
+ peg$currPos = s0;
35215
+ s0 = peg$FAILED;
35216
+ }
35217
+ } else {
35218
+ peg$currPos = s0;
35219
+ s0 = peg$FAILED;
35220
+ }
35221
+ }
35222
+ return s0;
35223
+ }
35224
+ function peg$parseCardSideDividerToken_V2() {
35225
+ let s0, s1, s2, s3, s4, s5, s6;
35226
+ s0 = peg$currPos;
35227
+ if (input.substr(peg$currPos, 2) === peg$c11) {
35228
+ s1 = peg$c11;
35229
+ peg$currPos += 2;
34604
35230
  } else {
34605
- peg$currPos = s1;
34606
35231
  s1 = peg$FAILED;
35232
+ if (peg$silentFails === 0) {
35233
+ peg$fail(peg$e13);
35234
+ }
34607
35235
  }
34608
- if (s1 === peg$FAILED) {
34609
- s1 = peg$currPos;
34610
- if (input.substr(peg$currPos, 2) === peg$c10) {
35236
+ if (s1 !== peg$FAILED) {
35237
+ if (input.charCodeAt(peg$currPos) === 32) {
34611
35238
  s2 = peg$c10;
34612
- peg$currPos += 2;
35239
+ peg$currPos++;
34613
35240
  } else {
34614
35241
  s2 = peg$FAILED;
34615
35242
  if (peg$silentFails === 0) {
@@ -34617,58 +35244,277 @@ function peg$parse2(input, options) {
34617
35244
  }
34618
35245
  }
34619
35246
  if (s2 !== peg$FAILED) {
34620
- s3 = peg$parseWNL();
34621
- if (s3 === peg$FAILED) {
34622
- s3 = peg$parseWEOL();
34623
- }
35247
+ s3 = peg$parseQualifier();
34624
35248
  if (s3 !== peg$FAILED) {
34625
- s2 = [s2, s3];
34626
- s1 = s2;
35249
+ if (input.charCodeAt(peg$currPos) === 32) {
35250
+ s4 = peg$c10;
35251
+ peg$currPos++;
35252
+ } else {
35253
+ s4 = peg$FAILED;
35254
+ if (peg$silentFails === 0) {
35255
+ peg$fail(peg$e12);
35256
+ }
35257
+ }
35258
+ if (s4 !== peg$FAILED) {
35259
+ if (input.substr(peg$currPos, 2) === peg$c11) {
35260
+ s5 = peg$c11;
35261
+ peg$currPos += 2;
35262
+ } else {
35263
+ s5 = peg$FAILED;
35264
+ if (peg$silentFails === 0) {
35265
+ peg$fail(peg$e13);
35266
+ }
35267
+ }
35268
+ if (s5 !== peg$FAILED) {
35269
+ s6 = peg$parseWNL();
35270
+ if (s6 === peg$FAILED) {
35271
+ s6 = peg$parseWEOL();
35272
+ }
35273
+ if (s6 !== peg$FAILED) {
35274
+ peg$savedPos = s0;
35275
+ s0 = peg$f26(s3);
35276
+ } else {
35277
+ peg$currPos = s0;
35278
+ s0 = peg$FAILED;
35279
+ }
35280
+ } else {
35281
+ peg$currPos = s0;
35282
+ s0 = peg$FAILED;
35283
+ }
35284
+ } else {
35285
+ peg$currPos = s0;
35286
+ s0 = peg$FAILED;
35287
+ }
34627
35288
  } else {
34628
- peg$currPos = s1;
34629
- s1 = peg$FAILED;
35289
+ peg$currPos = s0;
35290
+ s0 = peg$FAILED;
34630
35291
  }
34631
35292
  } else {
34632
- peg$currPos = s1;
35293
+ peg$currPos = s0;
35294
+ s0 = peg$FAILED;
35295
+ }
35296
+ } else {
35297
+ peg$currPos = s0;
35298
+ s0 = peg$FAILED;
35299
+ }
35300
+ if (s0 === peg$FAILED) {
35301
+ s0 = peg$currPos;
35302
+ if (input.substr(peg$currPos, 2) === peg$c11) {
35303
+ s1 = peg$c11;
35304
+ peg$currPos += 2;
35305
+ } else {
34633
35306
  s1 = peg$FAILED;
35307
+ if (peg$silentFails === 0) {
35308
+ peg$fail(peg$e13);
35309
+ }
34634
35310
  }
34635
- if (s1 === peg$FAILED) {
34636
- s1 = peg$currPos;
34637
- if (input.substr(peg$currPos, 2) === peg$c11) {
34638
- s2 = peg$c11;
34639
- peg$currPos += 2;
34640
- } else {
34641
- s2 = peg$FAILED;
34642
- if (peg$silentFails === 0) {
34643
- peg$fail(peg$e13);
34644
- }
35311
+ if (s1 !== peg$FAILED) {
35312
+ s2 = peg$parseWNL();
35313
+ if (s2 === peg$FAILED) {
35314
+ s2 = peg$parseWEOL();
34645
35315
  }
34646
35316
  if (s2 !== peg$FAILED) {
34647
- s3 = peg$parseWNL();
34648
- if (s3 === peg$FAILED) {
34649
- s3 = peg$parseWEOL();
35317
+ peg$savedPos = s0;
35318
+ s0 = peg$f27();
35319
+ } else {
35320
+ peg$currPos = s0;
35321
+ s0 = peg$FAILED;
35322
+ }
35323
+ } else {
35324
+ peg$currPos = s0;
35325
+ s0 = peg$FAILED;
35326
+ }
35327
+ }
35328
+ return s0;
35329
+ }
35330
+ function peg$parseCardVariantDividerToken_V2() {
35331
+ let s0, s1, s2, s3, s4, s5, s6;
35332
+ s0 = peg$currPos;
35333
+ if (input.substr(peg$currPos, 2) === peg$c12) {
35334
+ s1 = peg$c12;
35335
+ peg$currPos += 2;
35336
+ } else {
35337
+ s1 = peg$FAILED;
35338
+ if (peg$silentFails === 0) {
35339
+ peg$fail(peg$e14);
35340
+ }
35341
+ }
35342
+ if (s1 !== peg$FAILED) {
35343
+ if (input.charCodeAt(peg$currPos) === 32) {
35344
+ s2 = peg$c10;
35345
+ peg$currPos++;
35346
+ } else {
35347
+ s2 = peg$FAILED;
35348
+ if (peg$silentFails === 0) {
35349
+ peg$fail(peg$e12);
35350
+ }
35351
+ }
35352
+ if (s2 !== peg$FAILED) {
35353
+ s3 = peg$parseQualifier();
35354
+ if (s3 !== peg$FAILED) {
35355
+ if (input.charCodeAt(peg$currPos) === 32) {
35356
+ s4 = peg$c10;
35357
+ peg$currPos++;
35358
+ } else {
35359
+ s4 = peg$FAILED;
35360
+ if (peg$silentFails === 0) {
35361
+ peg$fail(peg$e12);
35362
+ }
34650
35363
  }
34651
- if (s3 !== peg$FAILED) {
34652
- s2 = [s2, s3];
34653
- s1 = s2;
35364
+ if (s4 !== peg$FAILED) {
35365
+ if (input.substr(peg$currPos, 2) === peg$c12) {
35366
+ s5 = peg$c12;
35367
+ peg$currPos += 2;
35368
+ } else {
35369
+ s5 = peg$FAILED;
35370
+ if (peg$silentFails === 0) {
35371
+ peg$fail(peg$e14);
35372
+ }
35373
+ }
35374
+ if (s5 !== peg$FAILED) {
35375
+ s6 = peg$parseWNL();
35376
+ if (s6 === peg$FAILED) {
35377
+ s6 = peg$parseWEOL();
35378
+ }
35379
+ if (s6 !== peg$FAILED) {
35380
+ peg$savedPos = s0;
35381
+ s0 = peg$f28(s3);
35382
+ } else {
35383
+ peg$currPos = s0;
35384
+ s0 = peg$FAILED;
35385
+ }
35386
+ } else {
35387
+ peg$currPos = s0;
35388
+ s0 = peg$FAILED;
35389
+ }
34654
35390
  } else {
34655
- peg$currPos = s1;
34656
- s1 = peg$FAILED;
35391
+ peg$currPos = s0;
35392
+ s0 = peg$FAILED;
34657
35393
  }
34658
35394
  } else {
34659
- peg$currPos = s1;
34660
- s1 = peg$FAILED;
35395
+ peg$currPos = s0;
35396
+ s0 = peg$FAILED;
34661
35397
  }
34662
- if (s1 === peg$FAILED) {
34663
- s1 = peg$parseCardLine_V2();
35398
+ } else {
35399
+ peg$currPos = s0;
35400
+ s0 = peg$FAILED;
35401
+ }
35402
+ } else {
35403
+ peg$currPos = s0;
35404
+ s0 = peg$FAILED;
35405
+ }
35406
+ if (s0 === peg$FAILED) {
35407
+ s0 = peg$currPos;
35408
+ if (input.substr(peg$currPos, 2) === peg$c12) {
35409
+ s1 = peg$c12;
35410
+ peg$currPos += 2;
35411
+ } else {
35412
+ s1 = peg$FAILED;
35413
+ if (peg$silentFails === 0) {
35414
+ peg$fail(peg$e14);
34664
35415
  }
34665
35416
  }
35417
+ if (s1 !== peg$FAILED) {
35418
+ s2 = peg$parseWNL();
35419
+ if (s2 === peg$FAILED) {
35420
+ s2 = peg$parseWEOL();
35421
+ }
35422
+ if (s2 !== peg$FAILED) {
35423
+ peg$savedPos = s0;
35424
+ s0 = peg$f29();
35425
+ } else {
35426
+ peg$currPos = s0;
35427
+ s0 = peg$FAILED;
35428
+ }
35429
+ } else {
35430
+ peg$currPos = s0;
35431
+ s0 = peg$FAILED;
35432
+ }
35433
+ }
35434
+ return s0;
35435
+ }
35436
+ function peg$parseCardDividerLookahead_V2() {
35437
+ let s0, s1, s2, s3, s4, s5, s6;
35438
+ s0 = peg$currPos;
35439
+ if (input.substr(peg$currPos, 4) === peg$c6) {
35440
+ s1 = peg$c6;
35441
+ peg$currPos += 4;
35442
+ } else {
35443
+ s1 = peg$FAILED;
35444
+ if (peg$silentFails === 0) {
35445
+ peg$fail(peg$e8);
35446
+ }
34666
35447
  }
34667
35448
  if (s1 !== peg$FAILED) {
34668
- peg$savedPos = s0;
34669
- s1 = peg$f23(s1);
35449
+ s2 = peg$currPos;
35450
+ if (input.charCodeAt(peg$currPos) === 32) {
35451
+ s3 = peg$c10;
35452
+ peg$currPos++;
35453
+ } else {
35454
+ s3 = peg$FAILED;
35455
+ if (peg$silentFails === 0) {
35456
+ peg$fail(peg$e12);
35457
+ }
35458
+ }
35459
+ if (s3 !== peg$FAILED) {
35460
+ s4 = peg$parseQualifier();
35461
+ if (s4 !== peg$FAILED) {
35462
+ if (input.charCodeAt(peg$currPos) === 32) {
35463
+ s5 = peg$c10;
35464
+ peg$currPos++;
35465
+ } else {
35466
+ s5 = peg$FAILED;
35467
+ if (peg$silentFails === 0) {
35468
+ peg$fail(peg$e12);
35469
+ }
35470
+ }
35471
+ if (s5 !== peg$FAILED) {
35472
+ if (input.substr(peg$currPos, 4) === peg$c6) {
35473
+ s6 = peg$c6;
35474
+ peg$currPos += 4;
35475
+ } else {
35476
+ s6 = peg$FAILED;
35477
+ if (peg$silentFails === 0) {
35478
+ peg$fail(peg$e8);
35479
+ }
35480
+ }
35481
+ if (s6 !== peg$FAILED) {
35482
+ s3 = [s3, s4, s5, s6];
35483
+ s2 = s3;
35484
+ } else {
35485
+ peg$currPos = s2;
35486
+ s2 = peg$FAILED;
35487
+ }
35488
+ } else {
35489
+ peg$currPos = s2;
35490
+ s2 = peg$FAILED;
35491
+ }
35492
+ } else {
35493
+ peg$currPos = s2;
35494
+ s2 = peg$FAILED;
35495
+ }
35496
+ } else {
35497
+ peg$currPos = s2;
35498
+ s2 = peg$FAILED;
35499
+ }
35500
+ if (s2 === peg$FAILED) {
35501
+ s2 = null;
35502
+ }
35503
+ s3 = peg$parseWNL();
35504
+ if (s3 === peg$FAILED) {
35505
+ s3 = peg$parseWEOL();
35506
+ }
35507
+ if (s3 !== peg$FAILED) {
35508
+ s1 = [s1, s2, s3];
35509
+ s0 = s1;
35510
+ } else {
35511
+ peg$currPos = s0;
35512
+ s0 = peg$FAILED;
35513
+ }
35514
+ } else {
35515
+ peg$currPos = s0;
35516
+ s0 = peg$FAILED;
34670
35517
  }
34671
- s0 = s1;
34672
35518
  return s0;
34673
35519
  }
34674
35520
  function peg$parseCardLine_V2() {
@@ -34743,7 +35589,7 @@ function peg$parse2(input, options) {
34743
35589
  }
34744
35590
  if (s2 !== peg$FAILED) {
34745
35591
  peg$savedPos = s0;
34746
- s0 = peg$f24(s2);
35592
+ s0 = peg$f30(s2);
34747
35593
  } else {
34748
35594
  peg$currPos = s0;
34749
35595
  s0 = peg$FAILED;
@@ -34780,7 +35626,7 @@ function peg$parse2(input, options) {
34780
35626
  }
34781
35627
  if (s1 !== peg$FAILED) {
34782
35628
  peg$savedPos = s0;
34783
- s1 = peg$f25(s1);
35629
+ s1 = peg$f31(s1);
34784
35630
  }
34785
35631
  s0 = s1;
34786
35632
  return s0;
@@ -34788,18 +35634,33 @@ function peg$parse2(input, options) {
34788
35634
  function peg$parseCardSetStart_V1() {
34789
35635
  let s0, s1, s2, s3, s4, s5;
34790
35636
  s0 = peg$currPos;
34791
- s1 = peg$parseNL();
35637
+ s1 = [];
35638
+ s2 = peg$parseWNL();
35639
+ if (s2 === peg$FAILED) {
35640
+ s2 = peg$parseNL();
35641
+ }
35642
+ if (s2 !== peg$FAILED) {
35643
+ while (s2 !== peg$FAILED) {
35644
+ s1.push(s2);
35645
+ s2 = peg$parseWNL();
35646
+ if (s2 === peg$FAILED) {
35647
+ s2 = peg$parseNL();
35648
+ }
35649
+ }
35650
+ } else {
35651
+ s1 = peg$FAILED;
35652
+ }
34792
35653
  if (s1 !== peg$FAILED) {
34793
35654
  s2 = peg$currPos;
34794
35655
  peg$silentFails++;
34795
35656
  s3 = peg$currPos;
34796
- if (input.substr(peg$currPos, 3) === peg$c12) {
34797
- s4 = peg$c12;
35657
+ if (input.substr(peg$currPos, 3) === peg$c13) {
35658
+ s4 = peg$c13;
34798
35659
  peg$currPos += 3;
34799
35660
  } else {
34800
35661
  s4 = peg$FAILED;
34801
35662
  if (peg$silentFails === 0) {
34802
- peg$fail(peg$e14);
35663
+ peg$fail(peg$e15);
34803
35664
  }
34804
35665
  }
34805
35666
  if (s4 !== peg$FAILED) {
@@ -34824,7 +35685,7 @@ function peg$parse2(input, options) {
34824
35685
  }
34825
35686
  if (s2 !== peg$FAILED) {
34826
35687
  peg$savedPos = s0;
34827
- s0 = peg$f26();
35688
+ s0 = peg$f32();
34828
35689
  } else {
34829
35690
  peg$currPos = s0;
34830
35691
  s0 = peg$FAILED;
@@ -34862,7 +35723,7 @@ function peg$parse2(input, options) {
34862
35723
  }
34863
35724
  if (s1 !== peg$FAILED) {
34864
35725
  peg$savedPos = s0;
34865
- s1 = peg$f27();
35726
+ s1 = peg$f33();
34866
35727
  }
34867
35728
  s0 = s1;
34868
35729
  return s0;
@@ -34873,7 +35734,7 @@ function peg$parse2(input, options) {
34873
35734
  s1 = peg$parseCardLineOrDivider_V1();
34874
35735
  if (s1 !== peg$FAILED) {
34875
35736
  peg$savedPos = s0;
34876
- s1 = peg$f28(s1);
35737
+ s1 = peg$f34(s1);
34877
35738
  }
34878
35739
  s0 = s1;
34879
35740
  return s0;
@@ -34882,13 +35743,13 @@ function peg$parse2(input, options) {
34882
35743
  let s0, s1, s2, s3;
34883
35744
  s0 = peg$currPos;
34884
35745
  s1 = peg$currPos;
34885
- if (input.substr(peg$currPos, 3) === peg$c12) {
34886
- s2 = peg$c12;
35746
+ if (input.substr(peg$currPos, 3) === peg$c13) {
35747
+ s2 = peg$c13;
34887
35748
  peg$currPos += 3;
34888
35749
  } else {
34889
35750
  s2 = peg$FAILED;
34890
35751
  if (peg$silentFails === 0) {
34891
- peg$fail(peg$e14);
35752
+ peg$fail(peg$e15);
34892
35753
  }
34893
35754
  }
34894
35755
  if (s2 !== peg$FAILED) {
@@ -34909,13 +35770,13 @@ function peg$parse2(input, options) {
34909
35770
  }
34910
35771
  if (s1 === peg$FAILED) {
34911
35772
  s1 = peg$currPos;
34912
- if (input.substr(peg$currPos, 2) === peg$c13) {
34913
- s2 = peg$c13;
35773
+ if (input.substr(peg$currPos, 2) === peg$c14) {
35774
+ s2 = peg$c14;
34914
35775
  peg$currPos += 2;
34915
35776
  } else {
34916
35777
  s2 = peg$FAILED;
34917
35778
  if (peg$silentFails === 0) {
34918
- peg$fail(peg$e15);
35779
+ peg$fail(peg$e16);
34919
35780
  }
34920
35781
  }
34921
35782
  if (s2 !== peg$FAILED) {
@@ -34936,13 +35797,13 @@ function peg$parse2(input, options) {
34936
35797
  }
34937
35798
  if (s1 === peg$FAILED) {
34938
35799
  s1 = peg$currPos;
34939
- if (input.substr(peg$currPos, 2) === peg$c10) {
34940
- s2 = peg$c10;
35800
+ if (input.substr(peg$currPos, 2) === peg$c11) {
35801
+ s2 = peg$c11;
34941
35802
  peg$currPos += 2;
34942
35803
  } else {
34943
35804
  s2 = peg$FAILED;
34944
35805
  if (peg$silentFails === 0) {
34945
- peg$fail(peg$e12);
35806
+ peg$fail(peg$e13);
34946
35807
  }
34947
35808
  }
34948
35809
  if (s2 !== peg$FAILED) {
@@ -34968,7 +35829,7 @@ function peg$parse2(input, options) {
34968
35829
  }
34969
35830
  if (s1 !== peg$FAILED) {
34970
35831
  peg$savedPos = s0;
34971
- s1 = peg$f29(s1);
35832
+ s1 = peg$f35(s1);
34972
35833
  }
34973
35834
  s0 = s1;
34974
35835
  return s0;
@@ -35045,7 +35906,7 @@ function peg$parse2(input, options) {
35045
35906
  }
35046
35907
  if (s2 !== peg$FAILED) {
35047
35908
  peg$savedPos = s0;
35048
- s0 = peg$f30(s2);
35909
+ s0 = peg$f36(s2);
35049
35910
  } else {
35050
35911
  peg$currPos = s0;
35051
35912
  s0 = peg$FAILED;
@@ -35056,6 +35917,102 @@ function peg$parse2(input, options) {
35056
35917
  }
35057
35918
  return s0;
35058
35919
  }
35920
+ function peg$parseQualifier() {
35921
+ let s0, s1, s2;
35922
+ s0 = peg$currPos;
35923
+ s1 = peg$currPos;
35924
+ peg$silentFails++;
35925
+ if (input.substr(peg$currPos, 6) === peg$c9) {
35926
+ s2 = peg$c9;
35927
+ peg$currPos += 6;
35928
+ } else {
35929
+ s2 = peg$FAILED;
35930
+ if (peg$silentFails === 0) {
35931
+ peg$fail(peg$e11);
35932
+ }
35933
+ }
35934
+ if (s2 === peg$FAILED) {
35935
+ if (input.substr(peg$currPos, 4) === peg$c7) {
35936
+ s2 = peg$c7;
35937
+ peg$currPos += 4;
35938
+ } else {
35939
+ s2 = peg$FAILED;
35940
+ if (peg$silentFails === 0) {
35941
+ peg$fail(peg$e9);
35942
+ }
35943
+ }
35944
+ }
35945
+ peg$silentFails--;
35946
+ if (s2 === peg$FAILED) {
35947
+ s1 = void 0;
35948
+ } else {
35949
+ peg$currPos = s1;
35950
+ s1 = peg$FAILED;
35951
+ }
35952
+ if (s1 !== peg$FAILED) {
35953
+ s2 = peg$parseQualifierName();
35954
+ if (s2 !== peg$FAILED) {
35955
+ peg$savedPos = s0;
35956
+ s0 = peg$f37(s2);
35957
+ } else {
35958
+ peg$currPos = s0;
35959
+ s0 = peg$FAILED;
35960
+ }
35961
+ } else {
35962
+ peg$currPos = s0;
35963
+ s0 = peg$FAILED;
35964
+ }
35965
+ return s0;
35966
+ }
35967
+ function peg$parseQualifierName() {
35968
+ let s0, s1, s2, s3, s4;
35969
+ s0 = peg$currPos;
35970
+ s1 = peg$currPos;
35971
+ s2 = input.charAt(peg$currPos);
35972
+ if (peg$r1.test(s2)) {
35973
+ peg$currPos++;
35974
+ } else {
35975
+ s2 = peg$FAILED;
35976
+ if (peg$silentFails === 0) {
35977
+ peg$fail(peg$e17);
35978
+ }
35979
+ }
35980
+ if (s2 !== peg$FAILED) {
35981
+ s3 = [];
35982
+ s4 = input.charAt(peg$currPos);
35983
+ if (peg$r2.test(s4)) {
35984
+ peg$currPos++;
35985
+ } else {
35986
+ s4 = peg$FAILED;
35987
+ if (peg$silentFails === 0) {
35988
+ peg$fail(peg$e18);
35989
+ }
35990
+ }
35991
+ while (s4 !== peg$FAILED) {
35992
+ s3.push(s4);
35993
+ s4 = input.charAt(peg$currPos);
35994
+ if (peg$r2.test(s4)) {
35995
+ peg$currPos++;
35996
+ } else {
35997
+ s4 = peg$FAILED;
35998
+ if (peg$silentFails === 0) {
35999
+ peg$fail(peg$e18);
36000
+ }
36001
+ }
36002
+ }
36003
+ s2 = [s2, s3];
36004
+ s1 = s2;
36005
+ } else {
36006
+ peg$currPos = s1;
36007
+ s1 = peg$FAILED;
36008
+ }
36009
+ if (s1 !== peg$FAILED) {
36010
+ s0 = input.substring(s0, peg$currPos);
36011
+ } else {
36012
+ s0 = s1;
36013
+ }
36014
+ return s0;
36015
+ }
35059
36016
  function peg$parsecardContent() {
35060
36017
  let s0, s1, s2;
35061
36018
  s0 = peg$currPos;
@@ -35072,7 +36029,7 @@ function peg$parse2(input, options) {
35072
36029
  }
35073
36030
  }
35074
36031
  peg$savedPos = s0;
35075
- s1 = peg$f31(s1);
36032
+ s1 = peg$f38(s1);
35076
36033
  s0 = s1;
35077
36034
  return s0;
35078
36035
  }
@@ -35090,7 +36047,7 @@ function peg$parse2(input, options) {
35090
36047
  }
35091
36048
  if (s1 !== peg$FAILED) {
35092
36049
  peg$savedPos = s0;
35093
- s1 = peg$f32(s1);
36050
+ s1 = peg$f39(s1);
35094
36051
  }
35095
36052
  s0 = s1;
35096
36053
  return s0;
@@ -35098,13 +36055,13 @@ function peg$parse2(input, options) {
35098
36055
  function peg$parseIDTag() {
35099
36056
  let s0, s1, s2, s3;
35100
36057
  s0 = peg$currPos;
35101
- if (input.substr(peg$currPos, 4) === peg$c14) {
35102
- s1 = peg$c14;
36058
+ if (input.substr(peg$currPos, 4) === peg$c15) {
36059
+ s1 = peg$c15;
35103
36060
  peg$currPos += 4;
35104
36061
  } else {
35105
36062
  s1 = peg$FAILED;
35106
36063
  if (peg$silentFails === 0) {
35107
- peg$fail(peg$e16);
36064
+ peg$fail(peg$e19);
35108
36065
  }
35109
36066
  }
35110
36067
  if (s1 !== peg$FAILED) {
@@ -35113,7 +36070,7 @@ function peg$parse2(input, options) {
35113
36070
  s3 = peg$parseTag_Close();
35114
36071
  if (s3 !== peg$FAILED) {
35115
36072
  peg$savedPos = s0;
35116
- s0 = peg$f33(s2);
36073
+ s0 = peg$f40(s2);
35117
36074
  } else {
35118
36075
  peg$currPos = s0;
35119
36076
  s0 = peg$FAILED;
@@ -35143,24 +36100,24 @@ function peg$parse2(input, options) {
35143
36100
  if (s1 !== peg$FAILED) {
35144
36101
  s2 = [];
35145
36102
  if (input.charCodeAt(peg$currPos) === 35) {
35146
- s3 = peg$c15;
36103
+ s3 = peg$c16;
35147
36104
  peg$currPos++;
35148
36105
  } else {
35149
36106
  s3 = peg$FAILED;
35150
36107
  if (peg$silentFails === 0) {
35151
- peg$fail(peg$e17);
36108
+ peg$fail(peg$e20);
35152
36109
  }
35153
36110
  }
35154
36111
  if (s3 !== peg$FAILED) {
35155
36112
  while (s3 !== peg$FAILED) {
35156
36113
  s2.push(s3);
35157
36114
  if (input.charCodeAt(peg$currPos) === 35) {
35158
- s3 = peg$c15;
36115
+ s3 = peg$c16;
35159
36116
  peg$currPos++;
35160
36117
  } else {
35161
36118
  s3 = peg$FAILED;
35162
36119
  if (peg$silentFails === 0) {
35163
- peg$fail(peg$e17);
36120
+ peg$fail(peg$e20);
35164
36121
  }
35165
36122
  }
35166
36123
  }
@@ -35172,7 +36129,7 @@ function peg$parse2(input, options) {
35172
36129
  s4 = peg$parseTag_CloseOrEOF();
35173
36130
  if (s4 !== peg$FAILED) {
35174
36131
  peg$savedPos = s0;
35175
- s0 = peg$f34(s2, s3);
36132
+ s0 = peg$f41(s2, s3);
35176
36133
  } else {
35177
36134
  peg$currPos = s0;
35178
36135
  s0 = peg$FAILED;
@@ -35190,13 +36147,13 @@ function peg$parse2(input, options) {
35190
36147
  function peg$parseAnchorTag() {
35191
36148
  let s0, s1, s2, s3;
35192
36149
  s0 = peg$currPos;
35193
- if (input.substr(peg$currPos, 2) === peg$c16) {
35194
- s1 = peg$c16;
36150
+ if (input.substr(peg$currPos, 2) === peg$c17) {
36151
+ s1 = peg$c17;
35195
36152
  peg$currPos += 2;
35196
36153
  } else {
35197
36154
  s1 = peg$FAILED;
35198
36155
  if (peg$silentFails === 0) {
35199
- peg$fail(peg$e18);
36156
+ peg$fail(peg$e21);
35200
36157
  }
35201
36158
  }
35202
36159
  if (s1 !== peg$FAILED) {
@@ -35204,7 +36161,7 @@ function peg$parse2(input, options) {
35204
36161
  s3 = peg$parseTag_CloseOrEOF();
35205
36162
  if (s3 !== peg$FAILED) {
35206
36163
  peg$savedPos = s0;
35207
- s0 = peg$f35(s2);
36164
+ s0 = peg$f42(s2);
35208
36165
  } else {
35209
36166
  peg$currPos = s0;
35210
36167
  s0 = peg$FAILED;
@@ -35218,13 +36175,13 @@ function peg$parse2(input, options) {
35218
36175
  function peg$parseReferenceTag() {
35219
36176
  let s0, s1, s2, s3;
35220
36177
  s0 = peg$currPos;
35221
- if (input.substr(peg$currPos, 2) === peg$c17) {
35222
- s1 = peg$c17;
36178
+ if (input.substr(peg$currPos, 2) === peg$c18) {
36179
+ s1 = peg$c18;
35223
36180
  peg$currPos += 2;
35224
36181
  } else {
35225
36182
  s1 = peg$FAILED;
35226
36183
  if (peg$silentFails === 0) {
35227
- peg$fail(peg$e19);
36184
+ peg$fail(peg$e22);
35228
36185
  }
35229
36186
  }
35230
36187
  if (s1 !== peg$FAILED) {
@@ -35232,7 +36189,7 @@ function peg$parse2(input, options) {
35232
36189
  s3 = peg$parseTag_CloseOrEOF();
35233
36190
  if (s3 !== peg$FAILED) {
35234
36191
  peg$savedPos = s0;
35235
- s0 = peg$f36(s2);
36192
+ s0 = peg$f43(s2);
35236
36193
  } else {
35237
36194
  peg$currPos = s0;
35238
36195
  s0 = peg$FAILED;
@@ -35246,13 +36203,13 @@ function peg$parse2(input, options) {
35246
36203
  function peg$parsePropertyTag() {
35247
36204
  let s0, s1, s2, s3, s4;
35248
36205
  s0 = peg$currPos;
35249
- if (input.substr(peg$currPos, 2) === peg$c18) {
35250
- s1 = peg$c18;
36206
+ if (input.substr(peg$currPos, 2) === peg$c19) {
36207
+ s1 = peg$c19;
35251
36208
  peg$currPos += 2;
35252
36209
  } else {
35253
36210
  s1 = peg$FAILED;
35254
36211
  if (peg$silentFails === 0) {
35255
- peg$fail(peg$e20);
36212
+ peg$fail(peg$e23);
35256
36213
  }
35257
36214
  }
35258
36215
  if (s1 !== peg$FAILED) {
@@ -35263,7 +36220,7 @@ function peg$parse2(input, options) {
35263
36220
  s4 = peg$parseTag_CloseOrEOF();
35264
36221
  if (s4 !== peg$FAILED) {
35265
36222
  peg$savedPos = s0;
35266
- s0 = peg$f37(s2, s3);
36223
+ s0 = peg$f44(s2, s3);
35267
36224
  } else {
35268
36225
  peg$currPos = s0;
35269
36226
  s0 = peg$FAILED;
@@ -35285,13 +36242,13 @@ function peg$parse2(input, options) {
35285
36242
  function peg$parseItemLeadTag() {
35286
36243
  let s0, s1, s2, s3;
35287
36244
  s0 = peg$currPos;
35288
- if (input.substr(peg$currPos, 2) === peg$c19) {
35289
- s1 = peg$c19;
36245
+ if (input.substr(peg$currPos, 2) === peg$c20) {
36246
+ s1 = peg$c20;
35290
36247
  peg$currPos += 2;
35291
36248
  } else {
35292
36249
  s1 = peg$FAILED;
35293
36250
  if (peg$silentFails === 0) {
35294
- peg$fail(peg$e21);
36251
+ peg$fail(peg$e24);
35295
36252
  }
35296
36253
  }
35297
36254
  if (s1 !== peg$FAILED) {
@@ -35299,7 +36256,7 @@ function peg$parse2(input, options) {
35299
36256
  s3 = peg$parseTag_CloseOrEOF();
35300
36257
  if (s3 !== peg$FAILED) {
35301
36258
  peg$savedPos = s0;
35302
- s0 = peg$f38(s2);
36259
+ s0 = peg$f45(s2);
35303
36260
  } else {
35304
36261
  peg$currPos = s0;
35305
36262
  s0 = peg$FAILED;
@@ -35313,13 +36270,13 @@ function peg$parse2(input, options) {
35313
36270
  function peg$parseInstructionTag() {
35314
36271
  let s0, s1, s2, s3;
35315
36272
  s0 = peg$currPos;
35316
- if (input.substr(peg$currPos, 2) === peg$c20) {
35317
- s1 = peg$c20;
36273
+ if (input.substr(peg$currPos, 2) === peg$c21) {
36274
+ s1 = peg$c21;
35318
36275
  peg$currPos += 2;
35319
36276
  } else {
35320
36277
  s1 = peg$FAILED;
35321
36278
  if (peg$silentFails === 0) {
35322
- peg$fail(peg$e22);
36279
+ peg$fail(peg$e25);
35323
36280
  }
35324
36281
  }
35325
36282
  if (s1 !== peg$FAILED) {
@@ -35327,7 +36284,7 @@ function peg$parse2(input, options) {
35327
36284
  s3 = peg$parseTag_CloseOrEOF();
35328
36285
  if (s3 !== peg$FAILED) {
35329
36286
  peg$savedPos = s0;
35330
- s0 = peg$f39(s2);
36287
+ s0 = peg$f46(s2);
35331
36288
  } else {
35332
36289
  peg$currPos = s0;
35333
36290
  s0 = peg$FAILED;
@@ -35341,13 +36298,13 @@ function peg$parse2(input, options) {
35341
36298
  function peg$parseHintTag() {
35342
36299
  let s0, s1, s2, s3;
35343
36300
  s0 = peg$currPos;
35344
- if (input.substr(peg$currPos, 2) === peg$c21) {
35345
- s1 = peg$c21;
36301
+ if (input.substr(peg$currPos, 2) === peg$c22) {
36302
+ s1 = peg$c22;
35346
36303
  peg$currPos += 2;
35347
36304
  } else {
35348
36305
  s1 = peg$FAILED;
35349
36306
  if (peg$silentFails === 0) {
35350
- peg$fail(peg$e23);
36307
+ peg$fail(peg$e26);
35351
36308
  }
35352
36309
  }
35353
36310
  if (s1 !== peg$FAILED) {
@@ -35355,7 +36312,7 @@ function peg$parse2(input, options) {
35355
36312
  s3 = peg$parseTag_CloseOrEOF();
35356
36313
  if (s3 !== peg$FAILED) {
35357
36314
  peg$savedPos = s0;
35358
- s0 = peg$f40(s2);
36315
+ s0 = peg$f47(s2);
35359
36316
  } else {
35360
36317
  peg$currPos = s0;
35361
36318
  s0 = peg$FAILED;
@@ -35369,13 +36326,13 @@ function peg$parse2(input, options) {
35369
36326
  function peg$parseTrueTag() {
35370
36327
  let s0, s1, s2, s3;
35371
36328
  s0 = peg$currPos;
35372
- if (input.substr(peg$currPos, 2) === peg$c22) {
35373
- s1 = peg$c22;
36329
+ if (input.substr(peg$currPos, 2) === peg$c23) {
36330
+ s1 = peg$c23;
35374
36331
  peg$currPos += 2;
35375
36332
  } else {
35376
36333
  s1 = peg$FAILED;
35377
36334
  if (peg$silentFails === 0) {
35378
- peg$fail(peg$e24);
36335
+ peg$fail(peg$e27);
35379
36336
  }
35380
36337
  }
35381
36338
  if (s1 !== peg$FAILED) {
@@ -35383,7 +36340,7 @@ function peg$parse2(input, options) {
35383
36340
  s3 = peg$parseTag_CloseOrEOF();
35384
36341
  if (s3 !== peg$FAILED) {
35385
36342
  peg$savedPos = s0;
35386
- s0 = peg$f41(s2);
36343
+ s0 = peg$f48(s2);
35387
36344
  } else {
35388
36345
  peg$currPos = s0;
35389
36346
  s0 = peg$FAILED;
@@ -35397,13 +36354,13 @@ function peg$parse2(input, options) {
35397
36354
  function peg$parseFalseTag() {
35398
36355
  let s0, s1, s2, s3;
35399
36356
  s0 = peg$currPos;
35400
- if (input.substr(peg$currPos, 2) === peg$c23) {
35401
- s1 = peg$c23;
36357
+ if (input.substr(peg$currPos, 2) === peg$c24) {
36358
+ s1 = peg$c24;
35402
36359
  peg$currPos += 2;
35403
36360
  } else {
35404
36361
  s1 = peg$FAILED;
35405
36362
  if (peg$silentFails === 0) {
35406
- peg$fail(peg$e25);
36363
+ peg$fail(peg$e28);
35407
36364
  }
35408
36365
  }
35409
36366
  if (s1 !== peg$FAILED) {
@@ -35411,7 +36368,7 @@ function peg$parse2(input, options) {
35411
36368
  s3 = peg$parseTag_CloseOrEOF();
35412
36369
  if (s3 !== peg$FAILED) {
35413
36370
  peg$savedPos = s0;
35414
- s0 = peg$f42(s2);
36371
+ s0 = peg$f49(s2);
35415
36372
  } else {
35416
36373
  peg$currPos = s0;
35417
36374
  s0 = peg$FAILED;
@@ -35425,13 +36382,13 @@ function peg$parse2(input, options) {
35425
36382
  function peg$parseSampleSolutionTag() {
35426
36383
  let s0, s1, s2, s3;
35427
36384
  s0 = peg$currPos;
35428
- if (input.substr(peg$currPos, 2) === peg$c24) {
35429
- s1 = peg$c24;
36385
+ if (input.substr(peg$currPos, 2) === peg$c25) {
36386
+ s1 = peg$c25;
35430
36387
  peg$currPos += 2;
35431
36388
  } else {
35432
36389
  s1 = peg$FAILED;
35433
36390
  if (peg$silentFails === 0) {
35434
- peg$fail(peg$e26);
36391
+ peg$fail(peg$e29);
35435
36392
  }
35436
36393
  }
35437
36394
  if (s1 !== peg$FAILED) {
@@ -35439,7 +36396,7 @@ function peg$parse2(input, options) {
35439
36396
  s3 = peg$parseTag_CloseOrEOF();
35440
36397
  if (s3 !== peg$FAILED) {
35441
36398
  peg$savedPos = s0;
35442
- s0 = peg$f43(s2);
36399
+ s0 = peg$f50(s2);
35443
36400
  } else {
35444
36401
  peg$currPos = s0;
35445
36402
  s0 = peg$FAILED;
@@ -35453,13 +36410,13 @@ function peg$parse2(input, options) {
35453
36410
  function peg$parseGapTag() {
35454
36411
  let s0, s1, s2, s3;
35455
36412
  s0 = peg$currPos;
35456
- if (input.substr(peg$currPos, 2) === peg$c25) {
35457
- s1 = peg$c25;
36413
+ if (input.substr(peg$currPos, 2) === peg$c26) {
36414
+ s1 = peg$c26;
35458
36415
  peg$currPos += 2;
35459
36416
  } else {
35460
36417
  s1 = peg$FAILED;
35461
36418
  if (peg$silentFails === 0) {
35462
- peg$fail(peg$e27);
36419
+ peg$fail(peg$e30);
35463
36420
  }
35464
36421
  }
35465
36422
  if (s1 !== peg$FAILED) {
@@ -35467,7 +36424,7 @@ function peg$parse2(input, options) {
35467
36424
  s3 = peg$parseTag_CloseOrEOF();
35468
36425
  if (s3 !== peg$FAILED) {
35469
36426
  peg$savedPos = s0;
35470
- s0 = peg$f44(s2);
36427
+ s0 = peg$f51(s2);
35471
36428
  } else {
35472
36429
  peg$currPos = s0;
35473
36430
  s0 = peg$FAILED;
@@ -35481,13 +36438,13 @@ function peg$parse2(input, options) {
35481
36438
  function peg$parseMarkTag() {
35482
36439
  let s0, s1, s2, s3;
35483
36440
  s0 = peg$currPos;
35484
- if (input.substr(peg$currPos, 2) === peg$c26) {
35485
- s1 = peg$c26;
36441
+ if (input.substr(peg$currPos, 2) === peg$c27) {
36442
+ s1 = peg$c27;
35486
36443
  peg$currPos += 2;
35487
36444
  } else {
35488
36445
  s1 = peg$FAILED;
35489
36446
  if (peg$silentFails === 0) {
35490
- peg$fail(peg$e28);
36447
+ peg$fail(peg$e31);
35491
36448
  }
35492
36449
  }
35493
36450
  if (s1 !== peg$FAILED) {
@@ -35495,7 +36452,7 @@ function peg$parse2(input, options) {
35495
36452
  s3 = peg$parseTag_CloseOrEOF();
35496
36453
  if (s3 !== peg$FAILED) {
35497
36454
  peg$savedPos = s0;
35498
- s0 = peg$f45(s2);
36455
+ s0 = peg$f52(s2);
35499
36456
  } else {
35500
36457
  peg$currPos = s0;
35501
36458
  s0 = peg$FAILED;
@@ -35509,13 +36466,13 @@ function peg$parse2(input, options) {
35509
36466
  function peg$parseResourceTag() {
35510
36467
  let s0, s1, s2, s3, s4;
35511
36468
  s0 = peg$currPos;
35512
- if (input.substr(peg$currPos, 2) === peg$c27) {
35513
- s1 = peg$c27;
36469
+ if (input.substr(peg$currPos, 2) === peg$c28) {
36470
+ s1 = peg$c28;
35514
36471
  peg$currPos += 2;
35515
36472
  } else {
35516
36473
  s1 = peg$FAILED;
35517
36474
  if (peg$silentFails === 0) {
35518
- peg$fail(peg$e29);
36475
+ peg$fail(peg$e32);
35519
36476
  }
35520
36477
  }
35521
36478
  if (s1 !== peg$FAILED) {
@@ -35526,7 +36483,7 @@ function peg$parse2(input, options) {
35526
36483
  s4 = peg$parseTag_CloseOrEOF();
35527
36484
  if (s4 !== peg$FAILED) {
35528
36485
  peg$savedPos = s0;
35529
- s0 = peg$f46(s2, s3);
36486
+ s0 = peg$f53(s2, s3);
35530
36487
  } else {
35531
36488
  peg$currPos = s0;
35532
36489
  s0 = peg$FAILED;
@@ -35550,13 +36507,13 @@ function peg$parse2(input, options) {
35550
36507
  s0 = peg$currPos;
35551
36508
  s1 = peg$currPos;
35552
36509
  s2 = [];
35553
- if (input.substr(peg$currPos, 2) === peg$c28) {
35554
- s3 = peg$c28;
36510
+ if (input.substr(peg$currPos, 2) === peg$c29) {
36511
+ s3 = peg$c29;
35555
36512
  peg$currPos += 2;
35556
36513
  } else {
35557
36514
  s3 = peg$FAILED;
35558
36515
  if (peg$silentFails === 0) {
35559
- peg$fail(peg$e30);
36516
+ peg$fail(peg$e33);
35560
36517
  }
35561
36518
  }
35562
36519
  if (s3 === peg$FAILED) {
@@ -35572,13 +36529,13 @@ function peg$parse2(input, options) {
35572
36529
  }
35573
36530
  while (s3 !== peg$FAILED) {
35574
36531
  s2.push(s3);
35575
- if (input.substr(peg$currPos, 2) === peg$c28) {
35576
- s3 = peg$c28;
36532
+ if (input.substr(peg$currPos, 2) === peg$c29) {
36533
+ s3 = peg$c29;
35577
36534
  peg$currPos += 2;
35578
36535
  } else {
35579
36536
  s3 = peg$FAILED;
35580
36537
  if (peg$silentFails === 0) {
35581
- peg$fail(peg$e30);
36538
+ peg$fail(peg$e33);
35582
36539
  }
35583
36540
  }
35584
36541
  if (s3 === peg$FAILED) {
@@ -35595,7 +36552,7 @@ function peg$parse2(input, options) {
35595
36552
  }
35596
36553
  s1 = input.substring(s1, peg$currPos);
35597
36554
  peg$savedPos = s0;
35598
- s1 = peg$f47(s1);
36555
+ s1 = peg$f54(s1);
35599
36556
  s0 = s1;
35600
36557
  return s0;
35601
36558
  }
@@ -35604,13 +36561,13 @@ function peg$parse2(input, options) {
35604
36561
  s0 = peg$currPos;
35605
36562
  s1 = peg$currPos;
35606
36563
  peg$silentFails++;
35607
- if (input.substr(peg$currPos, 3) === peg$c29) {
35608
- s2 = peg$c29;
36564
+ if (input.substr(peg$currPos, 3) === peg$c30) {
36565
+ s2 = peg$c30;
35609
36566
  peg$currPos += 3;
35610
36567
  } else {
35611
36568
  s2 = peg$FAILED;
35612
36569
  if (peg$silentFails === 0) {
35613
- peg$fail(peg$e31);
36570
+ peg$fail(peg$e34);
35614
36571
  }
35615
36572
  }
35616
36573
  peg$silentFails--;
@@ -35624,29 +36581,29 @@ function peg$parse2(input, options) {
35624
36581
  s2 = peg$currPos;
35625
36582
  s3 = [];
35626
36583
  s4 = input.charAt(peg$currPos);
35627
- if (peg$r1.test(s4)) {
36584
+ if (peg$r3.test(s4)) {
35628
36585
  peg$currPos++;
35629
36586
  } else {
35630
36587
  s4 = peg$FAILED;
35631
36588
  if (peg$silentFails === 0) {
35632
- peg$fail(peg$e32);
36589
+ peg$fail(peg$e35);
35633
36590
  }
35634
36591
  }
35635
36592
  while (s4 !== peg$FAILED) {
35636
36593
  s3.push(s4);
35637
36594
  s4 = input.charAt(peg$currPos);
35638
- if (peg$r1.test(s4)) {
36595
+ if (peg$r3.test(s4)) {
35639
36596
  peg$currPos++;
35640
36597
  } else {
35641
36598
  s4 = peg$FAILED;
35642
36599
  if (peg$silentFails === 0) {
35643
- peg$fail(peg$e32);
36600
+ peg$fail(peg$e35);
35644
36601
  }
35645
36602
  }
35646
36603
  }
35647
36604
  s2 = input.substring(s2, peg$currPos);
35648
36605
  peg$savedPos = s0;
35649
- s0 = peg$f48(s2);
36606
+ s0 = peg$f55(s2);
35650
36607
  } else {
35651
36608
  peg$currPos = s0;
35652
36609
  s0 = peg$FAILED;
@@ -35701,24 +36658,24 @@ function peg$parse2(input, options) {
35701
36658
  s0 = peg$currPos;
35702
36659
  s1 = [];
35703
36660
  if (input.charCodeAt(peg$currPos) === 46) {
35704
- s2 = peg$c30;
36661
+ s2 = peg$c31;
35705
36662
  peg$currPos++;
35706
36663
  } else {
35707
36664
  s2 = peg$FAILED;
35708
36665
  if (peg$silentFails === 0) {
35709
- peg$fail(peg$e33);
36666
+ peg$fail(peg$e36);
35710
36667
  }
35711
36668
  }
35712
36669
  if (s2 !== peg$FAILED) {
35713
36670
  while (s2 !== peg$FAILED) {
35714
36671
  s1.push(s2);
35715
36672
  if (input.charCodeAt(peg$currPos) === 46) {
35716
- s2 = peg$c30;
36673
+ s2 = peg$c31;
35717
36674
  peg$currPos++;
35718
36675
  } else {
35719
36676
  s2 = peg$FAILED;
35720
36677
  if (peg$silentFails === 0) {
35721
- peg$fail(peg$e33);
36678
+ peg$fail(peg$e36);
35722
36679
  }
35723
36680
  }
35724
36681
  }
@@ -35727,7 +36684,7 @@ function peg$parse2(input, options) {
35727
36684
  }
35728
36685
  if (s1 !== peg$FAILED) {
35729
36686
  peg$savedPos = s0;
35730
- s1 = peg$f49(s1);
36687
+ s1 = peg$f56(s1);
35731
36688
  }
35732
36689
  s0 = s1;
35733
36690
  return s0;
@@ -35738,29 +36695,29 @@ function peg$parse2(input, options) {
35738
36695
  s1 = peg$currPos;
35739
36696
  s2 = [];
35740
36697
  s3 = input.charAt(peg$currPos);
35741
- if (peg$r2.test(s3)) {
36698
+ if (peg$r4.test(s3)) {
35742
36699
  peg$currPos++;
35743
36700
  } else {
35744
36701
  s3 = peg$FAILED;
35745
36702
  if (peg$silentFails === 0) {
35746
- peg$fail(peg$e34);
36703
+ peg$fail(peg$e37);
35747
36704
  }
35748
36705
  }
35749
36706
  while (s3 !== peg$FAILED) {
35750
36707
  s2.push(s3);
35751
36708
  s3 = input.charAt(peg$currPos);
35752
- if (peg$r2.test(s3)) {
36709
+ if (peg$r4.test(s3)) {
35753
36710
  peg$currPos++;
35754
36711
  } else {
35755
36712
  s3 = peg$FAILED;
35756
36713
  if (peg$silentFails === 0) {
35757
- peg$fail(peg$e34);
36714
+ peg$fail(peg$e37);
35758
36715
  }
35759
36716
  }
35760
36717
  }
35761
36718
  s1 = input.substring(s1, peg$currPos);
35762
36719
  peg$savedPos = s0;
35763
- s1 = peg$f50(s1);
36720
+ s1 = peg$f57(s1);
35764
36721
  s0 = s1;
35765
36722
  return s0;
35766
36723
  }
@@ -35779,7 +36736,7 @@ function peg$parse2(input, options) {
35779
36736
  if (s1 !== peg$FAILED) {
35780
36737
  s2 = peg$parseTag_Value();
35781
36738
  peg$savedPos = s0;
35782
- s0 = peg$f51(s2);
36739
+ s0 = peg$f58(s2);
35783
36740
  } else {
35784
36741
  peg$currPos = s0;
35785
36742
  s0 = peg$FAILED;
@@ -35788,7 +36745,7 @@ function peg$parse2(input, options) {
35788
36745
  s0 = peg$currPos;
35789
36746
  s1 = "";
35790
36747
  peg$savedPos = s0;
35791
- s1 = peg$f52();
36748
+ s1 = peg$f59();
35792
36749
  s0 = s1;
35793
36750
  }
35794
36751
  return s0;
@@ -35825,19 +36782,19 @@ function peg$parse2(input, options) {
35825
36782
  let s0, s1;
35826
36783
  peg$silentFails++;
35827
36784
  s0 = input.charAt(peg$currPos);
35828
- if (peg$r3.test(s0)) {
36785
+ if (peg$r5.test(s0)) {
35829
36786
  peg$currPos++;
35830
36787
  } else {
35831
36788
  s0 = peg$FAILED;
35832
36789
  if (peg$silentFails === 0) {
35833
- peg$fail(peg$e36);
36790
+ peg$fail(peg$e39);
35834
36791
  }
35835
36792
  }
35836
36793
  peg$silentFails--;
35837
36794
  if (s0 === peg$FAILED) {
35838
36795
  s1 = peg$FAILED;
35839
36796
  if (peg$silentFails === 0) {
35840
- peg$fail(peg$e35);
36797
+ peg$fail(peg$e38);
35841
36798
  }
35842
36799
  }
35843
36800
  return s0;
@@ -35860,23 +36817,23 @@ function peg$parse2(input, options) {
35860
36817
  s0 = peg$currPos;
35861
36818
  s1 = [];
35862
36819
  s2 = input.charAt(peg$currPos);
35863
- if (peg$r4.test(s2)) {
36820
+ if (peg$r6.test(s2)) {
35864
36821
  peg$currPos++;
35865
36822
  } else {
35866
36823
  s2 = peg$FAILED;
35867
36824
  if (peg$silentFails === 0) {
35868
- peg$fail(peg$e38);
36825
+ peg$fail(peg$e41);
35869
36826
  }
35870
36827
  }
35871
36828
  while (s2 !== peg$FAILED) {
35872
36829
  s1.push(s2);
35873
36830
  s2 = input.charAt(peg$currPos);
35874
- if (peg$r4.test(s2)) {
36831
+ if (peg$r6.test(s2)) {
35875
36832
  peg$currPos++;
35876
36833
  } else {
35877
36834
  s2 = peg$FAILED;
35878
36835
  if (peg$silentFails === 0) {
35879
- peg$fail(peg$e38);
36836
+ peg$fail(peg$e41);
35880
36837
  }
35881
36838
  }
35882
36839
  }
@@ -35892,7 +36849,7 @@ function peg$parse2(input, options) {
35892
36849
  if (s0 === peg$FAILED) {
35893
36850
  s1 = peg$FAILED;
35894
36851
  if (peg$silentFails === 0) {
35895
- peg$fail(peg$e37);
36852
+ peg$fail(peg$e40);
35896
36853
  }
35897
36854
  }
35898
36855
  return s0;
@@ -35901,32 +36858,32 @@ function peg$parse2(input, options) {
35901
36858
  let s0, s1;
35902
36859
  peg$silentFails++;
35903
36860
  if (input.charCodeAt(peg$currPos) === 10) {
35904
- s0 = peg$c31;
36861
+ s0 = peg$c32;
35905
36862
  peg$currPos++;
35906
36863
  } else {
35907
36864
  s0 = peg$FAILED;
35908
36865
  if (peg$silentFails === 0) {
35909
- peg$fail(peg$e40);
36866
+ peg$fail(peg$e43);
35910
36867
  }
35911
36868
  }
35912
36869
  if (s0 === peg$FAILED) {
35913
- if (input.substr(peg$currPos, 2) === peg$c32) {
35914
- s0 = peg$c32;
36870
+ if (input.substr(peg$currPos, 2) === peg$c33) {
36871
+ s0 = peg$c33;
35915
36872
  peg$currPos += 2;
35916
36873
  } else {
35917
36874
  s0 = peg$FAILED;
35918
36875
  if (peg$silentFails === 0) {
35919
- peg$fail(peg$e41);
36876
+ peg$fail(peg$e44);
35920
36877
  }
35921
36878
  }
35922
36879
  if (s0 === peg$FAILED) {
35923
36880
  s0 = input.charAt(peg$currPos);
35924
- if (peg$r5.test(s0)) {
36881
+ if (peg$r7.test(s0)) {
35925
36882
  peg$currPos++;
35926
36883
  } else {
35927
36884
  s0 = peg$FAILED;
35928
36885
  if (peg$silentFails === 0) {
35929
- peg$fail(peg$e42);
36886
+ peg$fail(peg$e45);
35930
36887
  }
35931
36888
  }
35932
36889
  }
@@ -35935,7 +36892,7 @@ function peg$parse2(input, options) {
35935
36892
  if (s0 === peg$FAILED) {
35936
36893
  s1 = peg$FAILED;
35937
36894
  if (peg$silentFails === 0) {
35938
- peg$fail(peg$e39);
36895
+ peg$fail(peg$e42);
35939
36896
  }
35940
36897
  }
35941
36898
  return s0;
@@ -35946,23 +36903,23 @@ function peg$parse2(input, options) {
35946
36903
  s0 = peg$currPos;
35947
36904
  s1 = [];
35948
36905
  s2 = input.charAt(peg$currPos);
35949
- if (peg$r4.test(s2)) {
36906
+ if (peg$r6.test(s2)) {
35950
36907
  peg$currPos++;
35951
36908
  } else {
35952
36909
  s2 = peg$FAILED;
35953
36910
  if (peg$silentFails === 0) {
35954
- peg$fail(peg$e38);
36911
+ peg$fail(peg$e41);
35955
36912
  }
35956
36913
  }
35957
36914
  while (s2 !== peg$FAILED) {
35958
36915
  s1.push(s2);
35959
36916
  s2 = input.charAt(peg$currPos);
35960
- if (peg$r4.test(s2)) {
36917
+ if (peg$r6.test(s2)) {
35961
36918
  peg$currPos++;
35962
36919
  } else {
35963
36920
  s2 = peg$FAILED;
35964
36921
  if (peg$silentFails === 0) {
35965
- peg$fail(peg$e38);
36922
+ peg$fail(peg$e41);
35966
36923
  }
35967
36924
  }
35968
36925
  }
@@ -35978,7 +36935,7 @@ function peg$parse2(input, options) {
35978
36935
  if (s0 === peg$FAILED) {
35979
36936
  s1 = peg$FAILED;
35980
36937
  if (peg$silentFails === 0) {
35981
- peg$fail(peg$e43);
36938
+ peg$fail(peg$e46);
35982
36939
  }
35983
36940
  }
35984
36941
  return s0;
@@ -35987,19 +36944,19 @@ function peg$parse2(input, options) {
35987
36944
  let s0, s1;
35988
36945
  peg$silentFails++;
35989
36946
  s0 = input.charAt(peg$currPos);
35990
- if (peg$r6.test(s0)) {
36947
+ if (peg$r8.test(s0)) {
35991
36948
  peg$currPos++;
35992
36949
  } else {
35993
36950
  s0 = peg$FAILED;
35994
36951
  if (peg$silentFails === 0) {
35995
- peg$fail(peg$e45);
36952
+ peg$fail(peg$e48);
35996
36953
  }
35997
36954
  }
35998
36955
  peg$silentFails--;
35999
36956
  if (s0 === peg$FAILED) {
36000
36957
  s1 = peg$FAILED;
36001
36958
  if (peg$silentFails === 0) {
36002
- peg$fail(peg$e44);
36959
+ peg$fail(peg$e47);
36003
36960
  }
36004
36961
  }
36005
36962
  return s0;