@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.
@@ -618,6 +618,7 @@ var BitType = (0, import_superenum.superenum)({
618
618
  surveyRatingOnce: "survey-rating-once",
619
619
  table: "table",
620
620
  tableAlt: "table-alt",
621
+ tableExtended: "table-extended",
621
622
  tableImage: "table-image",
622
623
  tableImageAlt: "table-image-alt",
623
624
  takePicture: "take-picture",
@@ -748,6 +749,7 @@ var CardSetConfigKey = (0, import_superenum7.superenum)({
748
749
  matchImagePairs: "matchImagePairs",
749
750
  matchMatrix: "matchMatrix",
750
751
  table: "table",
752
+ tableExtended: "tableExtended",
751
753
  pronunciationTable: "pronunciationTable",
752
754
  botActionResponses: "botActionResponses",
753
755
  exampleBitList: "exampleBitList",
@@ -1238,6 +1240,7 @@ var propertyKeys = {
1238
1240
  property_index: "@index",
1239
1241
  property_internalComment: "@internalComment",
1240
1242
  property_internalPrintPdf: "@internalPrintPdf",
1243
+ property_hasPrintRestriction: "@hasPrintRestriction",
1241
1244
  property_isCaseSensitive: "@isCaseSensitive",
1242
1245
  property_isInfoOnly: "@isInfoOnly",
1243
1246
  property_isPublic: "@isPublic",
@@ -1361,6 +1364,10 @@ var propertyKeys = {
1361
1364
  property_tableSearch: "@tableSearch",
1362
1365
  property_tableSort: "@tableSort",
1363
1366
  property_tableWhitespaceNoWrap: "@tableWhitespaceNoWrap",
1367
+ property_tableCellType: "@tableCellType",
1368
+ property_tableRowSpan: "@tableRowSpan",
1369
+ property_tableColSpan: "@tableColSpan",
1370
+ property_tableScope: "@tableScope",
1364
1371
  property_tag: "@tag",
1365
1372
  property_target: "@target",
1366
1373
  property_technicalTerm: "@technicalTerm",
@@ -2443,6 +2450,47 @@ var CARDSETS = {
2443
2450
  ]
2444
2451
  ]
2445
2452
  },
2453
+ [CardSetConfigKey.tableExtended]: {
2454
+ variants: [
2455
+ // Side 1
2456
+ [
2457
+ // Variant 1..N
2458
+ {
2459
+ tags: [
2460
+ {
2461
+ key: ConfigKey.group_standardItemLeadInstructionHint,
2462
+ description: "Standard tags for lead, instruction, and hint."
2463
+ },
2464
+ {
2465
+ key: ConfigKey.tag_title,
2466
+ description: "Title of the table."
2467
+ },
2468
+ {
2469
+ key: ConfigKey.property_tableCellType,
2470
+ description: "Table cell type (th/td).",
2471
+ format: TagFormat.plainText
2472
+ },
2473
+ {
2474
+ key: ConfigKey.property_tableRowSpan,
2475
+ description: "Number of rows the cell spans.",
2476
+ format: TagFormat.number
2477
+ },
2478
+ {
2479
+ key: ConfigKey.property_tableColSpan,
2480
+ description: "Number of columns the cell spans.",
2481
+ format: TagFormat.number
2482
+ },
2483
+ {
2484
+ key: ConfigKey.property_tableScope,
2485
+ description: "Scope attribute for header cells.",
2486
+ format: TagFormat.plainText
2487
+ }
2488
+ ],
2489
+ repeatCount: Count.infinity
2490
+ }
2491
+ ]
2492
+ ]
2493
+ },
2446
2494
  [CardSetConfigKey.pronunciationTable]: {
2447
2495
  variants: [
2448
2496
  // Side 1
@@ -3317,6 +3365,12 @@ var GROUPS = {
3317
3365
  key: ConfigKey.property_internalPrintPdf,
3318
3366
  description: "Url of the internal print PDF for the book",
3319
3367
  format: TagFormat.plainText
3368
+ },
3369
+ {
3370
+ key: ConfigKey.property_hasPrintRestriction,
3371
+ description: "If true, the book has print restrictions",
3372
+ format: TagFormat.boolean,
3373
+ defaultValue: "true"
3320
3374
  }
3321
3375
  ]
3322
3376
  },
@@ -8564,6 +8618,12 @@ var BITS = {
8564
8618
  ],
8565
8619
  cardSet: CardSetConfigKey.table
8566
8620
  },
8621
+ [BitType.tableExtended]: {
8622
+ since: "4.14.0",
8623
+ baseBitType: BitType.table,
8624
+ description: "Extended table bit, used to create complex tables with all HTML table features",
8625
+ cardSet: CardSetConfigKey.tableExtended
8626
+ },
8567
8627
  [BitType.tableAlt]: {
8568
8628
  since: "1.16.0",
8569
8629
  baseBitType: BitType.table,
@@ -9545,7 +9605,7 @@ var instance2 = new Config();
9545
9605
  // src/generated/package_info.ts
9546
9606
  var PACKAGE_INFO = {
9547
9607
  "name": "@gmb/bitmark-parser-generator",
9548
- "version": "4.13.0",
9608
+ "version": "4.14.0",
9549
9609
  "author": "Get More Brain Ltd",
9550
9610
  "license": "ISC",
9551
9611
  "description": "A bitmark parser and generator using Peggy.js"
@@ -10046,6 +10106,7 @@ var NodeType = (0, import_superenum20.superenum)({
10046
10106
  durationValue: "durationValue",
10047
10107
  elements: "elements",
10048
10108
  elementsValue: "elementsValue",
10109
+ elementsValueValue: "elementsValueValue",
10049
10110
  emphasis: "emphasis",
10050
10111
  end: "end",
10051
10112
  errors: "errors",
@@ -10074,6 +10135,7 @@ var NodeType = (0, import_superenum20.superenum)({
10074
10135
  focusY: "focusY",
10075
10136
  focusYValue: "focusYValue",
10076
10137
  footer: "footer",
10138
+ footerValue: "footerValue",
10077
10139
  footerText: "footerText",
10078
10140
  forKeys: "forKeys",
10079
10141
  format: "format",
@@ -10096,11 +10158,13 @@ var NodeType = (0, import_superenum20.superenum)({
10096
10158
  hasBookNavigationValue: "hasBookNavigationValue",
10097
10159
  hasMarkAsDone: "hasMarkAsDone",
10098
10160
  hasMarkAsDoneValue: "hasMarkAsDoneValue",
10161
+ head: "head",
10099
10162
  heading: "heading",
10100
10163
  height: "height",
10101
10164
  heightValue: "heightValue",
10102
10165
  highlight: "highlight",
10103
10166
  hint: "hint",
10167
+ hintValue: "hintValue",
10104
10168
  href: "href",
10105
10169
  icon: "icon",
10106
10170
  iconTag: "iconTag",
@@ -10122,10 +10186,13 @@ var NodeType = (0, import_superenum20.superenum)({
10122
10186
  ingredients: "ingredients",
10123
10187
  ingredientsValue: "ingredientsValue",
10124
10188
  instruction: "instruction",
10189
+ instructionValue: "instructionValue",
10125
10190
  internalComment: "internalComment",
10126
10191
  internalCommentValue: "internalCommentValue",
10127
10192
  internalPrintPdf: "internalPrintPdf",
10128
10193
  internalPrintPdfValue: "internalPrintPdfValue",
10194
+ hasPrintRestriction: "hasPrintRestriction",
10195
+ hasPrintRestrictionValue: "hasPrintRestrictionValue",
10129
10196
  isCaseSensitive: "isCaseSensitive",
10130
10197
  isCommented: "isCommented",
10131
10198
  isCorrect: "isCorrect",
@@ -10144,6 +10211,7 @@ var NodeType = (0, import_superenum20.superenum)({
10144
10211
  isTracked: "isTracked",
10145
10212
  isTrackedValue: "isTrackedValue",
10146
10213
  item: "item",
10214
+ itemValue: "itemValue",
10147
10215
  itemLead: "itemLead",
10148
10216
  jobTitle: "jobTitle",
10149
10217
  jobTitleValue: "jobTitleValue",
@@ -10170,6 +10238,7 @@ var NodeType = (0, import_superenum20.superenum)({
10170
10238
  layerRoleValue: "layerRoleValue",
10171
10239
  layerValue: "layerValue",
10172
10240
  lead: "lead",
10241
+ leadValue: "leadValue",
10173
10242
  level: "level",
10174
10243
  levelACTFL: "levelACTFL",
10175
10244
  levelACTFLValue: "levelACTFLValue",
@@ -10191,6 +10260,7 @@ var NodeType = (0, import_superenum20.superenum)({
10191
10260
  machineTranslatedValue: "machineTranslatedValue",
10192
10261
  mailingList: "mailingList",
10193
10262
  marginNumber: "marginNumber",
10263
+ marginNumberValue: "marginNumberValue",
10194
10264
  mark: "mark",
10195
10265
  markConfig: "markConfig",
10196
10266
  markConfigValue: "markConfigValue",
@@ -10219,6 +10289,7 @@ var NodeType = (0, import_superenum20.superenum)({
10219
10289
  pageNo: "pageNo",
10220
10290
  pageNoValue: "pageNoValue",
10221
10291
  pageNumber: "pageNumber",
10292
+ pageNumberValue: "pageNumberValue",
10222
10293
  pageValue: "pageValue",
10223
10294
  pairs: "pairs",
10224
10295
  pairsValue: "pairsValue",
@@ -10302,6 +10373,7 @@ var NodeType = (0, import_superenum20.superenum)({
10302
10373
  publisherValue: "publisherValue",
10303
10374
  quantity: "quantity",
10304
10375
  question: "question",
10376
+ questionValue: "questionValue",
10305
10377
  questions: "questions",
10306
10378
  questionsValue: "questionsValue",
10307
10379
  quizCountItems: "quizCountItems",
@@ -10354,6 +10426,10 @@ var NodeType = (0, import_superenum20.superenum)({
10354
10426
  revealSolutions: "revealSolutions",
10355
10427
  root: "root",
10356
10428
  // bit type (root)
10429
+ rows: "rows",
10430
+ rowsValue: "rowsValue",
10431
+ rubric: "rubric",
10432
+ rubricValue: "rubricValue",
10357
10433
  sampleSolution: "sampleSolution",
10358
10434
  sampleSolutionValue: "sampleSolutionValue",
10359
10435
  scormSource: "scormSource",
@@ -10959,6 +11035,103 @@ var DeprecatedTextFormat = (0, import_superenum23.superenum)({
10959
11035
  // bitmark-- text format, deprecated
10960
11036
  });
10961
11037
 
11038
+ // src/parser/json/TableUtils.ts
11039
+ function isTableBasicFormat(table) {
11040
+ const t = table;
11041
+ return !!(t.columns || t.data) && !(t.head || t.body || t.foot);
11042
+ }
11043
+ function isTableExtendedFormat(table) {
11044
+ const t = table;
11045
+ return !!(t.head || t.body || t.foot);
11046
+ }
11047
+ function isMixedTableFormat(table) {
11048
+ const t = table;
11049
+ const hasOld = !!(t.columns || t.data);
11050
+ const hasNew = !!(t.head || t.body || t.foot);
11051
+ return hasOld && hasNew;
11052
+ }
11053
+ function convertBasicToExtendedTableFormat(table) {
11054
+ const tableExtended = {};
11055
+ if (table.columns && table.columns.length > 0) {
11056
+ tableExtended.head = {
11057
+ rows: [
11058
+ {
11059
+ cells: table.columns.map((col) => ({
11060
+ content: col,
11061
+ title: true
11062
+ }))
11063
+ }
11064
+ ]
11065
+ };
11066
+ }
11067
+ if (table.data && table.data.length > 0) {
11068
+ tableExtended.body = {
11069
+ rows: table.data.map((row) => ({
11070
+ cells: row.map((cell) => ({
11071
+ content: cell
11072
+ }))
11073
+ }))
11074
+ };
11075
+ }
11076
+ return tableExtended;
11077
+ }
11078
+ function convertExtendedToBasicTableFormat(tableExtended) {
11079
+ const table = {};
11080
+ const extractRowCells = (row) => {
11081
+ if (!row || !Array.isArray(row.cells)) {
11082
+ return [];
11083
+ }
11084
+ return row.cells.map((cell) => cell?.content).filter((content) => content !== void 0);
11085
+ };
11086
+ const dataRows = [];
11087
+ const headRows = tableExtended.head?.rows ?? [];
11088
+ if (headRows.length > 0) {
11089
+ const primaryHeader = extractRowCells(headRows[0]);
11090
+ if (primaryHeader.length > 0) {
11091
+ table.columns = primaryHeader;
11092
+ }
11093
+ const remainingHeadRows = headRows.slice(1);
11094
+ remainingHeadRows.forEach((row) => {
11095
+ const cells = extractRowCells(row);
11096
+ if (cells.length > 0) {
11097
+ dataRows.push(cells);
11098
+ }
11099
+ });
11100
+ }
11101
+ const appendSectionRows = (section) => {
11102
+ if (!section || !Array.isArray(section.rows)) {
11103
+ return;
11104
+ }
11105
+ section.rows.forEach((row) => {
11106
+ const cells = extractRowCells(row);
11107
+ if (cells.length > 0) {
11108
+ dataRows.push(cells);
11109
+ }
11110
+ });
11111
+ };
11112
+ appendSectionRows(tableExtended.body);
11113
+ appendSectionRows(tableExtended.foot);
11114
+ if (dataRows.length > 0) {
11115
+ table.data = dataRows;
11116
+ }
11117
+ return table;
11118
+ }
11119
+ function normalizeTableFormat(bitType, table) {
11120
+ if (isMixedTableFormat(table)) {
11121
+ const t = table;
11122
+ delete t.columns;
11123
+ delete t.data;
11124
+ }
11125
+ const isExtended = instance2.isOfBitType(bitType, BitType.tableExtended);
11126
+ if (isExtended && isTableBasicFormat(table)) {
11127
+ return convertBasicToExtendedTableFormat(table);
11128
+ }
11129
+ if (!isExtended && isTableExtendedFormat(table)) {
11130
+ return convertExtendedToBasicTableFormat(table);
11131
+ }
11132
+ return table;
11133
+ }
11134
+
10962
11135
  // src/utils/ArrayUtils.ts
10963
11136
  var ArrayUtils = class {
10964
11137
  /**
@@ -22752,6 +22925,7 @@ var Builder = class extends BaseBuilder {
22752
22925
  * @returns
22753
22926
  */
22754
22927
  buildBit(data, options) {
22928
+ data = structuredClone(data);
22755
22929
  const bitType = data.bitType;
22756
22930
  const bitConfig = instance2.getBitConfig(bitType);
22757
22931
  const deprecatedTextFormat = DeprecatedTextFormat.fromValue(data.textFormat);
@@ -23420,6 +23594,12 @@ var Builder = class extends BaseBuilder {
23420
23594
  data.internalPrintPdf,
23421
23595
  options
23422
23596
  ),
23597
+ hasPrintRestriction: this.toAstProperty(
23598
+ bitType,
23599
+ ConfigKey.property_hasPrintRestriction,
23600
+ data.hasPrintRestriction,
23601
+ options
23602
+ ),
23423
23603
  tocResource: this.toAstProperty(
23424
23604
  bitType,
23425
23605
  ConfigKey.property_tocResource,
@@ -24189,21 +24369,53 @@ var Builder = class extends BaseBuilder {
24189
24369
  return node;
24190
24370
  }
24191
24371
  /**
24192
- * Build table node
24372
+ * Build table / table extended node
24193
24373
  *
24194
24374
  * @param data - data for the node
24195
24375
  * @returns
24196
24376
  */
24197
24377
  buildTable(context, dataIn) {
24198
24378
  if (!dataIn) return void 0;
24199
- const node = {
24200
- columns: (dataIn.columns || []).map(
24379
+ const node = normalizeTableFormat(context.bitType, dataIn);
24380
+ const nodeTable = node;
24381
+ const nodeTableExtended = node;
24382
+ if (Array.isArray(nodeTable.columns) && nodeTable.columns.length > 0) {
24383
+ nodeTable.columns = nodeTable.columns.map(
24201
24384
  (col) => this.handleJsonText(context, TextLocation2.tag, col)
24202
- ),
24203
- data: (dataIn.data || []).map(
24385
+ );
24386
+ }
24387
+ if (Array.isArray(nodeTable.data) && nodeTable.data.length > 0) {
24388
+ nodeTable.data = nodeTable.data.map(
24204
24389
  (row) => (row || []).map((cell) => this.handleJsonText(context, TextLocation2.tag, cell))
24205
- )
24390
+ );
24391
+ }
24392
+ const buildSection = (section) => {
24393
+ if (!section || !Array.isArray(section.rows)) return void 0;
24394
+ const rows = section.rows.map((row) => {
24395
+ const cells = (row.cells || []).map((cell) => {
24396
+ const tableCell = {
24397
+ content: this.handleJsonText(context, TextLocation2.tag, cell.content)
24398
+ };
24399
+ if (cell.title != null) tableCell.title = cell.title;
24400
+ if (cell.rowspan != null) tableCell.rowspan = cell.rowspan;
24401
+ if (cell.colspan != null) tableCell.colspan = cell.colspan;
24402
+ if (cell.scope) tableCell.scope = cell.scope;
24403
+ return tableCell;
24404
+ });
24405
+ return {
24406
+ cells
24407
+ };
24408
+ });
24409
+ return {
24410
+ rows
24411
+ };
24206
24412
  };
24413
+ const head = buildSection(nodeTableExtended.head);
24414
+ if (head && head.rows?.length > 0) nodeTableExtended.head = head;
24415
+ const body = buildSection(nodeTableExtended.body);
24416
+ if (body && body.rows?.length > 0) nodeTableExtended.body = body;
24417
+ const foot = buildSection(nodeTableExtended.foot);
24418
+ if (foot && foot.rows?.length > 0) nodeTableExtended.foot = foot;
24207
24419
  return node;
24208
24420
  }
24209
24421
  /**
@@ -24227,7 +24439,7 @@ var Builder = class extends BaseBuilder {
24227
24439
  if (!data) return void 0;
24228
24440
  const defaultExample = data.__sampleSolutionAst;
24229
24441
  const node = {
24230
- question: data.question ?? "",
24442
+ question: this.handleJsonText(context, TextLocation2.body, data.question),
24231
24443
  partialAnswer: data.partialAnswer ?? "",
24232
24444
  sampleSolution: data.sampleSolution ?? "",
24233
24445
  additionalSolutions: data.additionalSolutions ?? void 0,
@@ -24241,9 +24453,9 @@ var Builder = class extends BaseBuilder {
24241
24453
  };
24242
24454
  objectUtils.removeUnwantedProperties(node, {
24243
24455
  ignoreAllFalse: true,
24244
- ignoreEmptyArrays: ["item", "hint", "instruction"],
24456
+ ignoreEmptyArrays: ["question", "item", "hint", "instruction"],
24245
24457
  ignoreUndefined: ["example"],
24246
- ignoreEmptyString: ["question", "partialAnswer", "sampleSolution"]
24458
+ ignoreEmptyString: ["partialAnswer", "sampleSolution"]
24247
24459
  });
24248
24460
  return node;
24249
24461
  }
@@ -24781,7 +24993,7 @@ var Builder = class extends BaseBuilder {
24781
24993
  buildStatement(context, data) {
24782
24994
  if (!data) return void 0;
24783
24995
  const node = {
24784
- statement: data.statement ?? "",
24996
+ statement: this.handleJsonText(context, TextLocation2.tag, data.statement),
24785
24997
  isCorrect: !!data.isCorrect,
24786
24998
  item: this.handleJsonText(context, TextLocation2.tag, data.item),
24787
24999
  lead: this.handleJsonText(context, TextLocation2.tag, data.lead),
@@ -24791,7 +25003,7 @@ var Builder = class extends BaseBuilder {
24791
25003
  };
24792
25004
  objectUtils.removeUnwantedProperties(node, {
24793
25005
  ignoreAllFalse: true,
24794
- // ignoreAllEmptyArrays: true,
25006
+ ignoreEmptyArrays: ["statement"],
24795
25007
  ignoreUndefined: ["example"]
24796
25008
  });
24797
25009
  return node;
@@ -25003,7 +25215,7 @@ var Builder = class extends BaseBuilder {
25003
25215
  const node = {
25004
25216
  heading: this.buildHeading(context, data.heading),
25005
25217
  questions: this.buildQuestions(context, data.questions),
25006
- elements: data.elements,
25218
+ elements: this.handleJsonText(context, TextLocation2.body, data.elements),
25007
25219
  flashcards: this.buildFlashcards(context, data.flashcards),
25008
25220
  definitions: this.buildDefinitionList(context, data.definitions ?? data.legend),
25009
25221
  statement: this.buildStatement(context, data.statement),
@@ -25022,7 +25234,9 @@ var Builder = class extends BaseBuilder {
25022
25234
  // captionDefinitionList: this.buildCaptionDefinitionList(context, data.captionDefinitionList),
25023
25235
  cardBits: this.buildCardBits(context, data.cardBits)
25024
25236
  };
25025
- objectUtils.removeUnwantedProperties(node);
25237
+ objectUtils.removeUnwantedProperties(node, {
25238
+ ignoreEmptyObjects: ["table"]
25239
+ });
25026
25240
  return Object.keys(node).length > 0 ? node : void 0;
25027
25241
  }
25028
25242
  /**
@@ -25526,6 +25740,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
25526
25740
  __publicField(this, "hasCardSet", false);
25527
25741
  __publicField(this, "hasFooter", false);
25528
25742
  __publicField(this, "inTag", true);
25743
+ __publicField(this, "skipTableTraversal", false);
25529
25744
  this.enter = this.enter.bind(this);
25530
25745
  this.between = this.between.bind(this);
25531
25746
  this.exit = this.exit.bind(this);
@@ -26228,7 +26443,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26228
26443
  enter_elements(_node, _route) {
26229
26444
  }
26230
26445
  between_elements(_node, _left, _right, _route) {
26231
- this.writeCardSetVariantDivider();
26446
+ this.writeCardSetSideDivider();
26232
26447
  }
26233
26448
  // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards
26234
26449
  between_flashcards(_node, _left, _right, _route) {
@@ -26355,6 +26570,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26355
26570
  enter_matrix(_node, _route) {
26356
26571
  }
26357
26572
  between_matrix(_node, _left, _right, _route) {
26573
+ if (!this.isCardAllowed) return;
26358
26574
  this.writeCardSetCardDivider();
26359
26575
  }
26360
26576
  // bitmarkAst -> bits -> bitsValue -> cardNode -> pairs -> pairsValue -> values
@@ -26375,12 +26591,83 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26375
26591
  this.writeCardSetCardDivider();
26376
26592
  }
26377
26593
  // bitmarkAst -> bits -> bitsValue -> cardNode -> table
26594
+ enter_table(node, route) {
26595
+ const parent = this.getParentNode(route);
26596
+ if (parent?.key !== NodeType.cardNode) return true;
26597
+ const table = node.value;
26598
+ if (!table) return true;
26599
+ if (this.writeAdvancedTable(table)) {
26600
+ return false;
26601
+ }
26602
+ return true;
26603
+ }
26378
26604
  between_table(_node, _left, _right, route) {
26379
26605
  const parent = this.getParentNode(route);
26380
26606
  if (parent?.key !== NodeType.cardNode) return;
26381
26607
  if (!this.isCardAllowed) return;
26382
26608
  this.writeCardSetCardDivider();
26383
26609
  }
26610
+ writeAdvancedTable(table) {
26611
+ const normalized = normalizeTableFormat(BitType.tableExtended, table);
26612
+ const sections = [
26613
+ { key: "thead", qualifier: "thead", section: normalized.head },
26614
+ { key: "tbody", qualifier: void 0, section: normalized.body },
26615
+ { key: "tfoot", qualifier: "tfoot", section: normalized.foot }
26616
+ ];
26617
+ let rowCount = 0;
26618
+ for (const { key, qualifier, section } of sections) {
26619
+ const rows = section?.rows ?? [];
26620
+ if (rows.length === 0) {
26621
+ continue;
26622
+ }
26623
+ for (const row of rows) {
26624
+ this.writeCardSetCardDivider(qualifier);
26625
+ this.writeTableRow(row, key);
26626
+ rowCount++;
26627
+ }
26628
+ }
26629
+ return rowCount > 0;
26630
+ }
26631
+ writeTableRow(row, section) {
26632
+ const cells = row?.cells ?? [];
26633
+ if (cells.length === 0) return;
26634
+ for (let index = 0; index < cells.length; index++) {
26635
+ if (index > 0) {
26636
+ this.writeCardSetSideDivider();
26637
+ }
26638
+ this.writeNL();
26639
+ this.writeTableCell(cells[index], section);
26640
+ }
26641
+ }
26642
+ writeTableCell(cell, section) {
26643
+ const defaultCellType = section === "tbody" ? "td" : "th";
26644
+ const cellType = cell.title ? "th" : "td";
26645
+ if (cellType !== defaultCellType) {
26646
+ this.writeTableCellProperty("tableCellType", cellType);
26647
+ this.writeNL();
26648
+ }
26649
+ if (cell.rowspan && cell.rowspan > 1) {
26650
+ this.writeTableCellProperty("tableRowSpan", cell.rowspan);
26651
+ this.writeNL();
26652
+ }
26653
+ if (cell.colspan && cell.colspan > 1) {
26654
+ this.writeTableCellProperty("tableColSpan", cell.colspan);
26655
+ this.writeNL();
26656
+ }
26657
+ if (cell.scope) {
26658
+ this.writeTableCellProperty("tableScope", cell.scope);
26659
+ this.writeNL();
26660
+ }
26661
+ const content = cell.content ?? instance3.EMPTY_STRING;
26662
+ this.writeTextOrValue(content, this.textFormat, TextLocation2.body);
26663
+ }
26664
+ writeTableCellProperty(name, value) {
26665
+ this.writeOPA();
26666
+ this.writeTagKey(name);
26667
+ this.writeColon();
26668
+ this.writeTextOrValue(`${value}`, TextFormat2.plainText, TextLocation2.tag);
26669
+ this.writeCL();
26670
+ }
26384
26671
  // bitmarkAst -> bits -> bitsValue -> cardNode -> table -> data
26385
26672
  // bitmarkAst -> bits -> bitsValue -> cardNode -> pronunciationTable -> data
26386
26673
  between_data(_node, _left, _right, route) {
@@ -26902,8 +27189,8 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26902
27189
  } else {
26903
27190
  }
26904
27191
  }
26905
- // bitmarkAst -> bits -> bitsValue -> elements -> elementsValue
26906
- leaf_elementsValue(node, _route) {
27192
+ // bitmarkAst -> bits -> bitsValue -> cardNode -> elements -> elementsValue
27193
+ enter_elementsValue(node, _route) {
26907
27194
  if (node.value) {
26908
27195
  this.writeNL();
26909
27196
  this.writeTextOrValue(node.value, this.textFormat, TextLocation2.body);
@@ -26986,10 +27273,19 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26986
27273
  }
26987
27274
  }
26988
27275
  // bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> question
27276
+ // bitmarkAst -> bits -> bitsValue -> cardNode -> questions -> questionsValue -> question
27277
+ enter_question(node, route) {
27278
+ const parent = this.getParentNode(route);
27279
+ if (parent?.key !== NodeType.questionsValue) return;
27280
+ if (node.value) {
27281
+ this.writeNL();
27282
+ this.writeTextOrValue(node.value, this.textFormat, TextLocation2.body);
27283
+ }
27284
+ }
26989
27285
  // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards -> flashcardsValue -> question
26990
27286
  leaf_question(node, route) {
26991
27287
  const parent = this.getParentNode(route);
26992
- if (parent?.key !== NodeType.questionsValue && parent?.key !== NodeType.flashcardsValue) return;
27288
+ if (parent?.key !== NodeType.flashcardsValue) return;
26993
27289
  if (node.value) {
26994
27290
  this.writeNL();
26995
27291
  this.writeTextOrValue(node.value, this.textFormat, TextLocation2.body);
@@ -27465,12 +27761,12 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27465
27761
  } else {
27466
27762
  }
27467
27763
  }
27468
- writeCardSetCardDivider() {
27764
+ writeCardSetCardDivider(qualifier) {
27469
27765
  this.writeNL();
27470
- if (this.options.cardSetVersion === CardSetVersion.v1) {
27471
- this.write("===");
27472
- } else {
27473
- this.write("====");
27766
+ const divider = this.getCardDividerMarker();
27767
+ this.write(divider);
27768
+ if (qualifier) {
27769
+ this.appendCardDividerQualifier(qualifier);
27474
27770
  }
27475
27771
  }
27476
27772
  writeCardSetSideDivider() {
@@ -27489,6 +27785,20 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27489
27785
  this.write("++");
27490
27786
  }
27491
27787
  }
27788
+ getCardDividerMarker() {
27789
+ return this.options.cardSetVersion === CardSetVersion.v1 ? "===" : "====";
27790
+ }
27791
+ appendCardDividerQualifier(qualifier) {
27792
+ const marker = this.getCardDividerMarker();
27793
+ const normalizedQualifier = instance3.breakscape(qualifier, {
27794
+ format: TextFormat2.plainText,
27795
+ location: TextLocation2.tag
27796
+ });
27797
+ this.write(" ");
27798
+ this.write(normalizedQualifier);
27799
+ this.write(" ");
27800
+ this.write(marker);
27801
+ }
27492
27802
  writeNL_IfNotChain(route) {
27493
27803
  if (!this.isChain(route)) {
27494
27804
  this.writeNL();
@@ -27593,7 +27903,10 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27593
27903
  return !!writeFormat;
27594
27904
  }
27595
27905
  calculateIsCardAllowed() {
27596
- return this.isBodyBitmarkText && !this.isOfBitType1();
27906
+ return this.isBodyBitmarkText && !this.isOfBitType1() && !this.isTableBitType();
27907
+ }
27908
+ isTableBitType() {
27909
+ return this.isOfBitType([BitType.table]);
27597
27910
  }
27598
27911
  isOfBitType1() {
27599
27912
  return this.isOfBitType([
@@ -28110,7 +28423,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
28110
28423
  const parent = this.getParentNode(route);
28111
28424
  if (parent?.key !== NodeType.cardNode) return;
28112
28425
  if (statement) {
28113
- this.bitJson.statement = statement.statement ?? "";
28426
+ this.bitJson.statement = statement.statement ?? [];
28114
28427
  this.bitJson.isCorrect = statement.isCorrect ?? false;
28115
28428
  this.bitJson.example = statement.example;
28116
28429
  this.bitJson.isExample = statement.isExample;
@@ -28732,6 +29045,9 @@ var JsonGenerator = class extends AstWalkerGenerator {
28732
29045
  if (bitJson.footer == null) bitJson.footer = this.textDefault;
28733
29046
  if (bitJson.questions == null) bitJson.questions = [];
28734
29047
  }
29048
+ if (instance2.isOfBitType(bitType, BitType.sequence)) {
29049
+ if (bitJson.elements == null) bitJson.elements = [];
29050
+ }
28735
29051
  if (bitType === BitType.matchMatrix) {
28736
29052
  isTopLevelExample = true;
28737
29053
  }
@@ -28792,6 +29108,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
28792
29108
  }
28793
29109
  if (instance2.isOfBitType(bitType, BitType.book)) {
28794
29110
  if (bitJson.maxTocChapterLevel == null) bitJson.maxTocChapterLevel = -1;
29111
+ if (bitJson.hasPrintRestriction == null) bitJson.hasPrintRestriction = true;
28795
29112
  if (bitJson.hasMarkAsDone == null) bitJson.hasMarkAsDone = false;
28796
29113
  if (bitJson.processHandIn == null) bitJson.processHandIn = false;
28797
29114
  if (bitJson.isPublic == null) bitJson.isPublic = false;
@@ -29445,6 +29762,9 @@ var BitmarkPegParserHelper = class {
29445
29762
  __publicField(this, "cardIndex", 0);
29446
29763
  __publicField(this, "cardSideIndex", 0);
29447
29764
  __publicField(this, "cardVariantIndex", 0);
29765
+ __publicField(this, "currentCardQualifier");
29766
+ __publicField(this, "currentSideQualifier");
29767
+ __publicField(this, "currentVariantQualifier");
29448
29768
  __publicField(this, "parse");
29449
29769
  __publicField(this, "parserText");
29450
29770
  __publicField(this, "parserLocation");
@@ -29613,30 +29933,43 @@ var BitmarkPegParserHelper = class {
29613
29933
  cardIndex,
29614
29934
  cardSideIndex,
29615
29935
  cardVariantIndex: cardContentIndex,
29616
- value: value2
29936
+ value: value2,
29937
+ cardQualifier,
29938
+ cardSideQualifier,
29939
+ cardVariantQualifier
29617
29940
  } = cardData;
29618
29941
  let card = unparsedCardSet.cards[cardIndex];
29619
29942
  if (!card) {
29620
29943
  card = {
29621
- sides: []
29944
+ sides: [],
29945
+ qualifier: cardQualifier
29622
29946
  };
29623
29947
  unparsedCardSet.cards[cardIndex] = card;
29948
+ } else if (cardQualifier && !card.qualifier) {
29949
+ card.qualifier = cardQualifier;
29624
29950
  }
29625
29951
  let side = card.sides[cardSideIndex];
29626
29952
  if (!side) {
29627
29953
  side = {
29628
- variants: []
29954
+ variants: [],
29955
+ qualifier: cardSideQualifier
29629
29956
  };
29630
29957
  card.sides[cardSideIndex] = side;
29958
+ } else if (cardSideQualifier && !side.qualifier) {
29959
+ side.qualifier = cardSideQualifier;
29631
29960
  }
29632
29961
  const variant = side.variants[cardContentIndex];
29633
29962
  if (!variant) {
29634
29963
  side.variants[cardContentIndex] = {
29635
29964
  value: value2,
29636
- parser: parser3
29965
+ parser: parser3,
29966
+ qualifier: cardVariantQualifier
29637
29967
  };
29638
29968
  } else {
29639
29969
  side.variants[cardContentIndex].value += value2;
29970
+ if (cardVariantQualifier && !variant.qualifier) {
29971
+ variant.qualifier = cardVariantQualifier;
29972
+ }
29640
29973
  }
29641
29974
  }
29642
29975
  unparsedCardSet.cards = unparsedCardSet.cards.filter((card) => {
@@ -29649,12 +29982,14 @@ var BitmarkPegParserHelper = class {
29649
29982
  });
29650
29983
  for (const unparsedCard of unparsedCardSet.cards) {
29651
29984
  const card = {
29652
- sides: []
29985
+ sides: [],
29986
+ qualifier: unparsedCard.qualifier
29653
29987
  };
29654
29988
  cardSet.cards.push(card);
29655
29989
  for (const unparsedSide of unparsedCard.sides) {
29656
29990
  const side = {
29657
- variants: []
29991
+ variants: [],
29992
+ qualifier: unparsedSide.qualifier
29658
29993
  };
29659
29994
  card.sides.push(side);
29660
29995
  for (const unparsedContent of unparsedSide.variants) {
@@ -29679,7 +30014,8 @@ var BitmarkPegParserHelper = class {
29679
30014
  if (DEBUG_TRACE_CARD_PARSED) this.debugPrint("parsedCardContent", content);
29680
30015
  side.variants.push({
29681
30016
  parser: parser2,
29682
- content
30017
+ content,
30018
+ qualifier: unparsedContent.qualifier
29683
30019
  });
29684
30020
  }
29685
30021
  }
@@ -29699,12 +30035,18 @@ var BitmarkPegParserHelper = class {
29699
30035
  this.cardIndex = -1;
29700
30036
  this.cardSideIndex = 0;
29701
30037
  this.cardVariantIndex = 0;
30038
+ this.currentCardQualifier = void 0;
30039
+ this.currentSideQualifier = void 0;
30040
+ this.currentVariantQualifier = void 0;
29702
30041
  }
29703
30042
  handleCardSetEnd() {
29704
30043
  if (DEBUG_TRACE_CARD_SET_END) this.debugPrint("CardSetEnd");
29705
30044
  this.cardIndex = 0;
29706
30045
  this.cardSideIndex = 0;
29707
30046
  this.cardVariantIndex = 0;
30047
+ this.currentCardQualifier = void 0;
30048
+ this.currentSideQualifier = void 0;
30049
+ this.currentVariantQualifier = void 0;
29708
30050
  }
29709
30051
  handleCards(value) {
29710
30052
  return value;
@@ -29714,27 +30056,45 @@ var BitmarkPegParserHelper = class {
29714
30056
  let isCardDivider = false;
29715
30057
  let isSideDivider = false;
29716
30058
  let isVariantDivider = false;
30059
+ let qualifier;
29717
30060
  if (Array.isArray(value) && value.length === 2) {
29718
- value = value[0];
29719
- if (version === CardSetVersion.v1) {
29720
- isCardDivider = value === CARD_DIVIDER_V1;
29721
- isSideDivider = value === CARD_SIDE_DIVIDER_V1;
29722
- isVariantDivider = value === CARD_VARIANT_DIVIDER_V1;
30061
+ const [divider, maybeQualifier] = value;
30062
+ if (typeof divider === "string") {
30063
+ value = divider;
30064
+ if (typeof maybeQualifier === "string" && maybeQualifier.trim() === maybeQualifier && maybeQualifier.length > 0) {
30065
+ qualifier = maybeQualifier;
30066
+ }
29723
30067
  } else {
29724
- isCardDivider = value === CARD_DIVIDER_V2;
29725
- isSideDivider = value === CARD_SIDE_DIVIDER_V2;
29726
- isVariantDivider = value === CARD_VARIANT_DIVIDER_V2;
30068
+ value = divider;
29727
30069
  }
30070
+ } else if (Array.isArray(value) && value.length === 1) {
30071
+ const [divider] = value;
30072
+ value = divider;
30073
+ }
30074
+ if (version === CardSetVersion.v1) {
30075
+ isCardDivider = value === CARD_DIVIDER_V1;
30076
+ isSideDivider = value === CARD_SIDE_DIVIDER_V1;
30077
+ isVariantDivider = value === CARD_VARIANT_DIVIDER_V1;
30078
+ } else {
30079
+ isCardDivider = value === CARD_DIVIDER_V2;
30080
+ isSideDivider = value === CARD_SIDE_DIVIDER_V2;
30081
+ isVariantDivider = value === CARD_VARIANT_DIVIDER_V2;
29728
30082
  }
29729
30083
  if (isCardDivider) {
29730
30084
  this.cardIndex++;
29731
30085
  this.cardSideIndex = 0;
29732
30086
  this.cardVariantIndex = 0;
30087
+ this.currentCardQualifier = qualifier;
30088
+ this.currentSideQualifier = void 0;
30089
+ this.currentVariantQualifier = void 0;
29733
30090
  } else if (isSideDivider) {
29734
30091
  this.cardSideIndex++;
29735
30092
  this.cardVariantIndex = 0;
30093
+ this.currentSideQualifier = qualifier;
30094
+ this.currentVariantQualifier = void 0;
29736
30095
  } else if (isVariantDivider) {
29737
30096
  this.cardVariantIndex++;
30097
+ this.currentVariantQualifier = qualifier;
29738
30098
  }
29739
30099
  if (this.isType(value, TypeKey.Card)) return value;
29740
30100
  return {
@@ -29743,7 +30103,10 @@ var BitmarkPegParserHelper = class {
29743
30103
  cardIndex: this.cardIndex,
29744
30104
  cardSideIndex: this.cardSideIndex,
29745
30105
  cardVariantIndex: this.cardVariantIndex,
29746
- value: ""
30106
+ value: "",
30107
+ cardQualifier: this.currentCardQualifier,
30108
+ cardSideQualifier: this.currentSideQualifier,
30109
+ cardVariantQualifier: this.currentVariantQualifier
29747
30110
  },
29748
30111
  parser: {
29749
30112
  text: this.parserText(),
@@ -29764,7 +30127,10 @@ var BitmarkPegParserHelper = class {
29764
30127
  cardIndex: this.cardIndex,
29765
30128
  cardSideIndex: this.cardSideIndex,
29766
30129
  cardVariantIndex: this.cardVariantIndex,
29767
- value
30130
+ value,
30131
+ cardQualifier: this.currentCardQualifier,
30132
+ cardSideQualifier: this.currentSideQualifier,
30133
+ cardVariantQualifier: this.currentVariantQualifier
29768
30134
  },
29769
30135
  parser: {
29770
30136
  text: this.parserText(),
@@ -30847,6 +31213,7 @@ function buildCards(context, bitType, textFormat, parsedCardSet, statementV1, st
30847
31213
  result = parsePronunciationTable(context, bitType, processedCardSet);
30848
31214
  break;
30849
31215
  case CardSetConfigKey.table:
31216
+ case CardSetConfigKey.tableExtended:
30850
31217
  result = parseTable(context, bitType, processedCardSet);
30851
31218
  break;
30852
31219
  case CardSetConfigKey.botActionResponses:
@@ -30883,20 +31250,23 @@ function processCardSet(context, parsedCardSet) {
30883
31250
  for (const card of parsedCardSet.cards) {
30884
31251
  const processedCard = {
30885
31252
  no: cardNo++,
30886
- sides: []
31253
+ sides: [],
31254
+ qualifier: card.qualifier
30887
31255
  };
30888
31256
  processedCardSet.cards.push(processedCard);
30889
31257
  for (const side of card.sides) {
30890
31258
  const processedSide = {
30891
31259
  no: sideNo++,
30892
- variants: []
31260
+ variants: [],
31261
+ qualifier: side.qualifier
30893
31262
  };
30894
31263
  processedCard.sides.push(processedSide);
30895
31264
  for (const variant of side.variants) {
30896
31265
  const { parser: parser2, content } = variant;
30897
31266
  const processedVariant = {
30898
31267
  parser: parser2,
30899
- no: variantNo++
31268
+ no: variantNo++,
31269
+ qualifier: variant.qualifier
30900
31270
  };
30901
31271
  processedSide.variants.push(processedVariant);
30902
31272
  const tagsConfig = instance2.getTagsConfigForCardSet(bitType, sideNo, variantNo);
@@ -31010,7 +31380,8 @@ function parseElements(_context, _bitType, cardSet) {
31010
31380
  for (const side of card.sides) {
31011
31381
  for (const content of side.variants) {
31012
31382
  const tags2 = content.data;
31013
- elements.push(tags2.cardBodyStr ?? "");
31383
+ const element = tags2.cardBody?.body ?? tags2.cardBodyStr ?? instance3.EMPTY_STRING;
31384
+ elements.push(element);
31014
31385
  }
31015
31386
  }
31016
31387
  }
@@ -31027,7 +31398,7 @@ function parseStatements(_context, _bitType, cardSet, statementV1, statementsV1)
31027
31398
  if (Array.isArray(chainedStatements)) {
31028
31399
  for (const s of chainedStatements) {
31029
31400
  const statement = {
31030
- statement: s.statement ?? "",
31401
+ statement: s.statement ?? [],
31031
31402
  isCorrect: s.isCorrect,
31032
31403
  item: s.item,
31033
31404
  lead: s.lead,
@@ -31169,7 +31540,7 @@ function parseQuestions(_context, _bitType, cardSet) {
31169
31540
  for (const content of side.variants) {
31170
31541
  const tags2 = content.data;
31171
31542
  const q = {
31172
- question: tags2.cardBodyStr ?? "",
31543
+ question: tags2.cardBody?.body ?? tags2.cardBodyStr ?? instance3.EMPTY_STRING,
31173
31544
  ...tags2
31174
31545
  };
31175
31546
  if (q) questions.push(q);
@@ -31373,37 +31744,158 @@ function parsePronunciationTable(_context, _bitType, cardSet) {
31373
31744
  };
31374
31745
  return { pronunciationTable: table };
31375
31746
  }
31376
- function parseTable(_context, _bitType, cardSet) {
31377
- let isHeading = false;
31378
- const columns = [];
31379
- const rows = [];
31380
- let rowValues = [];
31747
+ function parseTable(context, _bitType, cardSet) {
31748
+ const sectionRows = {
31749
+ thead: [],
31750
+ tbody: [],
31751
+ tfoot: []
31752
+ };
31753
+ const getNormalizedQualifier = (rawQualifier) => {
31754
+ if (!rawQualifier) return void 0;
31755
+ const normalized = rawQualifier.trim().toLowerCase();
31756
+ if (normalized === "thead" || normalized === "tbody" || normalized === "tfoot") {
31757
+ return normalized;
31758
+ }
31759
+ context.addWarning(`Unknown table section qualifier '${rawQualifier}', defaulting to tbody.`);
31760
+ return void 0;
31761
+ };
31762
+ const isLegacyHeadingRow = (card, cardIndex) => {
31763
+ if (cardIndex !== 0) return false;
31764
+ return card.sides.some(
31765
+ (side) => side.variants.some((variant) => {
31766
+ const titles = variant.data.title;
31767
+ return Array.isArray(titles) && titles[1]?.titleAst;
31768
+ })
31769
+ );
31770
+ };
31771
+ const readExtraProperty = (extra, key) => {
31772
+ if (!extra) return void 0;
31773
+ const value = extra[key];
31774
+ return Array.isArray(value) ? value[0] : value;
31775
+ };
31776
+ const cleanupExtraProperties = (tags2, keys) => {
31777
+ const extra = tags2.extraProperties;
31778
+ if (!extra) return;
31779
+ for (const key of keys) {
31780
+ if (Object.prototype.hasOwnProperty.call(extra, key)) delete extra[key];
31781
+ }
31782
+ if (Object.keys(extra).length === 0) {
31783
+ delete tags2.extraProperties;
31784
+ }
31785
+ };
31786
+ const normalizeCellType = (raw, section) => {
31787
+ if (typeof raw === "string") {
31788
+ const normalized = raw.trim().toLowerCase();
31789
+ if (normalized === "th" || normalized === "td") {
31790
+ return normalized;
31791
+ }
31792
+ context.addWarning(
31793
+ `Invalid table cell type '${raw}', using default for section '${section}'.`
31794
+ );
31795
+ }
31796
+ return section === "tbody" ? "td" : "th";
31797
+ };
31798
+ const normalizeSpan = (raw, kind) => {
31799
+ if (raw == null) return 1;
31800
+ const numeric = instance6.asNumber(raw);
31801
+ if (numeric == null || !Number.isInteger(numeric) || numeric < 1) {
31802
+ context.addWarning(`Invalid table ${kind} '${raw}', defaulting to 1.`);
31803
+ return 1;
31804
+ }
31805
+ return numeric;
31806
+ };
31807
+ const normalizeScope = (raw) => {
31808
+ if (raw == null) return void 0;
31809
+ if (typeof raw !== "string") {
31810
+ context.addWarning(`Invalid table scope '${raw}', ignoring.`);
31811
+ return void 0;
31812
+ }
31813
+ const normalized = raw.trim().toLowerCase();
31814
+ switch (normalized) {
31815
+ case "row":
31816
+ case "col":
31817
+ case "rowgroup":
31818
+ case "colgroup":
31819
+ return normalized;
31820
+ default:
31821
+ context.addWarning(`Invalid table scope '${raw}', ignoring.`);
31822
+ return void 0;
31823
+ }
31824
+ };
31825
+ const buildCell = (variant, section) => {
31826
+ const tags2 = variant.data;
31827
+ const heading = tags2.title && tags2.title[1]?.titleAst;
31828
+ const bodyContent = tags2.cardBody?.body ?? tags2.cardBodyStr ?? instance3.EMPTY_STRING;
31829
+ const content = heading ?? bodyContent;
31830
+ const cellTypeRaw = tags2.tableCellType ?? readExtraProperty(tags2.extraProperties, "tableCellType");
31831
+ const rowSpanRaw = tags2.tableRowSpan ?? readExtraProperty(tags2.extraProperties, "tableRowSpan");
31832
+ const colSpanRaw = tags2.tableColSpan ?? readExtraProperty(tags2.extraProperties, "tableColSpan");
31833
+ const scopeRaw = tags2.tableScope ?? readExtraProperty(tags2.extraProperties, "tableScope");
31834
+ cleanupExtraProperties(tags2, ["tableCellType", "tableRowSpan", "tableColSpan", "tableScope"]);
31835
+ const cellType = normalizeCellType(cellTypeRaw, section);
31836
+ const rowspan = normalizeSpan(rowSpanRaw, "rowspan");
31837
+ const colspan = normalizeSpan(colSpanRaw, "colspan");
31838
+ const scope = normalizeScope(scopeRaw);
31839
+ const cell = {
31840
+ content
31841
+ };
31842
+ if (cellType === "th") cell.title = true;
31843
+ if (rowspan > 1) cell.rowspan = rowspan;
31844
+ if (colspan > 1) cell.colspan = colspan;
31845
+ if (scope) cell.scope = scope;
31846
+ return cell;
31847
+ };
31848
+ const resolveSectionQualifier = (card) => {
31849
+ const cardQualifier = getNormalizedQualifier(card.qualifier);
31850
+ if (cardQualifier) return cardQualifier;
31851
+ for (const side of card.sides) {
31852
+ const sideQualifier = getNormalizedQualifier(side.qualifier);
31853
+ if (sideQualifier) return sideQualifier;
31854
+ for (const variant of side.variants) {
31855
+ const variantQualifier = getNormalizedQualifier(variant.qualifier);
31856
+ if (variantQualifier) return variantQualifier;
31857
+ }
31858
+ }
31859
+ return void 0;
31860
+ };
31381
31861
  for (let cardIdx = 0; cardIdx < cardSet.cards.length; cardIdx++) {
31382
31862
  const card = cardSet.cards[cardIdx];
31383
- isHeading = false;
31384
- rowValues = [];
31863
+ const qualifier = resolveSectionQualifier(card);
31864
+ const section = qualifier ? qualifier : isLegacyHeadingRow(card, cardIdx) ? "thead" : "tbody";
31865
+ const cells = [];
31385
31866
  for (const side of card.sides) {
31386
- for (const content of side.variants) {
31387
- const tags2 = content.data;
31388
- const { title, cardBody } = tags2;
31389
- const heading = title && title[1].titleAst;
31390
- if (cardIdx === 0 && heading != null) isHeading = true;
31391
- if (isHeading) {
31392
- columns.push(heading ?? []);
31393
- } else {
31394
- const value = cardBody?.body ?? [];
31395
- rowValues.push(value);
31396
- }
31867
+ for (const variant of side.variants) {
31868
+ cells.push(buildCell(variant, section));
31397
31869
  }
31398
31870
  }
31399
- if (!isHeading) {
31400
- rows.push(rowValues);
31401
- }
31871
+ sectionRows[section].push({
31872
+ cells
31873
+ });
31874
+ }
31875
+ const table = {};
31876
+ const hasHeadRows = sectionRows.thead.length > 0;
31877
+ const hasBodyRows = sectionRows.tbody.length > 0;
31878
+ const hasFootRows = sectionRows.tfoot.length > 0;
31879
+ if (hasHeadRows) {
31880
+ table.head = {
31881
+ rows: sectionRows.thead
31882
+ };
31883
+ }
31884
+ if (hasBodyRows) {
31885
+ table.body = {
31886
+ rows: sectionRows.tbody
31887
+ };
31888
+ }
31889
+ if (hasFootRows) {
31890
+ table.foot = {
31891
+ rows: sectionRows.tfoot
31892
+ };
31893
+ }
31894
+ if (!hasHeadRows && !hasBodyRows && !hasFootRows) {
31895
+ table.head = { rows: [] };
31896
+ table.body = { rows: [] };
31897
+ table.foot = { rows: [] };
31402
31898
  }
31403
- const table = {
31404
- columns,
31405
- data: rows
31406
- };
31407
31899
  return { table };
31408
31900
  }
31409
31901
  function parseBotActionResponses(_context, _bitType, cardSet) {
@@ -31554,11 +32046,11 @@ function extractHeadingCard(cardSet, valuesIsArray = false) {
31554
32046
  function defaultTagContentProcessor(context, _contentDepth, _tagsConfig, content, target) {
31555
32047
  const { type, value } = content;
31556
32048
  const { textFormat } = context;
31557
- const textParser9 = new TextParser();
32049
+ const textParser10 = new TextParser();
31558
32050
  const trimmedStringValue = stringUtils.trimmedString(value);
31559
32051
  switch (type) {
31560
32052
  case TypeKey.Instruction: {
31561
- target.instruction = textParser9.toAst(trimmedStringValue, {
32053
+ target.instruction = textParser10.toAst(trimmedStringValue, {
31562
32054
  format: textFormat,
31563
32055
  location: TextLocation2.tag
31564
32056
  });
@@ -31569,7 +32061,7 @@ function defaultTagContentProcessor(context, _contentDepth, _tagsConfig, content
31569
32061
  break;
31570
32062
  }
31571
32063
  case TypeKey.Hint: {
31572
- target.hint = textParser9.toAst(trimmedStringValue, {
32064
+ target.hint = textParser10.toAst(trimmedStringValue, {
31573
32065
  format: textFormat,
31574
32066
  location: TextLocation2.tag
31575
32067
  });
@@ -31599,7 +32091,7 @@ function defaultTagContentProcessor(context, _contentDepth, _tagsConfig, content
31599
32091
  format: TextFormat2.bitmarkText,
31600
32092
  location: TextLocation2.tag
31601
32093
  });
31602
- target.__sampleSolutionAst = textParser9.toAst(trimmedStringValue, {
32094
+ target.__sampleSolutionAst = textParser10.toAst(trimmedStringValue, {
31603
32095
  format: textFormat,
31604
32096
  location: TextLocation2.tag
31605
32097
  });
@@ -31706,10 +32198,10 @@ function buildGap(context, _contentDepth, tagsConfig, content) {
31706
32198
  function itemLeadTagContentProcessor(context, _contentDepth, _tagsConfig, content, target) {
31707
32199
  const { textFormat } = context;
31708
32200
  const { value } = content;
31709
- const textParser9 = new TextParser();
32201
+ const textParser10 = new TextParser();
31710
32202
  const trimmedStringValue = stringUtils.trimmedString(value);
31711
32203
  if (!target.itemLead) target.itemLead = [];
31712
- const text = textParser9.toAst(trimmedStringValue, {
32204
+ const text = textParser10.toAst(trimmedStringValue, {
31713
32205
  format: textFormat,
31714
32206
  location: TextLocation2.tag
31715
32207
  });
@@ -32460,7 +32952,9 @@ function buildTitles(_context, bitType, title) {
32460
32952
  }
32461
32953
 
32462
32954
  // src/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.ts
32463
- function trueFalseTagContentProcessor(_context, _contentDepth, content, target) {
32955
+ var textParser9 = new TextParser();
32956
+ function trueFalseTagContentProcessor(context, _contentDepth, content, target) {
32957
+ const { textFormat } = context;
32464
32958
  const { type, value } = content;
32465
32959
  const trueFalse = target.trueFalse;
32466
32960
  if (!trueFalse) return;
@@ -32471,8 +32965,13 @@ function trueFalseTagContentProcessor(_context, _contentDepth, content, target)
32471
32965
  location: TextLocation2.tag
32472
32966
  }
32473
32967
  );
32968
+ const textAst = textParser9.toAst(trimmedStringValue ?? "", {
32969
+ format: textFormat,
32970
+ location: TextLocation2.tag
32971
+ });
32474
32972
  trueFalse.push({
32475
32973
  text: trimmedStringValue,
32974
+ textAst,
32476
32975
  isCorrect: type === TypeKey.True,
32477
32976
  __isDefaultExample: false
32478
32977
  });
@@ -32576,7 +33075,7 @@ function buildStatementsChoicesResponses(context, tagsConfig, trueFalseContent)
32576
33075
  const { statement: _ignore, ...tagsRest } = tags2;
32577
33076
  const statement = {
32578
33077
  ...firstTrueFalse,
32579
- statement: firstTrueFalse.text,
33078
+ statement: firstTrueFalse.textAst ?? [],
32580
33079
  ...tagsRest
32581
33080
  };
32582
33081
  if (statement) statements.push(statement);
@@ -33343,36 +33842,39 @@ function peg$parse2(input, options) {
33343
33842
  const peg$c7 = "text";
33344
33843
  const peg$c8 = "~~~~";
33345
33844
  const peg$c9 = "footer";
33346
- const peg$c10 = "--";
33347
- const peg$c11 = "++";
33348
- const peg$c12 = "===";
33349
- const peg$c13 = "==";
33350
- const peg$c14 = "[@id";
33351
- const peg$c15 = "#";
33352
- const peg$c16 = "[\u25BC";
33353
- const peg$c17 = "[\u25BA";
33354
- const peg$c18 = "[@";
33355
- const peg$c19 = "[%";
33356
- const peg$c20 = "[!";
33357
- const peg$c21 = "[?";
33358
- const peg$c22 = "[+";
33359
- const peg$c23 = "[-";
33360
- const peg$c24 = "[$";
33361
- const peg$c25 = "[_";
33362
- const peg$c26 = "[=";
33363
- const peg$c27 = "[&";
33364
- const peg$c28 = "^]";
33365
- const peg$c29 = "id:";
33366
- const peg$c30 = ".";
33367
- const peg$c31 = "\n";
33368
- const peg$c32 = "\r\n";
33845
+ const peg$c10 = " ";
33846
+ const peg$c11 = "--";
33847
+ const peg$c12 = "++";
33848
+ const peg$c13 = "===";
33849
+ const peg$c14 = "==";
33850
+ const peg$c15 = "[@id";
33851
+ const peg$c16 = "#";
33852
+ const peg$c17 = "[\u25BC";
33853
+ const peg$c18 = "[\u25BA";
33854
+ const peg$c19 = "[@";
33855
+ const peg$c20 = "[%";
33856
+ const peg$c21 = "[!";
33857
+ const peg$c22 = "[?";
33858
+ const peg$c23 = "[+";
33859
+ const peg$c24 = "[-";
33860
+ const peg$c25 = "[$";
33861
+ const peg$c26 = "[_";
33862
+ const peg$c27 = "[=";
33863
+ const peg$c28 = "[&";
33864
+ const peg$c29 = "^]";
33865
+ const peg$c30 = "id:";
33866
+ const peg$c31 = ".";
33867
+ const peg$c32 = "\n";
33868
+ const peg$c33 = "\r\n";
33369
33869
  const peg$r0 = /^[^\]]/;
33370
- const peg$r1 = /^[^:\]]/;
33371
- const peg$r2 = /^[^&:\]]/;
33372
- const peg$r3 = /^[^\n\r\u2028\u2029]/;
33373
- const peg$r4 = /^[ \t]/;
33374
- const peg$r5 = /^[\r\u2028-\u2029]/;
33375
- const peg$r6 = /^[ \t\n\r\u2028\u2029]/;
33870
+ const peg$r1 = /^[a-z]/;
33871
+ const peg$r2 = /^[a-z0-9\-]/;
33872
+ const peg$r3 = /^[^:\]]/;
33873
+ const peg$r4 = /^[^&:\]]/;
33874
+ const peg$r5 = /^[^\n\r\u2028\u2029]/;
33875
+ const peg$r6 = /^[ \t]/;
33876
+ const peg$r7 = /^[\r\u2028-\u2029]/;
33877
+ const peg$r8 = /^[ \t\n\r\u2028\u2029]/;
33376
33878
  const peg$e0 = peg$literalExpectation("[.", false);
33377
33879
  const peg$e1 = peg$classExpectation(["]"], true, false, false);
33378
33880
  const peg$e2 = peg$literalExpectation("]", false);
@@ -33385,40 +33887,43 @@ function peg$parse2(input, options) {
33385
33887
  const peg$e9 = peg$literalExpectation("text", false);
33386
33888
  const peg$e10 = peg$literalExpectation("~~~~", false);
33387
33889
  const peg$e11 = peg$literalExpectation("footer", false);
33388
- const peg$e12 = peg$literalExpectation("--", false);
33389
- const peg$e13 = peg$literalExpectation("++", false);
33390
- const peg$e14 = peg$literalExpectation("===", false);
33391
- const peg$e15 = peg$literalExpectation("==", false);
33392
- const peg$e16 = peg$literalExpectation("[@id", false);
33393
- const peg$e17 = peg$literalExpectation("#", false);
33394
- const peg$e18 = peg$literalExpectation("[\u25BC", false);
33395
- const peg$e19 = peg$literalExpectation("[\u25BA", false);
33396
- const peg$e20 = peg$literalExpectation("[@", false);
33397
- const peg$e21 = peg$literalExpectation("[%", false);
33398
- const peg$e22 = peg$literalExpectation("[!", false);
33399
- const peg$e23 = peg$literalExpectation("[?", false);
33400
- const peg$e24 = peg$literalExpectation("[+", false);
33401
- const peg$e25 = peg$literalExpectation("[-", false);
33402
- const peg$e26 = peg$literalExpectation("[$", false);
33403
- const peg$e27 = peg$literalExpectation("[_", false);
33404
- const peg$e28 = peg$literalExpectation("[=", false);
33405
- const peg$e29 = peg$literalExpectation("[&", false);
33406
- const peg$e30 = peg$literalExpectation("^]", false);
33407
- const peg$e31 = peg$literalExpectation("id:", false);
33408
- const peg$e32 = peg$classExpectation([":", "]"], true, false, false);
33409
- const peg$e33 = peg$literalExpectation(".", false);
33410
- const peg$e34 = peg$classExpectation(["&", ":", "]"], true, false, false);
33411
- const peg$e35 = peg$otherExpectation("Character");
33412
- const peg$e36 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], true, false, false);
33413
- const peg$e37 = peg$otherExpectation("Blank Line");
33414
- const peg$e38 = peg$classExpectation([" ", " "], false, false, false);
33415
- const peg$e39 = peg$otherExpectation("Line Terminator");
33416
- const peg$e40 = peg$literalExpectation("\n", false);
33417
- const peg$e41 = peg$literalExpectation("\r\n", false);
33418
- const peg$e42 = peg$classExpectation(["\r", ["\u2028", "\u2029"]], false, false, false);
33419
- const peg$e43 = peg$otherExpectation("Whitespace, then Line Terminator");
33420
- const peg$e44 = peg$otherExpectation("whitespace");
33421
- const peg$e45 = peg$classExpectation([" ", " ", "\n", "\r", "\u2028", "\u2029"], false, false, false);
33890
+ const peg$e12 = peg$literalExpectation(" ", false);
33891
+ const peg$e13 = peg$literalExpectation("--", false);
33892
+ const peg$e14 = peg$literalExpectation("++", false);
33893
+ const peg$e15 = peg$literalExpectation("===", false);
33894
+ const peg$e16 = peg$literalExpectation("==", false);
33895
+ const peg$e17 = peg$classExpectation([["a", "z"]], false, false, false);
33896
+ const peg$e18 = peg$classExpectation([["a", "z"], ["0", "9"], "-"], false, false, false);
33897
+ const peg$e19 = peg$literalExpectation("[@id", false);
33898
+ const peg$e20 = peg$literalExpectation("#", false);
33899
+ const peg$e21 = peg$literalExpectation("[\u25BC", false);
33900
+ const peg$e22 = peg$literalExpectation("[\u25BA", false);
33901
+ const peg$e23 = peg$literalExpectation("[@", false);
33902
+ const peg$e24 = peg$literalExpectation("[%", false);
33903
+ const peg$e25 = peg$literalExpectation("[!", false);
33904
+ const peg$e26 = peg$literalExpectation("[?", false);
33905
+ const peg$e27 = peg$literalExpectation("[+", false);
33906
+ const peg$e28 = peg$literalExpectation("[-", false);
33907
+ const peg$e29 = peg$literalExpectation("[$", false);
33908
+ const peg$e30 = peg$literalExpectation("[_", false);
33909
+ const peg$e31 = peg$literalExpectation("[=", false);
33910
+ const peg$e32 = peg$literalExpectation("[&", false);
33911
+ const peg$e33 = peg$literalExpectation("^]", false);
33912
+ const peg$e34 = peg$literalExpectation("id:", false);
33913
+ const peg$e35 = peg$classExpectation([":", "]"], true, false, false);
33914
+ const peg$e36 = peg$literalExpectation(".", false);
33915
+ const peg$e37 = peg$classExpectation(["&", ":", "]"], true, false, false);
33916
+ const peg$e38 = peg$otherExpectation("Character");
33917
+ const peg$e39 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], true, false, false);
33918
+ const peg$e40 = peg$otherExpectation("Blank Line");
33919
+ const peg$e41 = peg$classExpectation([" ", " "], false, false, false);
33920
+ const peg$e42 = peg$otherExpectation("Line Terminator");
33921
+ const peg$e43 = peg$literalExpectation("\n", false);
33922
+ const peg$e44 = peg$literalExpectation("\r\n", false);
33923
+ const peg$e45 = peg$classExpectation(["\r", ["\u2028", "\u2029"]], false, false, false);
33924
+ const peg$e46 = peg$otherExpectation("Whitespace, then Line Terminator");
33925
+ const peg$e47 = peg$otherExpectation("whitespace");
33926
+ const peg$e48 = peg$classExpectation([" ", " ", "\n", "\r", "\u2028", "\u2029"], false, false, false);
33422
33927
  function peg$f0(firstBit, bits) {
33423
33928
  return processor.buildBits([firstBit, ...bits]);
33424
33929
  }
@@ -33491,91 +33996,112 @@ function peg$parse2(input, options) {
33491
33996
  function peg$f23(value) {
33492
33997
  return helper.handleCardLineOrDivider(value, 2);
33493
33998
  }
33494
- function peg$f24(value) {
33999
+ function peg$f24(qualifier) {
34000
+ return ["====", qualifier];
34001
+ }
34002
+ function peg$f25() {
34003
+ return ["===="];
34004
+ }
34005
+ function peg$f26(qualifier) {
34006
+ return ["--", qualifier];
34007
+ }
34008
+ function peg$f27() {
34009
+ return ["--"];
34010
+ }
34011
+ function peg$f28(qualifier) {
34012
+ return ["++", qualifier];
34013
+ }
34014
+ function peg$f29() {
34015
+ return ["++"];
34016
+ }
34017
+ function peg$f30(value) {
33495
34018
  return helper.handleCardLine(value);
33496
34019
  }
33497
- function peg$f25(value) {
34020
+ function peg$f31(value) {
33498
34021
  return helper.handleCardSet(value[1].flat());
33499
34022
  }
33500
- function peg$f26() {
34023
+ function peg$f32() {
33501
34024
  helper.handleCardSetStart();
33502
34025
  }
33503
- function peg$f27() {
34026
+ function peg$f33() {
33504
34027
  helper.handleCardSetEnd();
33505
34028
  }
33506
- function peg$f28(value) {
34029
+ function peg$f34(value) {
33507
34030
  return helper.handleCards(value);
33508
34031
  }
33509
- function peg$f29(value) {
34032
+ function peg$f35(value) {
33510
34033
  return helper.handleCardLineOrDivider(value, 1);
33511
34034
  }
33512
- function peg$f30(value) {
34035
+ function peg$f36(value) {
33513
34036
  return helper.handleCardLine(value);
33514
34037
  }
33515
- function peg$f31(value) {
34038
+ function peg$f37(value) {
34039
+ return value;
34040
+ }
34041
+ function peg$f38(value) {
33516
34042
  return helper.handleCardContent(value);
33517
34043
  }
33518
- function peg$f32(value) {
34044
+ function peg$f39(value) {
33519
34045
  return { type: TypeKey.CardChar, value };
33520
34046
  }
33521
- function peg$f33(value) {
34047
+ function peg$f40(value) {
33522
34048
  return helper.handlePropertyTag("id", value);
33523
34049
  }
33524
- function peg$f34(level, title) {
34050
+ function peg$f41(level, title) {
33525
34051
  return helper.handleTag(TypeKey.Title, { level, title });
33526
34052
  }
33527
- function peg$f35(value) {
34053
+ function peg$f42(value) {
33528
34054
  return helper.handleTag(TypeKey.Anchor, value);
33529
34055
  }
33530
- function peg$f36(value) {
34056
+ function peg$f43(value) {
33531
34057
  return helper.handleTag(TypeKey.Reference, value);
33532
34058
  }
33533
- function peg$f37(key, value) {
34059
+ function peg$f44(key, value) {
33534
34060
  return helper.handlePropertyTag(key, value);
33535
34061
  }
33536
- function peg$f38(value) {
34062
+ function peg$f45(value) {
33537
34063
  return helper.handleTag(TypeKey.ItemLead, value);
33538
34064
  }
33539
- function peg$f39(value) {
34065
+ function peg$f46(value) {
33540
34066
  return helper.handleTag(TypeKey.Instruction, value);
33541
34067
  }
33542
- function peg$f40(value) {
34068
+ function peg$f47(value) {
33543
34069
  return helper.handleTag(TypeKey.Hint, value);
33544
34070
  }
33545
- function peg$f41(value) {
34071
+ function peg$f48(value) {
33546
34072
  return helper.handleTag(TypeKey.True, value);
33547
34073
  }
33548
- function peg$f42(value) {
34074
+ function peg$f49(value) {
33549
34075
  return helper.handleTag(TypeKey.False, value);
33550
34076
  }
33551
- function peg$f43(value) {
34077
+ function peg$f50(value) {
33552
34078
  return helper.handleTag(TypeKey.SampleSolution, value);
33553
34079
  }
33554
- function peg$f44(value) {
34080
+ function peg$f51(value) {
33555
34081
  return helper.handleTag(TypeKey.Gap, value);
33556
34082
  }
33557
- function peg$f45(value) {
34083
+ function peg$f52(value) {
33558
34084
  return helper.handleTag(TypeKey.Mark, value);
33559
34085
  }
33560
- function peg$f46(key, value) {
34086
+ function peg$f53(key, value) {
33561
34087
  return helper.handleResourceTag(key, value);
33562
34088
  }
33563
- function peg$f47(value) {
34089
+ function peg$f54(value) {
33564
34090
  return value;
33565
34091
  }
33566
- function peg$f48(value) {
34092
+ function peg$f55(value) {
33567
34093
  return value ? value.trim() : "";
33568
34094
  }
33569
- function peg$f49(value) {
34095
+ function peg$f56(value) {
33570
34096
  return value.length;
33571
34097
  }
33572
- function peg$f50(value) {
34098
+ function peg$f57(value) {
33573
34099
  return value ? value.trim() : null;
33574
34100
  }
33575
- function peg$f51(value) {
34101
+ function peg$f58(value) {
33576
34102
  return value ? value.trim() : "";
33577
34103
  }
33578
- function peg$f52() {
34104
+ function peg$f59() {
33579
34105
  return true;
33580
34106
  }
33581
34107
  let peg$currPos = options.peg$currPos | 0;
@@ -34493,35 +35019,28 @@ function peg$parse2(input, options) {
34493
35019
  return s0;
34494
35020
  }
34495
35021
  function peg$parseCardSetStart_V2() {
34496
- let s0, s1, s2, s3, s4, s5;
35022
+ let s0, s1, s2, s3;
34497
35023
  s0 = peg$currPos;
34498
- s1 = peg$parseNL();
35024
+ s1 = [];
35025
+ s2 = peg$parseWNL();
35026
+ if (s2 === peg$FAILED) {
35027
+ s2 = peg$parseNL();
35028
+ }
35029
+ if (s2 !== peg$FAILED) {
35030
+ while (s2 !== peg$FAILED) {
35031
+ s1.push(s2);
35032
+ s2 = peg$parseWNL();
35033
+ if (s2 === peg$FAILED) {
35034
+ s2 = peg$parseNL();
35035
+ }
35036
+ }
35037
+ } else {
35038
+ s1 = peg$FAILED;
35039
+ }
34499
35040
  if (s1 !== peg$FAILED) {
34500
35041
  s2 = peg$currPos;
34501
35042
  peg$silentFails++;
34502
- s3 = peg$currPos;
34503
- if (input.substr(peg$currPos, 4) === peg$c6) {
34504
- s4 = peg$c6;
34505
- peg$currPos += 4;
34506
- } else {
34507
- s4 = peg$FAILED;
34508
- if (peg$silentFails === 0) {
34509
- peg$fail(peg$e8);
34510
- }
34511
- }
34512
- if (s4 !== peg$FAILED) {
34513
- s5 = peg$parseWNL();
34514
- if (s5 !== peg$FAILED) {
34515
- s4 = [s4, s5];
34516
- s3 = s4;
34517
- } else {
34518
- peg$currPos = s3;
34519
- s3 = peg$FAILED;
34520
- }
34521
- } else {
34522
- peg$currPos = s3;
34523
- s3 = peg$FAILED;
34524
- }
35043
+ s3 = peg$parseCardDividerLookahead_V2();
34525
35044
  peg$silentFails--;
34526
35045
  if (s3 !== peg$FAILED) {
34527
35046
  peg$currPos = s2;
@@ -34586,39 +35105,147 @@ function peg$parse2(input, options) {
34586
35105
  return s0;
34587
35106
  }
34588
35107
  function peg$parseCardLineOrDivider_V2() {
34589
- let s0, s1, s2, s3;
35108
+ let s0, s1;
35109
+ s0 = peg$currPos;
35110
+ s1 = peg$parseCardDividerToken_V2();
35111
+ if (s1 === peg$FAILED) {
35112
+ s1 = peg$parseCardSideDividerToken_V2();
35113
+ if (s1 === peg$FAILED) {
35114
+ s1 = peg$parseCardVariantDividerToken_V2();
35115
+ if (s1 === peg$FAILED) {
35116
+ s1 = peg$parseCardLine_V2();
35117
+ }
35118
+ }
35119
+ }
35120
+ if (s1 !== peg$FAILED) {
35121
+ peg$savedPos = s0;
35122
+ s1 = peg$f23(s1);
35123
+ }
35124
+ s0 = s1;
35125
+ return s0;
35126
+ }
35127
+ function peg$parseCardDividerToken_V2() {
35128
+ let s0, s1, s2, s3, s4, s5, s6;
34590
35129
  s0 = peg$currPos;
34591
- s1 = peg$currPos;
34592
35130
  if (input.substr(peg$currPos, 4) === peg$c6) {
34593
- s2 = peg$c6;
35131
+ s1 = peg$c6;
34594
35132
  peg$currPos += 4;
34595
35133
  } else {
34596
- s2 = peg$FAILED;
35134
+ s1 = peg$FAILED;
34597
35135
  if (peg$silentFails === 0) {
34598
35136
  peg$fail(peg$e8);
34599
35137
  }
34600
35138
  }
34601
- if (s2 !== peg$FAILED) {
34602
- s3 = peg$parseWNL();
34603
- if (s3 === peg$FAILED) {
34604
- s3 = peg$parseWEOL();
35139
+ if (s1 !== peg$FAILED) {
35140
+ if (input.charCodeAt(peg$currPos) === 32) {
35141
+ s2 = peg$c10;
35142
+ peg$currPos++;
35143
+ } else {
35144
+ s2 = peg$FAILED;
35145
+ if (peg$silentFails === 0) {
35146
+ peg$fail(peg$e12);
35147
+ }
34605
35148
  }
34606
- if (s3 !== peg$FAILED) {
34607
- s2 = [s2, s3];
34608
- s1 = s2;
35149
+ if (s2 !== peg$FAILED) {
35150
+ s3 = peg$parseQualifier();
35151
+ if (s3 !== peg$FAILED) {
35152
+ if (input.charCodeAt(peg$currPos) === 32) {
35153
+ s4 = peg$c10;
35154
+ peg$currPos++;
35155
+ } else {
35156
+ s4 = peg$FAILED;
35157
+ if (peg$silentFails === 0) {
35158
+ peg$fail(peg$e12);
35159
+ }
35160
+ }
35161
+ if (s4 !== peg$FAILED) {
35162
+ if (input.substr(peg$currPos, 4) === peg$c6) {
35163
+ s5 = peg$c6;
35164
+ peg$currPos += 4;
35165
+ } else {
35166
+ s5 = peg$FAILED;
35167
+ if (peg$silentFails === 0) {
35168
+ peg$fail(peg$e8);
35169
+ }
35170
+ }
35171
+ if (s5 !== peg$FAILED) {
35172
+ s6 = peg$parseWNL();
35173
+ if (s6 === peg$FAILED) {
35174
+ s6 = peg$parseWEOL();
35175
+ }
35176
+ if (s6 !== peg$FAILED) {
35177
+ peg$savedPos = s0;
35178
+ s0 = peg$f24(s3);
35179
+ } else {
35180
+ peg$currPos = s0;
35181
+ s0 = peg$FAILED;
35182
+ }
35183
+ } else {
35184
+ peg$currPos = s0;
35185
+ s0 = peg$FAILED;
35186
+ }
35187
+ } else {
35188
+ peg$currPos = s0;
35189
+ s0 = peg$FAILED;
35190
+ }
35191
+ } else {
35192
+ peg$currPos = s0;
35193
+ s0 = peg$FAILED;
35194
+ }
35195
+ } else {
35196
+ peg$currPos = s0;
35197
+ s0 = peg$FAILED;
35198
+ }
35199
+ } else {
35200
+ peg$currPos = s0;
35201
+ s0 = peg$FAILED;
35202
+ }
35203
+ if (s0 === peg$FAILED) {
35204
+ s0 = peg$currPos;
35205
+ if (input.substr(peg$currPos, 4) === peg$c6) {
35206
+ s1 = peg$c6;
35207
+ peg$currPos += 4;
34609
35208
  } else {
34610
- peg$currPos = s1;
34611
35209
  s1 = peg$FAILED;
35210
+ if (peg$silentFails === 0) {
35211
+ peg$fail(peg$e8);
35212
+ }
34612
35213
  }
35214
+ if (s1 !== peg$FAILED) {
35215
+ s2 = peg$parseWNL();
35216
+ if (s2 === peg$FAILED) {
35217
+ s2 = peg$parseWEOL();
35218
+ }
35219
+ if (s2 !== peg$FAILED) {
35220
+ peg$savedPos = s0;
35221
+ s0 = peg$f25();
35222
+ } else {
35223
+ peg$currPos = s0;
35224
+ s0 = peg$FAILED;
35225
+ }
35226
+ } else {
35227
+ peg$currPos = s0;
35228
+ s0 = peg$FAILED;
35229
+ }
35230
+ }
35231
+ return s0;
35232
+ }
35233
+ function peg$parseCardSideDividerToken_V2() {
35234
+ let s0, s1, s2, s3, s4, s5, s6;
35235
+ s0 = peg$currPos;
35236
+ if (input.substr(peg$currPos, 2) === peg$c11) {
35237
+ s1 = peg$c11;
35238
+ peg$currPos += 2;
34613
35239
  } else {
34614
- peg$currPos = s1;
34615
35240
  s1 = peg$FAILED;
35241
+ if (peg$silentFails === 0) {
35242
+ peg$fail(peg$e13);
35243
+ }
34616
35244
  }
34617
- if (s1 === peg$FAILED) {
34618
- s1 = peg$currPos;
34619
- if (input.substr(peg$currPos, 2) === peg$c10) {
35245
+ if (s1 !== peg$FAILED) {
35246
+ if (input.charCodeAt(peg$currPos) === 32) {
34620
35247
  s2 = peg$c10;
34621
- peg$currPos += 2;
35248
+ peg$currPos++;
34622
35249
  } else {
34623
35250
  s2 = peg$FAILED;
34624
35251
  if (peg$silentFails === 0) {
@@ -34626,58 +35253,277 @@ function peg$parse2(input, options) {
34626
35253
  }
34627
35254
  }
34628
35255
  if (s2 !== peg$FAILED) {
34629
- s3 = peg$parseWNL();
34630
- if (s3 === peg$FAILED) {
34631
- s3 = peg$parseWEOL();
34632
- }
35256
+ s3 = peg$parseQualifier();
34633
35257
  if (s3 !== peg$FAILED) {
34634
- s2 = [s2, s3];
34635
- s1 = s2;
35258
+ if (input.charCodeAt(peg$currPos) === 32) {
35259
+ s4 = peg$c10;
35260
+ peg$currPos++;
35261
+ } else {
35262
+ s4 = peg$FAILED;
35263
+ if (peg$silentFails === 0) {
35264
+ peg$fail(peg$e12);
35265
+ }
35266
+ }
35267
+ if (s4 !== peg$FAILED) {
35268
+ if (input.substr(peg$currPos, 2) === peg$c11) {
35269
+ s5 = peg$c11;
35270
+ peg$currPos += 2;
35271
+ } else {
35272
+ s5 = peg$FAILED;
35273
+ if (peg$silentFails === 0) {
35274
+ peg$fail(peg$e13);
35275
+ }
35276
+ }
35277
+ if (s5 !== peg$FAILED) {
35278
+ s6 = peg$parseWNL();
35279
+ if (s6 === peg$FAILED) {
35280
+ s6 = peg$parseWEOL();
35281
+ }
35282
+ if (s6 !== peg$FAILED) {
35283
+ peg$savedPos = s0;
35284
+ s0 = peg$f26(s3);
35285
+ } else {
35286
+ peg$currPos = s0;
35287
+ s0 = peg$FAILED;
35288
+ }
35289
+ } else {
35290
+ peg$currPos = s0;
35291
+ s0 = peg$FAILED;
35292
+ }
35293
+ } else {
35294
+ peg$currPos = s0;
35295
+ s0 = peg$FAILED;
35296
+ }
34636
35297
  } else {
34637
- peg$currPos = s1;
34638
- s1 = peg$FAILED;
35298
+ peg$currPos = s0;
35299
+ s0 = peg$FAILED;
34639
35300
  }
34640
35301
  } else {
34641
- peg$currPos = s1;
35302
+ peg$currPos = s0;
35303
+ s0 = peg$FAILED;
35304
+ }
35305
+ } else {
35306
+ peg$currPos = s0;
35307
+ s0 = peg$FAILED;
35308
+ }
35309
+ if (s0 === peg$FAILED) {
35310
+ s0 = peg$currPos;
35311
+ if (input.substr(peg$currPos, 2) === peg$c11) {
35312
+ s1 = peg$c11;
35313
+ peg$currPos += 2;
35314
+ } else {
34642
35315
  s1 = peg$FAILED;
35316
+ if (peg$silentFails === 0) {
35317
+ peg$fail(peg$e13);
35318
+ }
34643
35319
  }
34644
- if (s1 === peg$FAILED) {
34645
- s1 = peg$currPos;
34646
- if (input.substr(peg$currPos, 2) === peg$c11) {
34647
- s2 = peg$c11;
34648
- peg$currPos += 2;
34649
- } else {
34650
- s2 = peg$FAILED;
34651
- if (peg$silentFails === 0) {
34652
- peg$fail(peg$e13);
34653
- }
35320
+ if (s1 !== peg$FAILED) {
35321
+ s2 = peg$parseWNL();
35322
+ if (s2 === peg$FAILED) {
35323
+ s2 = peg$parseWEOL();
34654
35324
  }
34655
35325
  if (s2 !== peg$FAILED) {
34656
- s3 = peg$parseWNL();
34657
- if (s3 === peg$FAILED) {
34658
- s3 = peg$parseWEOL();
35326
+ peg$savedPos = s0;
35327
+ s0 = peg$f27();
35328
+ } else {
35329
+ peg$currPos = s0;
35330
+ s0 = peg$FAILED;
35331
+ }
35332
+ } else {
35333
+ peg$currPos = s0;
35334
+ s0 = peg$FAILED;
35335
+ }
35336
+ }
35337
+ return s0;
35338
+ }
35339
+ function peg$parseCardVariantDividerToken_V2() {
35340
+ let s0, s1, s2, s3, s4, s5, s6;
35341
+ s0 = peg$currPos;
35342
+ if (input.substr(peg$currPos, 2) === peg$c12) {
35343
+ s1 = peg$c12;
35344
+ peg$currPos += 2;
35345
+ } else {
35346
+ s1 = peg$FAILED;
35347
+ if (peg$silentFails === 0) {
35348
+ peg$fail(peg$e14);
35349
+ }
35350
+ }
35351
+ if (s1 !== peg$FAILED) {
35352
+ if (input.charCodeAt(peg$currPos) === 32) {
35353
+ s2 = peg$c10;
35354
+ peg$currPos++;
35355
+ } else {
35356
+ s2 = peg$FAILED;
35357
+ if (peg$silentFails === 0) {
35358
+ peg$fail(peg$e12);
35359
+ }
35360
+ }
35361
+ if (s2 !== peg$FAILED) {
35362
+ s3 = peg$parseQualifier();
35363
+ if (s3 !== peg$FAILED) {
35364
+ if (input.charCodeAt(peg$currPos) === 32) {
35365
+ s4 = peg$c10;
35366
+ peg$currPos++;
35367
+ } else {
35368
+ s4 = peg$FAILED;
35369
+ if (peg$silentFails === 0) {
35370
+ peg$fail(peg$e12);
35371
+ }
34659
35372
  }
34660
- if (s3 !== peg$FAILED) {
34661
- s2 = [s2, s3];
34662
- s1 = s2;
35373
+ if (s4 !== peg$FAILED) {
35374
+ if (input.substr(peg$currPos, 2) === peg$c12) {
35375
+ s5 = peg$c12;
35376
+ peg$currPos += 2;
35377
+ } else {
35378
+ s5 = peg$FAILED;
35379
+ if (peg$silentFails === 0) {
35380
+ peg$fail(peg$e14);
35381
+ }
35382
+ }
35383
+ if (s5 !== peg$FAILED) {
35384
+ s6 = peg$parseWNL();
35385
+ if (s6 === peg$FAILED) {
35386
+ s6 = peg$parseWEOL();
35387
+ }
35388
+ if (s6 !== peg$FAILED) {
35389
+ peg$savedPos = s0;
35390
+ s0 = peg$f28(s3);
35391
+ } else {
35392
+ peg$currPos = s0;
35393
+ s0 = peg$FAILED;
35394
+ }
35395
+ } else {
35396
+ peg$currPos = s0;
35397
+ s0 = peg$FAILED;
35398
+ }
34663
35399
  } else {
34664
- peg$currPos = s1;
34665
- s1 = peg$FAILED;
35400
+ peg$currPos = s0;
35401
+ s0 = peg$FAILED;
34666
35402
  }
34667
35403
  } else {
34668
- peg$currPos = s1;
34669
- s1 = peg$FAILED;
35404
+ peg$currPos = s0;
35405
+ s0 = peg$FAILED;
34670
35406
  }
34671
- if (s1 === peg$FAILED) {
34672
- s1 = peg$parseCardLine_V2();
35407
+ } else {
35408
+ peg$currPos = s0;
35409
+ s0 = peg$FAILED;
35410
+ }
35411
+ } else {
35412
+ peg$currPos = s0;
35413
+ s0 = peg$FAILED;
35414
+ }
35415
+ if (s0 === peg$FAILED) {
35416
+ s0 = peg$currPos;
35417
+ if (input.substr(peg$currPos, 2) === peg$c12) {
35418
+ s1 = peg$c12;
35419
+ peg$currPos += 2;
35420
+ } else {
35421
+ s1 = peg$FAILED;
35422
+ if (peg$silentFails === 0) {
35423
+ peg$fail(peg$e14);
34673
35424
  }
34674
35425
  }
35426
+ if (s1 !== peg$FAILED) {
35427
+ s2 = peg$parseWNL();
35428
+ if (s2 === peg$FAILED) {
35429
+ s2 = peg$parseWEOL();
35430
+ }
35431
+ if (s2 !== peg$FAILED) {
35432
+ peg$savedPos = s0;
35433
+ s0 = peg$f29();
35434
+ } else {
35435
+ peg$currPos = s0;
35436
+ s0 = peg$FAILED;
35437
+ }
35438
+ } else {
35439
+ peg$currPos = s0;
35440
+ s0 = peg$FAILED;
35441
+ }
35442
+ }
35443
+ return s0;
35444
+ }
35445
+ function peg$parseCardDividerLookahead_V2() {
35446
+ let s0, s1, s2, s3, s4, s5, s6;
35447
+ s0 = peg$currPos;
35448
+ if (input.substr(peg$currPos, 4) === peg$c6) {
35449
+ s1 = peg$c6;
35450
+ peg$currPos += 4;
35451
+ } else {
35452
+ s1 = peg$FAILED;
35453
+ if (peg$silentFails === 0) {
35454
+ peg$fail(peg$e8);
35455
+ }
34675
35456
  }
34676
35457
  if (s1 !== peg$FAILED) {
34677
- peg$savedPos = s0;
34678
- s1 = peg$f23(s1);
35458
+ s2 = peg$currPos;
35459
+ if (input.charCodeAt(peg$currPos) === 32) {
35460
+ s3 = peg$c10;
35461
+ peg$currPos++;
35462
+ } else {
35463
+ s3 = peg$FAILED;
35464
+ if (peg$silentFails === 0) {
35465
+ peg$fail(peg$e12);
35466
+ }
35467
+ }
35468
+ if (s3 !== peg$FAILED) {
35469
+ s4 = peg$parseQualifier();
35470
+ if (s4 !== peg$FAILED) {
35471
+ if (input.charCodeAt(peg$currPos) === 32) {
35472
+ s5 = peg$c10;
35473
+ peg$currPos++;
35474
+ } else {
35475
+ s5 = peg$FAILED;
35476
+ if (peg$silentFails === 0) {
35477
+ peg$fail(peg$e12);
35478
+ }
35479
+ }
35480
+ if (s5 !== peg$FAILED) {
35481
+ if (input.substr(peg$currPos, 4) === peg$c6) {
35482
+ s6 = peg$c6;
35483
+ peg$currPos += 4;
35484
+ } else {
35485
+ s6 = peg$FAILED;
35486
+ if (peg$silentFails === 0) {
35487
+ peg$fail(peg$e8);
35488
+ }
35489
+ }
35490
+ if (s6 !== peg$FAILED) {
35491
+ s3 = [s3, s4, s5, s6];
35492
+ s2 = s3;
35493
+ } else {
35494
+ peg$currPos = s2;
35495
+ s2 = peg$FAILED;
35496
+ }
35497
+ } else {
35498
+ peg$currPos = s2;
35499
+ s2 = peg$FAILED;
35500
+ }
35501
+ } else {
35502
+ peg$currPos = s2;
35503
+ s2 = peg$FAILED;
35504
+ }
35505
+ } else {
35506
+ peg$currPos = s2;
35507
+ s2 = peg$FAILED;
35508
+ }
35509
+ if (s2 === peg$FAILED) {
35510
+ s2 = null;
35511
+ }
35512
+ s3 = peg$parseWNL();
35513
+ if (s3 === peg$FAILED) {
35514
+ s3 = peg$parseWEOL();
35515
+ }
35516
+ if (s3 !== peg$FAILED) {
35517
+ s1 = [s1, s2, s3];
35518
+ s0 = s1;
35519
+ } else {
35520
+ peg$currPos = s0;
35521
+ s0 = peg$FAILED;
35522
+ }
35523
+ } else {
35524
+ peg$currPos = s0;
35525
+ s0 = peg$FAILED;
34679
35526
  }
34680
- s0 = s1;
34681
35527
  return s0;
34682
35528
  }
34683
35529
  function peg$parseCardLine_V2() {
@@ -34752,7 +35598,7 @@ function peg$parse2(input, options) {
34752
35598
  }
34753
35599
  if (s2 !== peg$FAILED) {
34754
35600
  peg$savedPos = s0;
34755
- s0 = peg$f24(s2);
35601
+ s0 = peg$f30(s2);
34756
35602
  } else {
34757
35603
  peg$currPos = s0;
34758
35604
  s0 = peg$FAILED;
@@ -34789,7 +35635,7 @@ function peg$parse2(input, options) {
34789
35635
  }
34790
35636
  if (s1 !== peg$FAILED) {
34791
35637
  peg$savedPos = s0;
34792
- s1 = peg$f25(s1);
35638
+ s1 = peg$f31(s1);
34793
35639
  }
34794
35640
  s0 = s1;
34795
35641
  return s0;
@@ -34797,18 +35643,33 @@ function peg$parse2(input, options) {
34797
35643
  function peg$parseCardSetStart_V1() {
34798
35644
  let s0, s1, s2, s3, s4, s5;
34799
35645
  s0 = peg$currPos;
34800
- s1 = peg$parseNL();
35646
+ s1 = [];
35647
+ s2 = peg$parseWNL();
35648
+ if (s2 === peg$FAILED) {
35649
+ s2 = peg$parseNL();
35650
+ }
35651
+ if (s2 !== peg$FAILED) {
35652
+ while (s2 !== peg$FAILED) {
35653
+ s1.push(s2);
35654
+ s2 = peg$parseWNL();
35655
+ if (s2 === peg$FAILED) {
35656
+ s2 = peg$parseNL();
35657
+ }
35658
+ }
35659
+ } else {
35660
+ s1 = peg$FAILED;
35661
+ }
34801
35662
  if (s1 !== peg$FAILED) {
34802
35663
  s2 = peg$currPos;
34803
35664
  peg$silentFails++;
34804
35665
  s3 = peg$currPos;
34805
- if (input.substr(peg$currPos, 3) === peg$c12) {
34806
- s4 = peg$c12;
35666
+ if (input.substr(peg$currPos, 3) === peg$c13) {
35667
+ s4 = peg$c13;
34807
35668
  peg$currPos += 3;
34808
35669
  } else {
34809
35670
  s4 = peg$FAILED;
34810
35671
  if (peg$silentFails === 0) {
34811
- peg$fail(peg$e14);
35672
+ peg$fail(peg$e15);
34812
35673
  }
34813
35674
  }
34814
35675
  if (s4 !== peg$FAILED) {
@@ -34833,7 +35694,7 @@ function peg$parse2(input, options) {
34833
35694
  }
34834
35695
  if (s2 !== peg$FAILED) {
34835
35696
  peg$savedPos = s0;
34836
- s0 = peg$f26();
35697
+ s0 = peg$f32();
34837
35698
  } else {
34838
35699
  peg$currPos = s0;
34839
35700
  s0 = peg$FAILED;
@@ -34871,7 +35732,7 @@ function peg$parse2(input, options) {
34871
35732
  }
34872
35733
  if (s1 !== peg$FAILED) {
34873
35734
  peg$savedPos = s0;
34874
- s1 = peg$f27();
35735
+ s1 = peg$f33();
34875
35736
  }
34876
35737
  s0 = s1;
34877
35738
  return s0;
@@ -34882,7 +35743,7 @@ function peg$parse2(input, options) {
34882
35743
  s1 = peg$parseCardLineOrDivider_V1();
34883
35744
  if (s1 !== peg$FAILED) {
34884
35745
  peg$savedPos = s0;
34885
- s1 = peg$f28(s1);
35746
+ s1 = peg$f34(s1);
34886
35747
  }
34887
35748
  s0 = s1;
34888
35749
  return s0;
@@ -34891,13 +35752,13 @@ function peg$parse2(input, options) {
34891
35752
  let s0, s1, s2, s3;
34892
35753
  s0 = peg$currPos;
34893
35754
  s1 = peg$currPos;
34894
- if (input.substr(peg$currPos, 3) === peg$c12) {
34895
- s2 = peg$c12;
35755
+ if (input.substr(peg$currPos, 3) === peg$c13) {
35756
+ s2 = peg$c13;
34896
35757
  peg$currPos += 3;
34897
35758
  } else {
34898
35759
  s2 = peg$FAILED;
34899
35760
  if (peg$silentFails === 0) {
34900
- peg$fail(peg$e14);
35761
+ peg$fail(peg$e15);
34901
35762
  }
34902
35763
  }
34903
35764
  if (s2 !== peg$FAILED) {
@@ -34918,13 +35779,13 @@ function peg$parse2(input, options) {
34918
35779
  }
34919
35780
  if (s1 === peg$FAILED) {
34920
35781
  s1 = peg$currPos;
34921
- if (input.substr(peg$currPos, 2) === peg$c13) {
34922
- s2 = peg$c13;
35782
+ if (input.substr(peg$currPos, 2) === peg$c14) {
35783
+ s2 = peg$c14;
34923
35784
  peg$currPos += 2;
34924
35785
  } else {
34925
35786
  s2 = peg$FAILED;
34926
35787
  if (peg$silentFails === 0) {
34927
- peg$fail(peg$e15);
35788
+ peg$fail(peg$e16);
34928
35789
  }
34929
35790
  }
34930
35791
  if (s2 !== peg$FAILED) {
@@ -34945,13 +35806,13 @@ function peg$parse2(input, options) {
34945
35806
  }
34946
35807
  if (s1 === peg$FAILED) {
34947
35808
  s1 = peg$currPos;
34948
- if (input.substr(peg$currPos, 2) === peg$c10) {
34949
- s2 = peg$c10;
35809
+ if (input.substr(peg$currPos, 2) === peg$c11) {
35810
+ s2 = peg$c11;
34950
35811
  peg$currPos += 2;
34951
35812
  } else {
34952
35813
  s2 = peg$FAILED;
34953
35814
  if (peg$silentFails === 0) {
34954
- peg$fail(peg$e12);
35815
+ peg$fail(peg$e13);
34955
35816
  }
34956
35817
  }
34957
35818
  if (s2 !== peg$FAILED) {
@@ -34977,7 +35838,7 @@ function peg$parse2(input, options) {
34977
35838
  }
34978
35839
  if (s1 !== peg$FAILED) {
34979
35840
  peg$savedPos = s0;
34980
- s1 = peg$f29(s1);
35841
+ s1 = peg$f35(s1);
34981
35842
  }
34982
35843
  s0 = s1;
34983
35844
  return s0;
@@ -35054,7 +35915,7 @@ function peg$parse2(input, options) {
35054
35915
  }
35055
35916
  if (s2 !== peg$FAILED) {
35056
35917
  peg$savedPos = s0;
35057
- s0 = peg$f30(s2);
35918
+ s0 = peg$f36(s2);
35058
35919
  } else {
35059
35920
  peg$currPos = s0;
35060
35921
  s0 = peg$FAILED;
@@ -35065,6 +35926,102 @@ function peg$parse2(input, options) {
35065
35926
  }
35066
35927
  return s0;
35067
35928
  }
35929
+ function peg$parseQualifier() {
35930
+ let s0, s1, s2;
35931
+ s0 = peg$currPos;
35932
+ s1 = peg$currPos;
35933
+ peg$silentFails++;
35934
+ if (input.substr(peg$currPos, 6) === peg$c9) {
35935
+ s2 = peg$c9;
35936
+ peg$currPos += 6;
35937
+ } else {
35938
+ s2 = peg$FAILED;
35939
+ if (peg$silentFails === 0) {
35940
+ peg$fail(peg$e11);
35941
+ }
35942
+ }
35943
+ if (s2 === peg$FAILED) {
35944
+ if (input.substr(peg$currPos, 4) === peg$c7) {
35945
+ s2 = peg$c7;
35946
+ peg$currPos += 4;
35947
+ } else {
35948
+ s2 = peg$FAILED;
35949
+ if (peg$silentFails === 0) {
35950
+ peg$fail(peg$e9);
35951
+ }
35952
+ }
35953
+ }
35954
+ peg$silentFails--;
35955
+ if (s2 === peg$FAILED) {
35956
+ s1 = void 0;
35957
+ } else {
35958
+ peg$currPos = s1;
35959
+ s1 = peg$FAILED;
35960
+ }
35961
+ if (s1 !== peg$FAILED) {
35962
+ s2 = peg$parseQualifierName();
35963
+ if (s2 !== peg$FAILED) {
35964
+ peg$savedPos = s0;
35965
+ s0 = peg$f37(s2);
35966
+ } else {
35967
+ peg$currPos = s0;
35968
+ s0 = peg$FAILED;
35969
+ }
35970
+ } else {
35971
+ peg$currPos = s0;
35972
+ s0 = peg$FAILED;
35973
+ }
35974
+ return s0;
35975
+ }
35976
+ function peg$parseQualifierName() {
35977
+ let s0, s1, s2, s3, s4;
35978
+ s0 = peg$currPos;
35979
+ s1 = peg$currPos;
35980
+ s2 = input.charAt(peg$currPos);
35981
+ if (peg$r1.test(s2)) {
35982
+ peg$currPos++;
35983
+ } else {
35984
+ s2 = peg$FAILED;
35985
+ if (peg$silentFails === 0) {
35986
+ peg$fail(peg$e17);
35987
+ }
35988
+ }
35989
+ if (s2 !== peg$FAILED) {
35990
+ s3 = [];
35991
+ s4 = input.charAt(peg$currPos);
35992
+ if (peg$r2.test(s4)) {
35993
+ peg$currPos++;
35994
+ } else {
35995
+ s4 = peg$FAILED;
35996
+ if (peg$silentFails === 0) {
35997
+ peg$fail(peg$e18);
35998
+ }
35999
+ }
36000
+ while (s4 !== peg$FAILED) {
36001
+ s3.push(s4);
36002
+ s4 = input.charAt(peg$currPos);
36003
+ if (peg$r2.test(s4)) {
36004
+ peg$currPos++;
36005
+ } else {
36006
+ s4 = peg$FAILED;
36007
+ if (peg$silentFails === 0) {
36008
+ peg$fail(peg$e18);
36009
+ }
36010
+ }
36011
+ }
36012
+ s2 = [s2, s3];
36013
+ s1 = s2;
36014
+ } else {
36015
+ peg$currPos = s1;
36016
+ s1 = peg$FAILED;
36017
+ }
36018
+ if (s1 !== peg$FAILED) {
36019
+ s0 = input.substring(s0, peg$currPos);
36020
+ } else {
36021
+ s0 = s1;
36022
+ }
36023
+ return s0;
36024
+ }
35068
36025
  function peg$parsecardContent() {
35069
36026
  let s0, s1, s2;
35070
36027
  s0 = peg$currPos;
@@ -35081,7 +36038,7 @@ function peg$parse2(input, options) {
35081
36038
  }
35082
36039
  }
35083
36040
  peg$savedPos = s0;
35084
- s1 = peg$f31(s1);
36041
+ s1 = peg$f38(s1);
35085
36042
  s0 = s1;
35086
36043
  return s0;
35087
36044
  }
@@ -35099,7 +36056,7 @@ function peg$parse2(input, options) {
35099
36056
  }
35100
36057
  if (s1 !== peg$FAILED) {
35101
36058
  peg$savedPos = s0;
35102
- s1 = peg$f32(s1);
36059
+ s1 = peg$f39(s1);
35103
36060
  }
35104
36061
  s0 = s1;
35105
36062
  return s0;
@@ -35107,13 +36064,13 @@ function peg$parse2(input, options) {
35107
36064
  function peg$parseIDTag() {
35108
36065
  let s0, s1, s2, s3;
35109
36066
  s0 = peg$currPos;
35110
- if (input.substr(peg$currPos, 4) === peg$c14) {
35111
- s1 = peg$c14;
36067
+ if (input.substr(peg$currPos, 4) === peg$c15) {
36068
+ s1 = peg$c15;
35112
36069
  peg$currPos += 4;
35113
36070
  } else {
35114
36071
  s1 = peg$FAILED;
35115
36072
  if (peg$silentFails === 0) {
35116
- peg$fail(peg$e16);
36073
+ peg$fail(peg$e19);
35117
36074
  }
35118
36075
  }
35119
36076
  if (s1 !== peg$FAILED) {
@@ -35122,7 +36079,7 @@ function peg$parse2(input, options) {
35122
36079
  s3 = peg$parseTag_Close();
35123
36080
  if (s3 !== peg$FAILED) {
35124
36081
  peg$savedPos = s0;
35125
- s0 = peg$f33(s2);
36082
+ s0 = peg$f40(s2);
35126
36083
  } else {
35127
36084
  peg$currPos = s0;
35128
36085
  s0 = peg$FAILED;
@@ -35152,24 +36109,24 @@ function peg$parse2(input, options) {
35152
36109
  if (s1 !== peg$FAILED) {
35153
36110
  s2 = [];
35154
36111
  if (input.charCodeAt(peg$currPos) === 35) {
35155
- s3 = peg$c15;
36112
+ s3 = peg$c16;
35156
36113
  peg$currPos++;
35157
36114
  } else {
35158
36115
  s3 = peg$FAILED;
35159
36116
  if (peg$silentFails === 0) {
35160
- peg$fail(peg$e17);
36117
+ peg$fail(peg$e20);
35161
36118
  }
35162
36119
  }
35163
36120
  if (s3 !== peg$FAILED) {
35164
36121
  while (s3 !== peg$FAILED) {
35165
36122
  s2.push(s3);
35166
36123
  if (input.charCodeAt(peg$currPos) === 35) {
35167
- s3 = peg$c15;
36124
+ s3 = peg$c16;
35168
36125
  peg$currPos++;
35169
36126
  } else {
35170
36127
  s3 = peg$FAILED;
35171
36128
  if (peg$silentFails === 0) {
35172
- peg$fail(peg$e17);
36129
+ peg$fail(peg$e20);
35173
36130
  }
35174
36131
  }
35175
36132
  }
@@ -35181,7 +36138,7 @@ function peg$parse2(input, options) {
35181
36138
  s4 = peg$parseTag_CloseOrEOF();
35182
36139
  if (s4 !== peg$FAILED) {
35183
36140
  peg$savedPos = s0;
35184
- s0 = peg$f34(s2, s3);
36141
+ s0 = peg$f41(s2, s3);
35185
36142
  } else {
35186
36143
  peg$currPos = s0;
35187
36144
  s0 = peg$FAILED;
@@ -35199,13 +36156,13 @@ function peg$parse2(input, options) {
35199
36156
  function peg$parseAnchorTag() {
35200
36157
  let s0, s1, s2, s3;
35201
36158
  s0 = peg$currPos;
35202
- if (input.substr(peg$currPos, 2) === peg$c16) {
35203
- s1 = peg$c16;
36159
+ if (input.substr(peg$currPos, 2) === peg$c17) {
36160
+ s1 = peg$c17;
35204
36161
  peg$currPos += 2;
35205
36162
  } else {
35206
36163
  s1 = peg$FAILED;
35207
36164
  if (peg$silentFails === 0) {
35208
- peg$fail(peg$e18);
36165
+ peg$fail(peg$e21);
35209
36166
  }
35210
36167
  }
35211
36168
  if (s1 !== peg$FAILED) {
@@ -35213,7 +36170,7 @@ function peg$parse2(input, options) {
35213
36170
  s3 = peg$parseTag_CloseOrEOF();
35214
36171
  if (s3 !== peg$FAILED) {
35215
36172
  peg$savedPos = s0;
35216
- s0 = peg$f35(s2);
36173
+ s0 = peg$f42(s2);
35217
36174
  } else {
35218
36175
  peg$currPos = s0;
35219
36176
  s0 = peg$FAILED;
@@ -35227,13 +36184,13 @@ function peg$parse2(input, options) {
35227
36184
  function peg$parseReferenceTag() {
35228
36185
  let s0, s1, s2, s3;
35229
36186
  s0 = peg$currPos;
35230
- if (input.substr(peg$currPos, 2) === peg$c17) {
35231
- s1 = peg$c17;
36187
+ if (input.substr(peg$currPos, 2) === peg$c18) {
36188
+ s1 = peg$c18;
35232
36189
  peg$currPos += 2;
35233
36190
  } else {
35234
36191
  s1 = peg$FAILED;
35235
36192
  if (peg$silentFails === 0) {
35236
- peg$fail(peg$e19);
36193
+ peg$fail(peg$e22);
35237
36194
  }
35238
36195
  }
35239
36196
  if (s1 !== peg$FAILED) {
@@ -35241,7 +36198,7 @@ function peg$parse2(input, options) {
35241
36198
  s3 = peg$parseTag_CloseOrEOF();
35242
36199
  if (s3 !== peg$FAILED) {
35243
36200
  peg$savedPos = s0;
35244
- s0 = peg$f36(s2);
36201
+ s0 = peg$f43(s2);
35245
36202
  } else {
35246
36203
  peg$currPos = s0;
35247
36204
  s0 = peg$FAILED;
@@ -35255,13 +36212,13 @@ function peg$parse2(input, options) {
35255
36212
  function peg$parsePropertyTag() {
35256
36213
  let s0, s1, s2, s3, s4;
35257
36214
  s0 = peg$currPos;
35258
- if (input.substr(peg$currPos, 2) === peg$c18) {
35259
- s1 = peg$c18;
36215
+ if (input.substr(peg$currPos, 2) === peg$c19) {
36216
+ s1 = peg$c19;
35260
36217
  peg$currPos += 2;
35261
36218
  } else {
35262
36219
  s1 = peg$FAILED;
35263
36220
  if (peg$silentFails === 0) {
35264
- peg$fail(peg$e20);
36221
+ peg$fail(peg$e23);
35265
36222
  }
35266
36223
  }
35267
36224
  if (s1 !== peg$FAILED) {
@@ -35272,7 +36229,7 @@ function peg$parse2(input, options) {
35272
36229
  s4 = peg$parseTag_CloseOrEOF();
35273
36230
  if (s4 !== peg$FAILED) {
35274
36231
  peg$savedPos = s0;
35275
- s0 = peg$f37(s2, s3);
36232
+ s0 = peg$f44(s2, s3);
35276
36233
  } else {
35277
36234
  peg$currPos = s0;
35278
36235
  s0 = peg$FAILED;
@@ -35294,13 +36251,13 @@ function peg$parse2(input, options) {
35294
36251
  function peg$parseItemLeadTag() {
35295
36252
  let s0, s1, s2, s3;
35296
36253
  s0 = peg$currPos;
35297
- if (input.substr(peg$currPos, 2) === peg$c19) {
35298
- s1 = peg$c19;
36254
+ if (input.substr(peg$currPos, 2) === peg$c20) {
36255
+ s1 = peg$c20;
35299
36256
  peg$currPos += 2;
35300
36257
  } else {
35301
36258
  s1 = peg$FAILED;
35302
36259
  if (peg$silentFails === 0) {
35303
- peg$fail(peg$e21);
36260
+ peg$fail(peg$e24);
35304
36261
  }
35305
36262
  }
35306
36263
  if (s1 !== peg$FAILED) {
@@ -35308,7 +36265,7 @@ function peg$parse2(input, options) {
35308
36265
  s3 = peg$parseTag_CloseOrEOF();
35309
36266
  if (s3 !== peg$FAILED) {
35310
36267
  peg$savedPos = s0;
35311
- s0 = peg$f38(s2);
36268
+ s0 = peg$f45(s2);
35312
36269
  } else {
35313
36270
  peg$currPos = s0;
35314
36271
  s0 = peg$FAILED;
@@ -35322,13 +36279,13 @@ function peg$parse2(input, options) {
35322
36279
  function peg$parseInstructionTag() {
35323
36280
  let s0, s1, s2, s3;
35324
36281
  s0 = peg$currPos;
35325
- if (input.substr(peg$currPos, 2) === peg$c20) {
35326
- s1 = peg$c20;
36282
+ if (input.substr(peg$currPos, 2) === peg$c21) {
36283
+ s1 = peg$c21;
35327
36284
  peg$currPos += 2;
35328
36285
  } else {
35329
36286
  s1 = peg$FAILED;
35330
36287
  if (peg$silentFails === 0) {
35331
- peg$fail(peg$e22);
36288
+ peg$fail(peg$e25);
35332
36289
  }
35333
36290
  }
35334
36291
  if (s1 !== peg$FAILED) {
@@ -35336,7 +36293,7 @@ function peg$parse2(input, options) {
35336
36293
  s3 = peg$parseTag_CloseOrEOF();
35337
36294
  if (s3 !== peg$FAILED) {
35338
36295
  peg$savedPos = s0;
35339
- s0 = peg$f39(s2);
36296
+ s0 = peg$f46(s2);
35340
36297
  } else {
35341
36298
  peg$currPos = s0;
35342
36299
  s0 = peg$FAILED;
@@ -35350,13 +36307,13 @@ function peg$parse2(input, options) {
35350
36307
  function peg$parseHintTag() {
35351
36308
  let s0, s1, s2, s3;
35352
36309
  s0 = peg$currPos;
35353
- if (input.substr(peg$currPos, 2) === peg$c21) {
35354
- s1 = peg$c21;
36310
+ if (input.substr(peg$currPos, 2) === peg$c22) {
36311
+ s1 = peg$c22;
35355
36312
  peg$currPos += 2;
35356
36313
  } else {
35357
36314
  s1 = peg$FAILED;
35358
36315
  if (peg$silentFails === 0) {
35359
- peg$fail(peg$e23);
36316
+ peg$fail(peg$e26);
35360
36317
  }
35361
36318
  }
35362
36319
  if (s1 !== peg$FAILED) {
@@ -35364,7 +36321,7 @@ function peg$parse2(input, options) {
35364
36321
  s3 = peg$parseTag_CloseOrEOF();
35365
36322
  if (s3 !== peg$FAILED) {
35366
36323
  peg$savedPos = s0;
35367
- s0 = peg$f40(s2);
36324
+ s0 = peg$f47(s2);
35368
36325
  } else {
35369
36326
  peg$currPos = s0;
35370
36327
  s0 = peg$FAILED;
@@ -35378,13 +36335,13 @@ function peg$parse2(input, options) {
35378
36335
  function peg$parseTrueTag() {
35379
36336
  let s0, s1, s2, s3;
35380
36337
  s0 = peg$currPos;
35381
- if (input.substr(peg$currPos, 2) === peg$c22) {
35382
- s1 = peg$c22;
36338
+ if (input.substr(peg$currPos, 2) === peg$c23) {
36339
+ s1 = peg$c23;
35383
36340
  peg$currPos += 2;
35384
36341
  } else {
35385
36342
  s1 = peg$FAILED;
35386
36343
  if (peg$silentFails === 0) {
35387
- peg$fail(peg$e24);
36344
+ peg$fail(peg$e27);
35388
36345
  }
35389
36346
  }
35390
36347
  if (s1 !== peg$FAILED) {
@@ -35392,7 +36349,7 @@ function peg$parse2(input, options) {
35392
36349
  s3 = peg$parseTag_CloseOrEOF();
35393
36350
  if (s3 !== peg$FAILED) {
35394
36351
  peg$savedPos = s0;
35395
- s0 = peg$f41(s2);
36352
+ s0 = peg$f48(s2);
35396
36353
  } else {
35397
36354
  peg$currPos = s0;
35398
36355
  s0 = peg$FAILED;
@@ -35406,13 +36363,13 @@ function peg$parse2(input, options) {
35406
36363
  function peg$parseFalseTag() {
35407
36364
  let s0, s1, s2, s3;
35408
36365
  s0 = peg$currPos;
35409
- if (input.substr(peg$currPos, 2) === peg$c23) {
35410
- s1 = peg$c23;
36366
+ if (input.substr(peg$currPos, 2) === peg$c24) {
36367
+ s1 = peg$c24;
35411
36368
  peg$currPos += 2;
35412
36369
  } else {
35413
36370
  s1 = peg$FAILED;
35414
36371
  if (peg$silentFails === 0) {
35415
- peg$fail(peg$e25);
36372
+ peg$fail(peg$e28);
35416
36373
  }
35417
36374
  }
35418
36375
  if (s1 !== peg$FAILED) {
@@ -35420,7 +36377,7 @@ function peg$parse2(input, options) {
35420
36377
  s3 = peg$parseTag_CloseOrEOF();
35421
36378
  if (s3 !== peg$FAILED) {
35422
36379
  peg$savedPos = s0;
35423
- s0 = peg$f42(s2);
36380
+ s0 = peg$f49(s2);
35424
36381
  } else {
35425
36382
  peg$currPos = s0;
35426
36383
  s0 = peg$FAILED;
@@ -35434,13 +36391,13 @@ function peg$parse2(input, options) {
35434
36391
  function peg$parseSampleSolutionTag() {
35435
36392
  let s0, s1, s2, s3;
35436
36393
  s0 = peg$currPos;
35437
- if (input.substr(peg$currPos, 2) === peg$c24) {
35438
- s1 = peg$c24;
36394
+ if (input.substr(peg$currPos, 2) === peg$c25) {
36395
+ s1 = peg$c25;
35439
36396
  peg$currPos += 2;
35440
36397
  } else {
35441
36398
  s1 = peg$FAILED;
35442
36399
  if (peg$silentFails === 0) {
35443
- peg$fail(peg$e26);
36400
+ peg$fail(peg$e29);
35444
36401
  }
35445
36402
  }
35446
36403
  if (s1 !== peg$FAILED) {
@@ -35448,7 +36405,7 @@ function peg$parse2(input, options) {
35448
36405
  s3 = peg$parseTag_CloseOrEOF();
35449
36406
  if (s3 !== peg$FAILED) {
35450
36407
  peg$savedPos = s0;
35451
- s0 = peg$f43(s2);
36408
+ s0 = peg$f50(s2);
35452
36409
  } else {
35453
36410
  peg$currPos = s0;
35454
36411
  s0 = peg$FAILED;
@@ -35462,13 +36419,13 @@ function peg$parse2(input, options) {
35462
36419
  function peg$parseGapTag() {
35463
36420
  let s0, s1, s2, s3;
35464
36421
  s0 = peg$currPos;
35465
- if (input.substr(peg$currPos, 2) === peg$c25) {
35466
- s1 = peg$c25;
36422
+ if (input.substr(peg$currPos, 2) === peg$c26) {
36423
+ s1 = peg$c26;
35467
36424
  peg$currPos += 2;
35468
36425
  } else {
35469
36426
  s1 = peg$FAILED;
35470
36427
  if (peg$silentFails === 0) {
35471
- peg$fail(peg$e27);
36428
+ peg$fail(peg$e30);
35472
36429
  }
35473
36430
  }
35474
36431
  if (s1 !== peg$FAILED) {
@@ -35476,7 +36433,7 @@ function peg$parse2(input, options) {
35476
36433
  s3 = peg$parseTag_CloseOrEOF();
35477
36434
  if (s3 !== peg$FAILED) {
35478
36435
  peg$savedPos = s0;
35479
- s0 = peg$f44(s2);
36436
+ s0 = peg$f51(s2);
35480
36437
  } else {
35481
36438
  peg$currPos = s0;
35482
36439
  s0 = peg$FAILED;
@@ -35490,13 +36447,13 @@ function peg$parse2(input, options) {
35490
36447
  function peg$parseMarkTag() {
35491
36448
  let s0, s1, s2, s3;
35492
36449
  s0 = peg$currPos;
35493
- if (input.substr(peg$currPos, 2) === peg$c26) {
35494
- s1 = peg$c26;
36450
+ if (input.substr(peg$currPos, 2) === peg$c27) {
36451
+ s1 = peg$c27;
35495
36452
  peg$currPos += 2;
35496
36453
  } else {
35497
36454
  s1 = peg$FAILED;
35498
36455
  if (peg$silentFails === 0) {
35499
- peg$fail(peg$e28);
36456
+ peg$fail(peg$e31);
35500
36457
  }
35501
36458
  }
35502
36459
  if (s1 !== peg$FAILED) {
@@ -35504,7 +36461,7 @@ function peg$parse2(input, options) {
35504
36461
  s3 = peg$parseTag_CloseOrEOF();
35505
36462
  if (s3 !== peg$FAILED) {
35506
36463
  peg$savedPos = s0;
35507
- s0 = peg$f45(s2);
36464
+ s0 = peg$f52(s2);
35508
36465
  } else {
35509
36466
  peg$currPos = s0;
35510
36467
  s0 = peg$FAILED;
@@ -35518,13 +36475,13 @@ function peg$parse2(input, options) {
35518
36475
  function peg$parseResourceTag() {
35519
36476
  let s0, s1, s2, s3, s4;
35520
36477
  s0 = peg$currPos;
35521
- if (input.substr(peg$currPos, 2) === peg$c27) {
35522
- s1 = peg$c27;
36478
+ if (input.substr(peg$currPos, 2) === peg$c28) {
36479
+ s1 = peg$c28;
35523
36480
  peg$currPos += 2;
35524
36481
  } else {
35525
36482
  s1 = peg$FAILED;
35526
36483
  if (peg$silentFails === 0) {
35527
- peg$fail(peg$e29);
36484
+ peg$fail(peg$e32);
35528
36485
  }
35529
36486
  }
35530
36487
  if (s1 !== peg$FAILED) {
@@ -35535,7 +36492,7 @@ function peg$parse2(input, options) {
35535
36492
  s4 = peg$parseTag_CloseOrEOF();
35536
36493
  if (s4 !== peg$FAILED) {
35537
36494
  peg$savedPos = s0;
35538
- s0 = peg$f46(s2, s3);
36495
+ s0 = peg$f53(s2, s3);
35539
36496
  } else {
35540
36497
  peg$currPos = s0;
35541
36498
  s0 = peg$FAILED;
@@ -35559,13 +36516,13 @@ function peg$parse2(input, options) {
35559
36516
  s0 = peg$currPos;
35560
36517
  s1 = peg$currPos;
35561
36518
  s2 = [];
35562
- if (input.substr(peg$currPos, 2) === peg$c28) {
35563
- s3 = peg$c28;
36519
+ if (input.substr(peg$currPos, 2) === peg$c29) {
36520
+ s3 = peg$c29;
35564
36521
  peg$currPos += 2;
35565
36522
  } else {
35566
36523
  s3 = peg$FAILED;
35567
36524
  if (peg$silentFails === 0) {
35568
- peg$fail(peg$e30);
36525
+ peg$fail(peg$e33);
35569
36526
  }
35570
36527
  }
35571
36528
  if (s3 === peg$FAILED) {
@@ -35581,13 +36538,13 @@ function peg$parse2(input, options) {
35581
36538
  }
35582
36539
  while (s3 !== peg$FAILED) {
35583
36540
  s2.push(s3);
35584
- if (input.substr(peg$currPos, 2) === peg$c28) {
35585
- s3 = peg$c28;
36541
+ if (input.substr(peg$currPos, 2) === peg$c29) {
36542
+ s3 = peg$c29;
35586
36543
  peg$currPos += 2;
35587
36544
  } else {
35588
36545
  s3 = peg$FAILED;
35589
36546
  if (peg$silentFails === 0) {
35590
- peg$fail(peg$e30);
36547
+ peg$fail(peg$e33);
35591
36548
  }
35592
36549
  }
35593
36550
  if (s3 === peg$FAILED) {
@@ -35604,7 +36561,7 @@ function peg$parse2(input, options) {
35604
36561
  }
35605
36562
  s1 = input.substring(s1, peg$currPos);
35606
36563
  peg$savedPos = s0;
35607
- s1 = peg$f47(s1);
36564
+ s1 = peg$f54(s1);
35608
36565
  s0 = s1;
35609
36566
  return s0;
35610
36567
  }
@@ -35613,13 +36570,13 @@ function peg$parse2(input, options) {
35613
36570
  s0 = peg$currPos;
35614
36571
  s1 = peg$currPos;
35615
36572
  peg$silentFails++;
35616
- if (input.substr(peg$currPos, 3) === peg$c29) {
35617
- s2 = peg$c29;
36573
+ if (input.substr(peg$currPos, 3) === peg$c30) {
36574
+ s2 = peg$c30;
35618
36575
  peg$currPos += 3;
35619
36576
  } else {
35620
36577
  s2 = peg$FAILED;
35621
36578
  if (peg$silentFails === 0) {
35622
- peg$fail(peg$e31);
36579
+ peg$fail(peg$e34);
35623
36580
  }
35624
36581
  }
35625
36582
  peg$silentFails--;
@@ -35633,29 +36590,29 @@ function peg$parse2(input, options) {
35633
36590
  s2 = peg$currPos;
35634
36591
  s3 = [];
35635
36592
  s4 = input.charAt(peg$currPos);
35636
- if (peg$r1.test(s4)) {
36593
+ if (peg$r3.test(s4)) {
35637
36594
  peg$currPos++;
35638
36595
  } else {
35639
36596
  s4 = peg$FAILED;
35640
36597
  if (peg$silentFails === 0) {
35641
- peg$fail(peg$e32);
36598
+ peg$fail(peg$e35);
35642
36599
  }
35643
36600
  }
35644
36601
  while (s4 !== peg$FAILED) {
35645
36602
  s3.push(s4);
35646
36603
  s4 = input.charAt(peg$currPos);
35647
- if (peg$r1.test(s4)) {
36604
+ if (peg$r3.test(s4)) {
35648
36605
  peg$currPos++;
35649
36606
  } else {
35650
36607
  s4 = peg$FAILED;
35651
36608
  if (peg$silentFails === 0) {
35652
- peg$fail(peg$e32);
36609
+ peg$fail(peg$e35);
35653
36610
  }
35654
36611
  }
35655
36612
  }
35656
36613
  s2 = input.substring(s2, peg$currPos);
35657
36614
  peg$savedPos = s0;
35658
- s0 = peg$f48(s2);
36615
+ s0 = peg$f55(s2);
35659
36616
  } else {
35660
36617
  peg$currPos = s0;
35661
36618
  s0 = peg$FAILED;
@@ -35710,24 +36667,24 @@ function peg$parse2(input, options) {
35710
36667
  s0 = peg$currPos;
35711
36668
  s1 = [];
35712
36669
  if (input.charCodeAt(peg$currPos) === 46) {
35713
- s2 = peg$c30;
36670
+ s2 = peg$c31;
35714
36671
  peg$currPos++;
35715
36672
  } else {
35716
36673
  s2 = peg$FAILED;
35717
36674
  if (peg$silentFails === 0) {
35718
- peg$fail(peg$e33);
36675
+ peg$fail(peg$e36);
35719
36676
  }
35720
36677
  }
35721
36678
  if (s2 !== peg$FAILED) {
35722
36679
  while (s2 !== peg$FAILED) {
35723
36680
  s1.push(s2);
35724
36681
  if (input.charCodeAt(peg$currPos) === 46) {
35725
- s2 = peg$c30;
36682
+ s2 = peg$c31;
35726
36683
  peg$currPos++;
35727
36684
  } else {
35728
36685
  s2 = peg$FAILED;
35729
36686
  if (peg$silentFails === 0) {
35730
- peg$fail(peg$e33);
36687
+ peg$fail(peg$e36);
35731
36688
  }
35732
36689
  }
35733
36690
  }
@@ -35736,7 +36693,7 @@ function peg$parse2(input, options) {
35736
36693
  }
35737
36694
  if (s1 !== peg$FAILED) {
35738
36695
  peg$savedPos = s0;
35739
- s1 = peg$f49(s1);
36696
+ s1 = peg$f56(s1);
35740
36697
  }
35741
36698
  s0 = s1;
35742
36699
  return s0;
@@ -35747,29 +36704,29 @@ function peg$parse2(input, options) {
35747
36704
  s1 = peg$currPos;
35748
36705
  s2 = [];
35749
36706
  s3 = input.charAt(peg$currPos);
35750
- if (peg$r2.test(s3)) {
36707
+ if (peg$r4.test(s3)) {
35751
36708
  peg$currPos++;
35752
36709
  } else {
35753
36710
  s3 = peg$FAILED;
35754
36711
  if (peg$silentFails === 0) {
35755
- peg$fail(peg$e34);
36712
+ peg$fail(peg$e37);
35756
36713
  }
35757
36714
  }
35758
36715
  while (s3 !== peg$FAILED) {
35759
36716
  s2.push(s3);
35760
36717
  s3 = input.charAt(peg$currPos);
35761
- if (peg$r2.test(s3)) {
36718
+ if (peg$r4.test(s3)) {
35762
36719
  peg$currPos++;
35763
36720
  } else {
35764
36721
  s3 = peg$FAILED;
35765
36722
  if (peg$silentFails === 0) {
35766
- peg$fail(peg$e34);
36723
+ peg$fail(peg$e37);
35767
36724
  }
35768
36725
  }
35769
36726
  }
35770
36727
  s1 = input.substring(s1, peg$currPos);
35771
36728
  peg$savedPos = s0;
35772
- s1 = peg$f50(s1);
36729
+ s1 = peg$f57(s1);
35773
36730
  s0 = s1;
35774
36731
  return s0;
35775
36732
  }
@@ -35788,7 +36745,7 @@ function peg$parse2(input, options) {
35788
36745
  if (s1 !== peg$FAILED) {
35789
36746
  s2 = peg$parseTag_Value();
35790
36747
  peg$savedPos = s0;
35791
- s0 = peg$f51(s2);
36748
+ s0 = peg$f58(s2);
35792
36749
  } else {
35793
36750
  peg$currPos = s0;
35794
36751
  s0 = peg$FAILED;
@@ -35797,7 +36754,7 @@ function peg$parse2(input, options) {
35797
36754
  s0 = peg$currPos;
35798
36755
  s1 = "";
35799
36756
  peg$savedPos = s0;
35800
- s1 = peg$f52();
36757
+ s1 = peg$f59();
35801
36758
  s0 = s1;
35802
36759
  }
35803
36760
  return s0;
@@ -35834,19 +36791,19 @@ function peg$parse2(input, options) {
35834
36791
  let s0, s1;
35835
36792
  peg$silentFails++;
35836
36793
  s0 = input.charAt(peg$currPos);
35837
- if (peg$r3.test(s0)) {
36794
+ if (peg$r5.test(s0)) {
35838
36795
  peg$currPos++;
35839
36796
  } else {
35840
36797
  s0 = peg$FAILED;
35841
36798
  if (peg$silentFails === 0) {
35842
- peg$fail(peg$e36);
36799
+ peg$fail(peg$e39);
35843
36800
  }
35844
36801
  }
35845
36802
  peg$silentFails--;
35846
36803
  if (s0 === peg$FAILED) {
35847
36804
  s1 = peg$FAILED;
35848
36805
  if (peg$silentFails === 0) {
35849
- peg$fail(peg$e35);
36806
+ peg$fail(peg$e38);
35850
36807
  }
35851
36808
  }
35852
36809
  return s0;
@@ -35869,23 +36826,23 @@ function peg$parse2(input, options) {
35869
36826
  s0 = peg$currPos;
35870
36827
  s1 = [];
35871
36828
  s2 = input.charAt(peg$currPos);
35872
- if (peg$r4.test(s2)) {
36829
+ if (peg$r6.test(s2)) {
35873
36830
  peg$currPos++;
35874
36831
  } else {
35875
36832
  s2 = peg$FAILED;
35876
36833
  if (peg$silentFails === 0) {
35877
- peg$fail(peg$e38);
36834
+ peg$fail(peg$e41);
35878
36835
  }
35879
36836
  }
35880
36837
  while (s2 !== peg$FAILED) {
35881
36838
  s1.push(s2);
35882
36839
  s2 = input.charAt(peg$currPos);
35883
- if (peg$r4.test(s2)) {
36840
+ if (peg$r6.test(s2)) {
35884
36841
  peg$currPos++;
35885
36842
  } else {
35886
36843
  s2 = peg$FAILED;
35887
36844
  if (peg$silentFails === 0) {
35888
- peg$fail(peg$e38);
36845
+ peg$fail(peg$e41);
35889
36846
  }
35890
36847
  }
35891
36848
  }
@@ -35901,7 +36858,7 @@ function peg$parse2(input, options) {
35901
36858
  if (s0 === peg$FAILED) {
35902
36859
  s1 = peg$FAILED;
35903
36860
  if (peg$silentFails === 0) {
35904
- peg$fail(peg$e37);
36861
+ peg$fail(peg$e40);
35905
36862
  }
35906
36863
  }
35907
36864
  return s0;
@@ -35910,32 +36867,32 @@ function peg$parse2(input, options) {
35910
36867
  let s0, s1;
35911
36868
  peg$silentFails++;
35912
36869
  if (input.charCodeAt(peg$currPos) === 10) {
35913
- s0 = peg$c31;
36870
+ s0 = peg$c32;
35914
36871
  peg$currPos++;
35915
36872
  } else {
35916
36873
  s0 = peg$FAILED;
35917
36874
  if (peg$silentFails === 0) {
35918
- peg$fail(peg$e40);
36875
+ peg$fail(peg$e43);
35919
36876
  }
35920
36877
  }
35921
36878
  if (s0 === peg$FAILED) {
35922
- if (input.substr(peg$currPos, 2) === peg$c32) {
35923
- s0 = peg$c32;
36879
+ if (input.substr(peg$currPos, 2) === peg$c33) {
36880
+ s0 = peg$c33;
35924
36881
  peg$currPos += 2;
35925
36882
  } else {
35926
36883
  s0 = peg$FAILED;
35927
36884
  if (peg$silentFails === 0) {
35928
- peg$fail(peg$e41);
36885
+ peg$fail(peg$e44);
35929
36886
  }
35930
36887
  }
35931
36888
  if (s0 === peg$FAILED) {
35932
36889
  s0 = input.charAt(peg$currPos);
35933
- if (peg$r5.test(s0)) {
36890
+ if (peg$r7.test(s0)) {
35934
36891
  peg$currPos++;
35935
36892
  } else {
35936
36893
  s0 = peg$FAILED;
35937
36894
  if (peg$silentFails === 0) {
35938
- peg$fail(peg$e42);
36895
+ peg$fail(peg$e45);
35939
36896
  }
35940
36897
  }
35941
36898
  }
@@ -35944,7 +36901,7 @@ function peg$parse2(input, options) {
35944
36901
  if (s0 === peg$FAILED) {
35945
36902
  s1 = peg$FAILED;
35946
36903
  if (peg$silentFails === 0) {
35947
- peg$fail(peg$e39);
36904
+ peg$fail(peg$e42);
35948
36905
  }
35949
36906
  }
35950
36907
  return s0;
@@ -35955,23 +36912,23 @@ function peg$parse2(input, options) {
35955
36912
  s0 = peg$currPos;
35956
36913
  s1 = [];
35957
36914
  s2 = input.charAt(peg$currPos);
35958
- if (peg$r4.test(s2)) {
36915
+ if (peg$r6.test(s2)) {
35959
36916
  peg$currPos++;
35960
36917
  } else {
35961
36918
  s2 = peg$FAILED;
35962
36919
  if (peg$silentFails === 0) {
35963
- peg$fail(peg$e38);
36920
+ peg$fail(peg$e41);
35964
36921
  }
35965
36922
  }
35966
36923
  while (s2 !== peg$FAILED) {
35967
36924
  s1.push(s2);
35968
36925
  s2 = input.charAt(peg$currPos);
35969
- if (peg$r4.test(s2)) {
36926
+ if (peg$r6.test(s2)) {
35970
36927
  peg$currPos++;
35971
36928
  } else {
35972
36929
  s2 = peg$FAILED;
35973
36930
  if (peg$silentFails === 0) {
35974
- peg$fail(peg$e38);
36931
+ peg$fail(peg$e41);
35975
36932
  }
35976
36933
  }
35977
36934
  }
@@ -35987,7 +36944,7 @@ function peg$parse2(input, options) {
35987
36944
  if (s0 === peg$FAILED) {
35988
36945
  s1 = peg$FAILED;
35989
36946
  if (peg$silentFails === 0) {
35990
- peg$fail(peg$e43);
36947
+ peg$fail(peg$e46);
35991
36948
  }
35992
36949
  }
35993
36950
  return s0;
@@ -35996,19 +36953,19 @@ function peg$parse2(input, options) {
35996
36953
  let s0, s1;
35997
36954
  peg$silentFails++;
35998
36955
  s0 = input.charAt(peg$currPos);
35999
- if (peg$r6.test(s0)) {
36956
+ if (peg$r8.test(s0)) {
36000
36957
  peg$currPos++;
36001
36958
  } else {
36002
36959
  s0 = peg$FAILED;
36003
36960
  if (peg$silentFails === 0) {
36004
- peg$fail(peg$e45);
36961
+ peg$fail(peg$e48);
36005
36962
  }
36006
36963
  }
36007
36964
  peg$silentFails--;
36008
36965
  if (s0 === peg$FAILED) {
36009
36966
  s1 = peg$FAILED;
36010
36967
  if (peg$silentFails === 0) {
36011
- peg$fail(peg$e44);
36968
+ peg$fail(peg$e47);
36012
36969
  }
36013
36970
  }
36014
36971
  return s0;