@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.
@@ -573,6 +573,7 @@ var BitType = superenum({
573
573
  surveyRatingOnce: "survey-rating-once",
574
574
  table: "table",
575
575
  tableAlt: "table-alt",
576
+ tableExtended: "table-extended",
576
577
  tableImage: "table-image",
577
578
  tableImageAlt: "table-image-alt",
578
579
  takePicture: "take-picture",
@@ -703,6 +704,7 @@ var CardSetConfigKey = superenum7({
703
704
  matchImagePairs: "matchImagePairs",
704
705
  matchMatrix: "matchMatrix",
705
706
  table: "table",
707
+ tableExtended: "tableExtended",
706
708
  pronunciationTable: "pronunciationTable",
707
709
  botActionResponses: "botActionResponses",
708
710
  exampleBitList: "exampleBitList",
@@ -1193,6 +1195,7 @@ var propertyKeys = {
1193
1195
  property_index: "@index",
1194
1196
  property_internalComment: "@internalComment",
1195
1197
  property_internalPrintPdf: "@internalPrintPdf",
1198
+ property_hasPrintRestriction: "@hasPrintRestriction",
1196
1199
  property_isCaseSensitive: "@isCaseSensitive",
1197
1200
  property_isInfoOnly: "@isInfoOnly",
1198
1201
  property_isPublic: "@isPublic",
@@ -1316,6 +1319,10 @@ var propertyKeys = {
1316
1319
  property_tableSearch: "@tableSearch",
1317
1320
  property_tableSort: "@tableSort",
1318
1321
  property_tableWhitespaceNoWrap: "@tableWhitespaceNoWrap",
1322
+ property_tableCellType: "@tableCellType",
1323
+ property_tableRowSpan: "@tableRowSpan",
1324
+ property_tableColSpan: "@tableColSpan",
1325
+ property_tableScope: "@tableScope",
1319
1326
  property_tag: "@tag",
1320
1327
  property_target: "@target",
1321
1328
  property_technicalTerm: "@technicalTerm",
@@ -2398,6 +2405,47 @@ var CARDSETS = {
2398
2405
  ]
2399
2406
  ]
2400
2407
  },
2408
+ [CardSetConfigKey.tableExtended]: {
2409
+ variants: [
2410
+ // Side 1
2411
+ [
2412
+ // Variant 1..N
2413
+ {
2414
+ tags: [
2415
+ {
2416
+ key: ConfigKey.group_standardItemLeadInstructionHint,
2417
+ description: "Standard tags for lead, instruction, and hint."
2418
+ },
2419
+ {
2420
+ key: ConfigKey.tag_title,
2421
+ description: "Title of the table."
2422
+ },
2423
+ {
2424
+ key: ConfigKey.property_tableCellType,
2425
+ description: "Table cell type (th/td).",
2426
+ format: TagFormat.plainText
2427
+ },
2428
+ {
2429
+ key: ConfigKey.property_tableRowSpan,
2430
+ description: "Number of rows the cell spans.",
2431
+ format: TagFormat.number
2432
+ },
2433
+ {
2434
+ key: ConfigKey.property_tableColSpan,
2435
+ description: "Number of columns the cell spans.",
2436
+ format: TagFormat.number
2437
+ },
2438
+ {
2439
+ key: ConfigKey.property_tableScope,
2440
+ description: "Scope attribute for header cells.",
2441
+ format: TagFormat.plainText
2442
+ }
2443
+ ],
2444
+ repeatCount: Count.infinity
2445
+ }
2446
+ ]
2447
+ ]
2448
+ },
2401
2449
  [CardSetConfigKey.pronunciationTable]: {
2402
2450
  variants: [
2403
2451
  // Side 1
@@ -3272,6 +3320,12 @@ var GROUPS = {
3272
3320
  key: ConfigKey.property_internalPrintPdf,
3273
3321
  description: "Url of the internal print PDF for the book",
3274
3322
  format: TagFormat.plainText
3323
+ },
3324
+ {
3325
+ key: ConfigKey.property_hasPrintRestriction,
3326
+ description: "If true, the book has print restrictions",
3327
+ format: TagFormat.boolean,
3328
+ defaultValue: "true"
3275
3329
  }
3276
3330
  ]
3277
3331
  },
@@ -8519,6 +8573,12 @@ var BITS = {
8519
8573
  ],
8520
8574
  cardSet: CardSetConfigKey.table
8521
8575
  },
8576
+ [BitType.tableExtended]: {
8577
+ since: "4.14.0",
8578
+ baseBitType: BitType.table,
8579
+ description: "Extended table bit, used to create complex tables with all HTML table features",
8580
+ cardSet: CardSetConfigKey.tableExtended
8581
+ },
8522
8582
  [BitType.tableAlt]: {
8523
8583
  since: "1.16.0",
8524
8584
  baseBitType: BitType.table,
@@ -9500,7 +9560,7 @@ var instance2 = new Config();
9500
9560
  // src/generated/package_info.ts
9501
9561
  var PACKAGE_INFO = {
9502
9562
  "name": "@gmb/bitmark-parser-generator",
9503
- "version": "4.13.0",
9563
+ "version": "4.14.0",
9504
9564
  "author": "Get More Brain Ltd",
9505
9565
  "license": "ISC",
9506
9566
  "description": "A bitmark parser and generator using Peggy.js"
@@ -10001,6 +10061,7 @@ var NodeType = superenum20({
10001
10061
  durationValue: "durationValue",
10002
10062
  elements: "elements",
10003
10063
  elementsValue: "elementsValue",
10064
+ elementsValueValue: "elementsValueValue",
10004
10065
  emphasis: "emphasis",
10005
10066
  end: "end",
10006
10067
  errors: "errors",
@@ -10029,6 +10090,7 @@ var NodeType = superenum20({
10029
10090
  focusY: "focusY",
10030
10091
  focusYValue: "focusYValue",
10031
10092
  footer: "footer",
10093
+ footerValue: "footerValue",
10032
10094
  footerText: "footerText",
10033
10095
  forKeys: "forKeys",
10034
10096
  format: "format",
@@ -10051,11 +10113,13 @@ var NodeType = superenum20({
10051
10113
  hasBookNavigationValue: "hasBookNavigationValue",
10052
10114
  hasMarkAsDone: "hasMarkAsDone",
10053
10115
  hasMarkAsDoneValue: "hasMarkAsDoneValue",
10116
+ head: "head",
10054
10117
  heading: "heading",
10055
10118
  height: "height",
10056
10119
  heightValue: "heightValue",
10057
10120
  highlight: "highlight",
10058
10121
  hint: "hint",
10122
+ hintValue: "hintValue",
10059
10123
  href: "href",
10060
10124
  icon: "icon",
10061
10125
  iconTag: "iconTag",
@@ -10077,10 +10141,13 @@ var NodeType = superenum20({
10077
10141
  ingredients: "ingredients",
10078
10142
  ingredientsValue: "ingredientsValue",
10079
10143
  instruction: "instruction",
10144
+ instructionValue: "instructionValue",
10080
10145
  internalComment: "internalComment",
10081
10146
  internalCommentValue: "internalCommentValue",
10082
10147
  internalPrintPdf: "internalPrintPdf",
10083
10148
  internalPrintPdfValue: "internalPrintPdfValue",
10149
+ hasPrintRestriction: "hasPrintRestriction",
10150
+ hasPrintRestrictionValue: "hasPrintRestrictionValue",
10084
10151
  isCaseSensitive: "isCaseSensitive",
10085
10152
  isCommented: "isCommented",
10086
10153
  isCorrect: "isCorrect",
@@ -10099,6 +10166,7 @@ var NodeType = superenum20({
10099
10166
  isTracked: "isTracked",
10100
10167
  isTrackedValue: "isTrackedValue",
10101
10168
  item: "item",
10169
+ itemValue: "itemValue",
10102
10170
  itemLead: "itemLead",
10103
10171
  jobTitle: "jobTitle",
10104
10172
  jobTitleValue: "jobTitleValue",
@@ -10125,6 +10193,7 @@ var NodeType = superenum20({
10125
10193
  layerRoleValue: "layerRoleValue",
10126
10194
  layerValue: "layerValue",
10127
10195
  lead: "lead",
10196
+ leadValue: "leadValue",
10128
10197
  level: "level",
10129
10198
  levelACTFL: "levelACTFL",
10130
10199
  levelACTFLValue: "levelACTFLValue",
@@ -10146,6 +10215,7 @@ var NodeType = superenum20({
10146
10215
  machineTranslatedValue: "machineTranslatedValue",
10147
10216
  mailingList: "mailingList",
10148
10217
  marginNumber: "marginNumber",
10218
+ marginNumberValue: "marginNumberValue",
10149
10219
  mark: "mark",
10150
10220
  markConfig: "markConfig",
10151
10221
  markConfigValue: "markConfigValue",
@@ -10174,6 +10244,7 @@ var NodeType = superenum20({
10174
10244
  pageNo: "pageNo",
10175
10245
  pageNoValue: "pageNoValue",
10176
10246
  pageNumber: "pageNumber",
10247
+ pageNumberValue: "pageNumberValue",
10177
10248
  pageValue: "pageValue",
10178
10249
  pairs: "pairs",
10179
10250
  pairsValue: "pairsValue",
@@ -10257,6 +10328,7 @@ var NodeType = superenum20({
10257
10328
  publisherValue: "publisherValue",
10258
10329
  quantity: "quantity",
10259
10330
  question: "question",
10331
+ questionValue: "questionValue",
10260
10332
  questions: "questions",
10261
10333
  questionsValue: "questionsValue",
10262
10334
  quizCountItems: "quizCountItems",
@@ -10309,6 +10381,10 @@ var NodeType = superenum20({
10309
10381
  revealSolutions: "revealSolutions",
10310
10382
  root: "root",
10311
10383
  // bit type (root)
10384
+ rows: "rows",
10385
+ rowsValue: "rowsValue",
10386
+ rubric: "rubric",
10387
+ rubricValue: "rubricValue",
10312
10388
  sampleSolution: "sampleSolution",
10313
10389
  sampleSolutionValue: "sampleSolutionValue",
10314
10390
  scormSource: "scormSource",
@@ -10914,6 +10990,103 @@ var DeprecatedTextFormat = superenum23({
10914
10990
  // bitmark-- text format, deprecated
10915
10991
  });
10916
10992
 
10993
+ // src/parser/json/TableUtils.ts
10994
+ function isTableBasicFormat(table) {
10995
+ const t = table;
10996
+ return !!(t.columns || t.data) && !(t.head || t.body || t.foot);
10997
+ }
10998
+ function isTableExtendedFormat(table) {
10999
+ const t = table;
11000
+ return !!(t.head || t.body || t.foot);
11001
+ }
11002
+ function isMixedTableFormat(table) {
11003
+ const t = table;
11004
+ const hasOld = !!(t.columns || t.data);
11005
+ const hasNew = !!(t.head || t.body || t.foot);
11006
+ return hasOld && hasNew;
11007
+ }
11008
+ function convertBasicToExtendedTableFormat(table) {
11009
+ const tableExtended = {};
11010
+ if (table.columns && table.columns.length > 0) {
11011
+ tableExtended.head = {
11012
+ rows: [
11013
+ {
11014
+ cells: table.columns.map((col) => ({
11015
+ content: col,
11016
+ title: true
11017
+ }))
11018
+ }
11019
+ ]
11020
+ };
11021
+ }
11022
+ if (table.data && table.data.length > 0) {
11023
+ tableExtended.body = {
11024
+ rows: table.data.map((row) => ({
11025
+ cells: row.map((cell) => ({
11026
+ content: cell
11027
+ }))
11028
+ }))
11029
+ };
11030
+ }
11031
+ return tableExtended;
11032
+ }
11033
+ function convertExtendedToBasicTableFormat(tableExtended) {
11034
+ const table = {};
11035
+ const extractRowCells = (row) => {
11036
+ if (!row || !Array.isArray(row.cells)) {
11037
+ return [];
11038
+ }
11039
+ return row.cells.map((cell) => cell?.content).filter((content) => content !== void 0);
11040
+ };
11041
+ const dataRows = [];
11042
+ const headRows = tableExtended.head?.rows ?? [];
11043
+ if (headRows.length > 0) {
11044
+ const primaryHeader = extractRowCells(headRows[0]);
11045
+ if (primaryHeader.length > 0) {
11046
+ table.columns = primaryHeader;
11047
+ }
11048
+ const remainingHeadRows = headRows.slice(1);
11049
+ remainingHeadRows.forEach((row) => {
11050
+ const cells = extractRowCells(row);
11051
+ if (cells.length > 0) {
11052
+ dataRows.push(cells);
11053
+ }
11054
+ });
11055
+ }
11056
+ const appendSectionRows = (section) => {
11057
+ if (!section || !Array.isArray(section.rows)) {
11058
+ return;
11059
+ }
11060
+ section.rows.forEach((row) => {
11061
+ const cells = extractRowCells(row);
11062
+ if (cells.length > 0) {
11063
+ dataRows.push(cells);
11064
+ }
11065
+ });
11066
+ };
11067
+ appendSectionRows(tableExtended.body);
11068
+ appendSectionRows(tableExtended.foot);
11069
+ if (dataRows.length > 0) {
11070
+ table.data = dataRows;
11071
+ }
11072
+ return table;
11073
+ }
11074
+ function normalizeTableFormat(bitType, table) {
11075
+ if (isMixedTableFormat(table)) {
11076
+ const t = table;
11077
+ delete t.columns;
11078
+ delete t.data;
11079
+ }
11080
+ const isExtended = instance2.isOfBitType(bitType, BitType.tableExtended);
11081
+ if (isExtended && isTableBasicFormat(table)) {
11082
+ return convertBasicToExtendedTableFormat(table);
11083
+ }
11084
+ if (!isExtended && isTableExtendedFormat(table)) {
11085
+ return convertExtendedToBasicTableFormat(table);
11086
+ }
11087
+ return table;
11088
+ }
11089
+
10917
11090
  // src/utils/ArrayUtils.ts
10918
11091
  var ArrayUtils = class {
10919
11092
  /**
@@ -22707,6 +22880,7 @@ var Builder = class extends BaseBuilder {
22707
22880
  * @returns
22708
22881
  */
22709
22882
  buildBit(data, options) {
22883
+ data = structuredClone(data);
22710
22884
  const bitType = data.bitType;
22711
22885
  const bitConfig = instance2.getBitConfig(bitType);
22712
22886
  const deprecatedTextFormat = DeprecatedTextFormat.fromValue(data.textFormat);
@@ -23375,6 +23549,12 @@ var Builder = class extends BaseBuilder {
23375
23549
  data.internalPrintPdf,
23376
23550
  options
23377
23551
  ),
23552
+ hasPrintRestriction: this.toAstProperty(
23553
+ bitType,
23554
+ ConfigKey.property_hasPrintRestriction,
23555
+ data.hasPrintRestriction,
23556
+ options
23557
+ ),
23378
23558
  tocResource: this.toAstProperty(
23379
23559
  bitType,
23380
23560
  ConfigKey.property_tocResource,
@@ -24144,21 +24324,53 @@ var Builder = class extends BaseBuilder {
24144
24324
  return node;
24145
24325
  }
24146
24326
  /**
24147
- * Build table node
24327
+ * Build table / table extended node
24148
24328
  *
24149
24329
  * @param data - data for the node
24150
24330
  * @returns
24151
24331
  */
24152
24332
  buildTable(context, dataIn) {
24153
24333
  if (!dataIn) return void 0;
24154
- const node = {
24155
- columns: (dataIn.columns || []).map(
24334
+ const node = normalizeTableFormat(context.bitType, dataIn);
24335
+ const nodeTable = node;
24336
+ const nodeTableExtended = node;
24337
+ if (Array.isArray(nodeTable.columns) && nodeTable.columns.length > 0) {
24338
+ nodeTable.columns = nodeTable.columns.map(
24156
24339
  (col) => this.handleJsonText(context, TextLocation2.tag, col)
24157
- ),
24158
- data: (dataIn.data || []).map(
24340
+ );
24341
+ }
24342
+ if (Array.isArray(nodeTable.data) && nodeTable.data.length > 0) {
24343
+ nodeTable.data = nodeTable.data.map(
24159
24344
  (row) => (row || []).map((cell) => this.handleJsonText(context, TextLocation2.tag, cell))
24160
- )
24345
+ );
24346
+ }
24347
+ const buildSection = (section) => {
24348
+ if (!section || !Array.isArray(section.rows)) return void 0;
24349
+ const rows = section.rows.map((row) => {
24350
+ const cells = (row.cells || []).map((cell) => {
24351
+ const tableCell = {
24352
+ content: this.handleJsonText(context, TextLocation2.tag, cell.content)
24353
+ };
24354
+ if (cell.title != null) tableCell.title = cell.title;
24355
+ if (cell.rowspan != null) tableCell.rowspan = cell.rowspan;
24356
+ if (cell.colspan != null) tableCell.colspan = cell.colspan;
24357
+ if (cell.scope) tableCell.scope = cell.scope;
24358
+ return tableCell;
24359
+ });
24360
+ return {
24361
+ cells
24362
+ };
24363
+ });
24364
+ return {
24365
+ rows
24366
+ };
24161
24367
  };
24368
+ const head = buildSection(nodeTableExtended.head);
24369
+ if (head && head.rows?.length > 0) nodeTableExtended.head = head;
24370
+ const body = buildSection(nodeTableExtended.body);
24371
+ if (body && body.rows?.length > 0) nodeTableExtended.body = body;
24372
+ const foot = buildSection(nodeTableExtended.foot);
24373
+ if (foot && foot.rows?.length > 0) nodeTableExtended.foot = foot;
24162
24374
  return node;
24163
24375
  }
24164
24376
  /**
@@ -24182,7 +24394,7 @@ var Builder = class extends BaseBuilder {
24182
24394
  if (!data) return void 0;
24183
24395
  const defaultExample = data.__sampleSolutionAst;
24184
24396
  const node = {
24185
- question: data.question ?? "",
24397
+ question: this.handleJsonText(context, TextLocation2.body, data.question),
24186
24398
  partialAnswer: data.partialAnswer ?? "",
24187
24399
  sampleSolution: data.sampleSolution ?? "",
24188
24400
  additionalSolutions: data.additionalSolutions ?? void 0,
@@ -24196,9 +24408,9 @@ var Builder = class extends BaseBuilder {
24196
24408
  };
24197
24409
  objectUtils.removeUnwantedProperties(node, {
24198
24410
  ignoreAllFalse: true,
24199
- ignoreEmptyArrays: ["item", "hint", "instruction"],
24411
+ ignoreEmptyArrays: ["question", "item", "hint", "instruction"],
24200
24412
  ignoreUndefined: ["example"],
24201
- ignoreEmptyString: ["question", "partialAnswer", "sampleSolution"]
24413
+ ignoreEmptyString: ["partialAnswer", "sampleSolution"]
24202
24414
  });
24203
24415
  return node;
24204
24416
  }
@@ -24736,7 +24948,7 @@ var Builder = class extends BaseBuilder {
24736
24948
  buildStatement(context, data) {
24737
24949
  if (!data) return void 0;
24738
24950
  const node = {
24739
- statement: data.statement ?? "",
24951
+ statement: this.handleJsonText(context, TextLocation2.tag, data.statement),
24740
24952
  isCorrect: !!data.isCorrect,
24741
24953
  item: this.handleJsonText(context, TextLocation2.tag, data.item),
24742
24954
  lead: this.handleJsonText(context, TextLocation2.tag, data.lead),
@@ -24746,7 +24958,7 @@ var Builder = class extends BaseBuilder {
24746
24958
  };
24747
24959
  objectUtils.removeUnwantedProperties(node, {
24748
24960
  ignoreAllFalse: true,
24749
- // ignoreAllEmptyArrays: true,
24961
+ ignoreEmptyArrays: ["statement"],
24750
24962
  ignoreUndefined: ["example"]
24751
24963
  });
24752
24964
  return node;
@@ -24958,7 +25170,7 @@ var Builder = class extends BaseBuilder {
24958
25170
  const node = {
24959
25171
  heading: this.buildHeading(context, data.heading),
24960
25172
  questions: this.buildQuestions(context, data.questions),
24961
- elements: data.elements,
25173
+ elements: this.handleJsonText(context, TextLocation2.body, data.elements),
24962
25174
  flashcards: this.buildFlashcards(context, data.flashcards),
24963
25175
  definitions: this.buildDefinitionList(context, data.definitions ?? data.legend),
24964
25176
  statement: this.buildStatement(context, data.statement),
@@ -24977,7 +25189,9 @@ var Builder = class extends BaseBuilder {
24977
25189
  // captionDefinitionList: this.buildCaptionDefinitionList(context, data.captionDefinitionList),
24978
25190
  cardBits: this.buildCardBits(context, data.cardBits)
24979
25191
  };
24980
- objectUtils.removeUnwantedProperties(node);
25192
+ objectUtils.removeUnwantedProperties(node, {
25193
+ ignoreEmptyObjects: ["table"]
25194
+ });
24981
25195
  return Object.keys(node).length > 0 ? node : void 0;
24982
25196
  }
24983
25197
  /**
@@ -25481,6 +25695,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
25481
25695
  __publicField(this, "hasCardSet", false);
25482
25696
  __publicField(this, "hasFooter", false);
25483
25697
  __publicField(this, "inTag", true);
25698
+ __publicField(this, "skipTableTraversal", false);
25484
25699
  this.enter = this.enter.bind(this);
25485
25700
  this.between = this.between.bind(this);
25486
25701
  this.exit = this.exit.bind(this);
@@ -26183,7 +26398,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26183
26398
  enter_elements(_node, _route) {
26184
26399
  }
26185
26400
  between_elements(_node, _left, _right, _route) {
26186
- this.writeCardSetVariantDivider();
26401
+ this.writeCardSetSideDivider();
26187
26402
  }
26188
26403
  // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards
26189
26404
  between_flashcards(_node, _left, _right, _route) {
@@ -26310,6 +26525,7 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26310
26525
  enter_matrix(_node, _route) {
26311
26526
  }
26312
26527
  between_matrix(_node, _left, _right, _route) {
26528
+ if (!this.isCardAllowed) return;
26313
26529
  this.writeCardSetCardDivider();
26314
26530
  }
26315
26531
  // bitmarkAst -> bits -> bitsValue -> cardNode -> pairs -> pairsValue -> values
@@ -26330,12 +26546,83 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26330
26546
  this.writeCardSetCardDivider();
26331
26547
  }
26332
26548
  // bitmarkAst -> bits -> bitsValue -> cardNode -> table
26549
+ enter_table(node, route) {
26550
+ const parent = this.getParentNode(route);
26551
+ if (parent?.key !== NodeType.cardNode) return true;
26552
+ const table = node.value;
26553
+ if (!table) return true;
26554
+ if (this.writeAdvancedTable(table)) {
26555
+ return false;
26556
+ }
26557
+ return true;
26558
+ }
26333
26559
  between_table(_node, _left, _right, route) {
26334
26560
  const parent = this.getParentNode(route);
26335
26561
  if (parent?.key !== NodeType.cardNode) return;
26336
26562
  if (!this.isCardAllowed) return;
26337
26563
  this.writeCardSetCardDivider();
26338
26564
  }
26565
+ writeAdvancedTable(table) {
26566
+ const normalized = normalizeTableFormat(BitType.tableExtended, table);
26567
+ const sections = [
26568
+ { key: "thead", qualifier: "thead", section: normalized.head },
26569
+ { key: "tbody", qualifier: void 0, section: normalized.body },
26570
+ { key: "tfoot", qualifier: "tfoot", section: normalized.foot }
26571
+ ];
26572
+ let rowCount = 0;
26573
+ for (const { key, qualifier, section } of sections) {
26574
+ const rows = section?.rows ?? [];
26575
+ if (rows.length === 0) {
26576
+ continue;
26577
+ }
26578
+ for (const row of rows) {
26579
+ this.writeCardSetCardDivider(qualifier);
26580
+ this.writeTableRow(row, key);
26581
+ rowCount++;
26582
+ }
26583
+ }
26584
+ return rowCount > 0;
26585
+ }
26586
+ writeTableRow(row, section) {
26587
+ const cells = row?.cells ?? [];
26588
+ if (cells.length === 0) return;
26589
+ for (let index = 0; index < cells.length; index++) {
26590
+ if (index > 0) {
26591
+ this.writeCardSetSideDivider();
26592
+ }
26593
+ this.writeNL();
26594
+ this.writeTableCell(cells[index], section);
26595
+ }
26596
+ }
26597
+ writeTableCell(cell, section) {
26598
+ const defaultCellType = section === "tbody" ? "td" : "th";
26599
+ const cellType = cell.title ? "th" : "td";
26600
+ if (cellType !== defaultCellType) {
26601
+ this.writeTableCellProperty("tableCellType", cellType);
26602
+ this.writeNL();
26603
+ }
26604
+ if (cell.rowspan && cell.rowspan > 1) {
26605
+ this.writeTableCellProperty("tableRowSpan", cell.rowspan);
26606
+ this.writeNL();
26607
+ }
26608
+ if (cell.colspan && cell.colspan > 1) {
26609
+ this.writeTableCellProperty("tableColSpan", cell.colspan);
26610
+ this.writeNL();
26611
+ }
26612
+ if (cell.scope) {
26613
+ this.writeTableCellProperty("tableScope", cell.scope);
26614
+ this.writeNL();
26615
+ }
26616
+ const content = cell.content ?? instance3.EMPTY_STRING;
26617
+ this.writeTextOrValue(content, this.textFormat, TextLocation2.body);
26618
+ }
26619
+ writeTableCellProperty(name, value) {
26620
+ this.writeOPA();
26621
+ this.writeTagKey(name);
26622
+ this.writeColon();
26623
+ this.writeTextOrValue(`${value}`, TextFormat2.plainText, TextLocation2.tag);
26624
+ this.writeCL();
26625
+ }
26339
26626
  // bitmarkAst -> bits -> bitsValue -> cardNode -> table -> data
26340
26627
  // bitmarkAst -> bits -> bitsValue -> cardNode -> pronunciationTable -> data
26341
26628
  between_data(_node, _left, _right, route) {
@@ -26857,8 +27144,8 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26857
27144
  } else {
26858
27145
  }
26859
27146
  }
26860
- // bitmarkAst -> bits -> bitsValue -> elements -> elementsValue
26861
- leaf_elementsValue(node, _route) {
27147
+ // bitmarkAst -> bits -> bitsValue -> cardNode -> elements -> elementsValue
27148
+ enter_elementsValue(node, _route) {
26862
27149
  if (node.value) {
26863
27150
  this.writeNL();
26864
27151
  this.writeTextOrValue(node.value, this.textFormat, TextLocation2.body);
@@ -26941,10 +27228,19 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
26941
27228
  }
26942
27229
  }
26943
27230
  // bitmarkAst -> bits -> bitsValue -> questions -> questionsValue -> question
27231
+ // bitmarkAst -> bits -> bitsValue -> cardNode -> questions -> questionsValue -> question
27232
+ enter_question(node, route) {
27233
+ const parent = this.getParentNode(route);
27234
+ if (parent?.key !== NodeType.questionsValue) return;
27235
+ if (node.value) {
27236
+ this.writeNL();
27237
+ this.writeTextOrValue(node.value, this.textFormat, TextLocation2.body);
27238
+ }
27239
+ }
26944
27240
  // bitmarkAst -> bits -> bitsValue -> cardNode -> flashcards -> flashcardsValue -> question
26945
27241
  leaf_question(node, route) {
26946
27242
  const parent = this.getParentNode(route);
26947
- if (parent?.key !== NodeType.questionsValue && parent?.key !== NodeType.flashcardsValue) return;
27243
+ if (parent?.key !== NodeType.flashcardsValue) return;
26948
27244
  if (node.value) {
26949
27245
  this.writeNL();
26950
27246
  this.writeTextOrValue(node.value, this.textFormat, TextLocation2.body);
@@ -27420,12 +27716,12 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27420
27716
  } else {
27421
27717
  }
27422
27718
  }
27423
- writeCardSetCardDivider() {
27719
+ writeCardSetCardDivider(qualifier) {
27424
27720
  this.writeNL();
27425
- if (this.options.cardSetVersion === CardSetVersion.v1) {
27426
- this.write("===");
27427
- } else {
27428
- this.write("====");
27721
+ const divider = this.getCardDividerMarker();
27722
+ this.write(divider);
27723
+ if (qualifier) {
27724
+ this.appendCardDividerQualifier(qualifier);
27429
27725
  }
27430
27726
  }
27431
27727
  writeCardSetSideDivider() {
@@ -27444,6 +27740,20 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27444
27740
  this.write("++");
27445
27741
  }
27446
27742
  }
27743
+ getCardDividerMarker() {
27744
+ return this.options.cardSetVersion === CardSetVersion.v1 ? "===" : "====";
27745
+ }
27746
+ appendCardDividerQualifier(qualifier) {
27747
+ const marker = this.getCardDividerMarker();
27748
+ const normalizedQualifier = instance3.breakscape(qualifier, {
27749
+ format: TextFormat2.plainText,
27750
+ location: TextLocation2.tag
27751
+ });
27752
+ this.write(" ");
27753
+ this.write(normalizedQualifier);
27754
+ this.write(" ");
27755
+ this.write(marker);
27756
+ }
27447
27757
  writeNL_IfNotChain(route) {
27448
27758
  if (!this.isChain(route)) {
27449
27759
  this.writeNL();
@@ -27548,7 +27858,10 @@ var BitmarkGenerator = class extends AstWalkerGenerator {
27548
27858
  return !!writeFormat;
27549
27859
  }
27550
27860
  calculateIsCardAllowed() {
27551
- return this.isBodyBitmarkText && !this.isOfBitType1();
27861
+ return this.isBodyBitmarkText && !this.isOfBitType1() && !this.isTableBitType();
27862
+ }
27863
+ isTableBitType() {
27864
+ return this.isOfBitType([BitType.table]);
27552
27865
  }
27553
27866
  isOfBitType1() {
27554
27867
  return this.isOfBitType([
@@ -28065,7 +28378,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
28065
28378
  const parent = this.getParentNode(route);
28066
28379
  if (parent?.key !== NodeType.cardNode) return;
28067
28380
  if (statement) {
28068
- this.bitJson.statement = statement.statement ?? "";
28381
+ this.bitJson.statement = statement.statement ?? [];
28069
28382
  this.bitJson.isCorrect = statement.isCorrect ?? false;
28070
28383
  this.bitJson.example = statement.example;
28071
28384
  this.bitJson.isExample = statement.isExample;
@@ -28687,6 +29000,9 @@ var JsonGenerator = class extends AstWalkerGenerator {
28687
29000
  if (bitJson.footer == null) bitJson.footer = this.textDefault;
28688
29001
  if (bitJson.questions == null) bitJson.questions = [];
28689
29002
  }
29003
+ if (instance2.isOfBitType(bitType, BitType.sequence)) {
29004
+ if (bitJson.elements == null) bitJson.elements = [];
29005
+ }
28690
29006
  if (bitType === BitType.matchMatrix) {
28691
29007
  isTopLevelExample = true;
28692
29008
  }
@@ -28747,6 +29063,7 @@ var JsonGenerator = class extends AstWalkerGenerator {
28747
29063
  }
28748
29064
  if (instance2.isOfBitType(bitType, BitType.book)) {
28749
29065
  if (bitJson.maxTocChapterLevel == null) bitJson.maxTocChapterLevel = -1;
29066
+ if (bitJson.hasPrintRestriction == null) bitJson.hasPrintRestriction = true;
28750
29067
  if (bitJson.hasMarkAsDone == null) bitJson.hasMarkAsDone = false;
28751
29068
  if (bitJson.processHandIn == null) bitJson.processHandIn = false;
28752
29069
  if (bitJson.isPublic == null) bitJson.isPublic = false;
@@ -29400,6 +29717,9 @@ var BitmarkPegParserHelper = class {
29400
29717
  __publicField(this, "cardIndex", 0);
29401
29718
  __publicField(this, "cardSideIndex", 0);
29402
29719
  __publicField(this, "cardVariantIndex", 0);
29720
+ __publicField(this, "currentCardQualifier");
29721
+ __publicField(this, "currentSideQualifier");
29722
+ __publicField(this, "currentVariantQualifier");
29403
29723
  __publicField(this, "parse");
29404
29724
  __publicField(this, "parserText");
29405
29725
  __publicField(this, "parserLocation");
@@ -29568,30 +29888,43 @@ var BitmarkPegParserHelper = class {
29568
29888
  cardIndex,
29569
29889
  cardSideIndex,
29570
29890
  cardVariantIndex: cardContentIndex,
29571
- value: value2
29891
+ value: value2,
29892
+ cardQualifier,
29893
+ cardSideQualifier,
29894
+ cardVariantQualifier
29572
29895
  } = cardData;
29573
29896
  let card = unparsedCardSet.cards[cardIndex];
29574
29897
  if (!card) {
29575
29898
  card = {
29576
- sides: []
29899
+ sides: [],
29900
+ qualifier: cardQualifier
29577
29901
  };
29578
29902
  unparsedCardSet.cards[cardIndex] = card;
29903
+ } else if (cardQualifier && !card.qualifier) {
29904
+ card.qualifier = cardQualifier;
29579
29905
  }
29580
29906
  let side = card.sides[cardSideIndex];
29581
29907
  if (!side) {
29582
29908
  side = {
29583
- variants: []
29909
+ variants: [],
29910
+ qualifier: cardSideQualifier
29584
29911
  };
29585
29912
  card.sides[cardSideIndex] = side;
29913
+ } else if (cardSideQualifier && !side.qualifier) {
29914
+ side.qualifier = cardSideQualifier;
29586
29915
  }
29587
29916
  const variant = side.variants[cardContentIndex];
29588
29917
  if (!variant) {
29589
29918
  side.variants[cardContentIndex] = {
29590
29919
  value: value2,
29591
- parser: parser3
29920
+ parser: parser3,
29921
+ qualifier: cardVariantQualifier
29592
29922
  };
29593
29923
  } else {
29594
29924
  side.variants[cardContentIndex].value += value2;
29925
+ if (cardVariantQualifier && !variant.qualifier) {
29926
+ variant.qualifier = cardVariantQualifier;
29927
+ }
29595
29928
  }
29596
29929
  }
29597
29930
  unparsedCardSet.cards = unparsedCardSet.cards.filter((card) => {
@@ -29604,12 +29937,14 @@ var BitmarkPegParserHelper = class {
29604
29937
  });
29605
29938
  for (const unparsedCard of unparsedCardSet.cards) {
29606
29939
  const card = {
29607
- sides: []
29940
+ sides: [],
29941
+ qualifier: unparsedCard.qualifier
29608
29942
  };
29609
29943
  cardSet.cards.push(card);
29610
29944
  for (const unparsedSide of unparsedCard.sides) {
29611
29945
  const side = {
29612
- variants: []
29946
+ variants: [],
29947
+ qualifier: unparsedSide.qualifier
29613
29948
  };
29614
29949
  card.sides.push(side);
29615
29950
  for (const unparsedContent of unparsedSide.variants) {
@@ -29634,7 +29969,8 @@ var BitmarkPegParserHelper = class {
29634
29969
  if (DEBUG_TRACE_CARD_PARSED) this.debugPrint("parsedCardContent", content);
29635
29970
  side.variants.push({
29636
29971
  parser: parser2,
29637
- content
29972
+ content,
29973
+ qualifier: unparsedContent.qualifier
29638
29974
  });
29639
29975
  }
29640
29976
  }
@@ -29654,12 +29990,18 @@ var BitmarkPegParserHelper = class {
29654
29990
  this.cardIndex = -1;
29655
29991
  this.cardSideIndex = 0;
29656
29992
  this.cardVariantIndex = 0;
29993
+ this.currentCardQualifier = void 0;
29994
+ this.currentSideQualifier = void 0;
29995
+ this.currentVariantQualifier = void 0;
29657
29996
  }
29658
29997
  handleCardSetEnd() {
29659
29998
  if (DEBUG_TRACE_CARD_SET_END) this.debugPrint("CardSetEnd");
29660
29999
  this.cardIndex = 0;
29661
30000
  this.cardSideIndex = 0;
29662
30001
  this.cardVariantIndex = 0;
30002
+ this.currentCardQualifier = void 0;
30003
+ this.currentSideQualifier = void 0;
30004
+ this.currentVariantQualifier = void 0;
29663
30005
  }
29664
30006
  handleCards(value) {
29665
30007
  return value;
@@ -29669,27 +30011,45 @@ var BitmarkPegParserHelper = class {
29669
30011
  let isCardDivider = false;
29670
30012
  let isSideDivider = false;
29671
30013
  let isVariantDivider = false;
30014
+ let qualifier;
29672
30015
  if (Array.isArray(value) && value.length === 2) {
29673
- value = value[0];
29674
- if (version === CardSetVersion.v1) {
29675
- isCardDivider = value === CARD_DIVIDER_V1;
29676
- isSideDivider = value === CARD_SIDE_DIVIDER_V1;
29677
- isVariantDivider = value === CARD_VARIANT_DIVIDER_V1;
30016
+ const [divider, maybeQualifier] = value;
30017
+ if (typeof divider === "string") {
30018
+ value = divider;
30019
+ if (typeof maybeQualifier === "string" && maybeQualifier.trim() === maybeQualifier && maybeQualifier.length > 0) {
30020
+ qualifier = maybeQualifier;
30021
+ }
29678
30022
  } else {
29679
- isCardDivider = value === CARD_DIVIDER_V2;
29680
- isSideDivider = value === CARD_SIDE_DIVIDER_V2;
29681
- isVariantDivider = value === CARD_VARIANT_DIVIDER_V2;
30023
+ value = divider;
29682
30024
  }
30025
+ } else if (Array.isArray(value) && value.length === 1) {
30026
+ const [divider] = value;
30027
+ value = divider;
30028
+ }
30029
+ if (version === CardSetVersion.v1) {
30030
+ isCardDivider = value === CARD_DIVIDER_V1;
30031
+ isSideDivider = value === CARD_SIDE_DIVIDER_V1;
30032
+ isVariantDivider = value === CARD_VARIANT_DIVIDER_V1;
30033
+ } else {
30034
+ isCardDivider = value === CARD_DIVIDER_V2;
30035
+ isSideDivider = value === CARD_SIDE_DIVIDER_V2;
30036
+ isVariantDivider = value === CARD_VARIANT_DIVIDER_V2;
29683
30037
  }
29684
30038
  if (isCardDivider) {
29685
30039
  this.cardIndex++;
29686
30040
  this.cardSideIndex = 0;
29687
30041
  this.cardVariantIndex = 0;
30042
+ this.currentCardQualifier = qualifier;
30043
+ this.currentSideQualifier = void 0;
30044
+ this.currentVariantQualifier = void 0;
29688
30045
  } else if (isSideDivider) {
29689
30046
  this.cardSideIndex++;
29690
30047
  this.cardVariantIndex = 0;
30048
+ this.currentSideQualifier = qualifier;
30049
+ this.currentVariantQualifier = void 0;
29691
30050
  } else if (isVariantDivider) {
29692
30051
  this.cardVariantIndex++;
30052
+ this.currentVariantQualifier = qualifier;
29693
30053
  }
29694
30054
  if (this.isType(value, TypeKey.Card)) return value;
29695
30055
  return {
@@ -29698,7 +30058,10 @@ var BitmarkPegParserHelper = class {
29698
30058
  cardIndex: this.cardIndex,
29699
30059
  cardSideIndex: this.cardSideIndex,
29700
30060
  cardVariantIndex: this.cardVariantIndex,
29701
- value: ""
30061
+ value: "",
30062
+ cardQualifier: this.currentCardQualifier,
30063
+ cardSideQualifier: this.currentSideQualifier,
30064
+ cardVariantQualifier: this.currentVariantQualifier
29702
30065
  },
29703
30066
  parser: {
29704
30067
  text: this.parserText(),
@@ -29719,7 +30082,10 @@ var BitmarkPegParserHelper = class {
29719
30082
  cardIndex: this.cardIndex,
29720
30083
  cardSideIndex: this.cardSideIndex,
29721
30084
  cardVariantIndex: this.cardVariantIndex,
29722
- value
30085
+ value,
30086
+ cardQualifier: this.currentCardQualifier,
30087
+ cardSideQualifier: this.currentSideQualifier,
30088
+ cardVariantQualifier: this.currentVariantQualifier
29723
30089
  },
29724
30090
  parser: {
29725
30091
  text: this.parserText(),
@@ -30802,6 +31168,7 @@ function buildCards(context, bitType, textFormat, parsedCardSet, statementV1, st
30802
31168
  result = parsePronunciationTable(context, bitType, processedCardSet);
30803
31169
  break;
30804
31170
  case CardSetConfigKey.table:
31171
+ case CardSetConfigKey.tableExtended:
30805
31172
  result = parseTable(context, bitType, processedCardSet);
30806
31173
  break;
30807
31174
  case CardSetConfigKey.botActionResponses:
@@ -30838,20 +31205,23 @@ function processCardSet(context, parsedCardSet) {
30838
31205
  for (const card of parsedCardSet.cards) {
30839
31206
  const processedCard = {
30840
31207
  no: cardNo++,
30841
- sides: []
31208
+ sides: [],
31209
+ qualifier: card.qualifier
30842
31210
  };
30843
31211
  processedCardSet.cards.push(processedCard);
30844
31212
  for (const side of card.sides) {
30845
31213
  const processedSide = {
30846
31214
  no: sideNo++,
30847
- variants: []
31215
+ variants: [],
31216
+ qualifier: side.qualifier
30848
31217
  };
30849
31218
  processedCard.sides.push(processedSide);
30850
31219
  for (const variant of side.variants) {
30851
31220
  const { parser: parser2, content } = variant;
30852
31221
  const processedVariant = {
30853
31222
  parser: parser2,
30854
- no: variantNo++
31223
+ no: variantNo++,
31224
+ qualifier: variant.qualifier
30855
31225
  };
30856
31226
  processedSide.variants.push(processedVariant);
30857
31227
  const tagsConfig = instance2.getTagsConfigForCardSet(bitType, sideNo, variantNo);
@@ -30965,7 +31335,8 @@ function parseElements(_context, _bitType, cardSet) {
30965
31335
  for (const side of card.sides) {
30966
31336
  for (const content of side.variants) {
30967
31337
  const tags2 = content.data;
30968
- elements.push(tags2.cardBodyStr ?? "");
31338
+ const element = tags2.cardBody?.body ?? tags2.cardBodyStr ?? instance3.EMPTY_STRING;
31339
+ elements.push(element);
30969
31340
  }
30970
31341
  }
30971
31342
  }
@@ -30982,7 +31353,7 @@ function parseStatements(_context, _bitType, cardSet, statementV1, statementsV1)
30982
31353
  if (Array.isArray(chainedStatements)) {
30983
31354
  for (const s of chainedStatements) {
30984
31355
  const statement = {
30985
- statement: s.statement ?? "",
31356
+ statement: s.statement ?? [],
30986
31357
  isCorrect: s.isCorrect,
30987
31358
  item: s.item,
30988
31359
  lead: s.lead,
@@ -31124,7 +31495,7 @@ function parseQuestions(_context, _bitType, cardSet) {
31124
31495
  for (const content of side.variants) {
31125
31496
  const tags2 = content.data;
31126
31497
  const q = {
31127
- question: tags2.cardBodyStr ?? "",
31498
+ question: tags2.cardBody?.body ?? tags2.cardBodyStr ?? instance3.EMPTY_STRING,
31128
31499
  ...tags2
31129
31500
  };
31130
31501
  if (q) questions.push(q);
@@ -31328,37 +31699,158 @@ function parsePronunciationTable(_context, _bitType, cardSet) {
31328
31699
  };
31329
31700
  return { pronunciationTable: table };
31330
31701
  }
31331
- function parseTable(_context, _bitType, cardSet) {
31332
- let isHeading = false;
31333
- const columns = [];
31334
- const rows = [];
31335
- let rowValues = [];
31702
+ function parseTable(context, _bitType, cardSet) {
31703
+ const sectionRows = {
31704
+ thead: [],
31705
+ tbody: [],
31706
+ tfoot: []
31707
+ };
31708
+ const getNormalizedQualifier = (rawQualifier) => {
31709
+ if (!rawQualifier) return void 0;
31710
+ const normalized = rawQualifier.trim().toLowerCase();
31711
+ if (normalized === "thead" || normalized === "tbody" || normalized === "tfoot") {
31712
+ return normalized;
31713
+ }
31714
+ context.addWarning(`Unknown table section qualifier '${rawQualifier}', defaulting to tbody.`);
31715
+ return void 0;
31716
+ };
31717
+ const isLegacyHeadingRow = (card, cardIndex) => {
31718
+ if (cardIndex !== 0) return false;
31719
+ return card.sides.some(
31720
+ (side) => side.variants.some((variant) => {
31721
+ const titles = variant.data.title;
31722
+ return Array.isArray(titles) && titles[1]?.titleAst;
31723
+ })
31724
+ );
31725
+ };
31726
+ const readExtraProperty = (extra, key) => {
31727
+ if (!extra) return void 0;
31728
+ const value = extra[key];
31729
+ return Array.isArray(value) ? value[0] : value;
31730
+ };
31731
+ const cleanupExtraProperties = (tags2, keys) => {
31732
+ const extra = tags2.extraProperties;
31733
+ if (!extra) return;
31734
+ for (const key of keys) {
31735
+ if (Object.prototype.hasOwnProperty.call(extra, key)) delete extra[key];
31736
+ }
31737
+ if (Object.keys(extra).length === 0) {
31738
+ delete tags2.extraProperties;
31739
+ }
31740
+ };
31741
+ const normalizeCellType = (raw, section) => {
31742
+ if (typeof raw === "string") {
31743
+ const normalized = raw.trim().toLowerCase();
31744
+ if (normalized === "th" || normalized === "td") {
31745
+ return normalized;
31746
+ }
31747
+ context.addWarning(
31748
+ `Invalid table cell type '${raw}', using default for section '${section}'.`
31749
+ );
31750
+ }
31751
+ return section === "tbody" ? "td" : "th";
31752
+ };
31753
+ const normalizeSpan = (raw, kind) => {
31754
+ if (raw == null) return 1;
31755
+ const numeric = instance6.asNumber(raw);
31756
+ if (numeric == null || !Number.isInteger(numeric) || numeric < 1) {
31757
+ context.addWarning(`Invalid table ${kind} '${raw}', defaulting to 1.`);
31758
+ return 1;
31759
+ }
31760
+ return numeric;
31761
+ };
31762
+ const normalizeScope = (raw) => {
31763
+ if (raw == null) return void 0;
31764
+ if (typeof raw !== "string") {
31765
+ context.addWarning(`Invalid table scope '${raw}', ignoring.`);
31766
+ return void 0;
31767
+ }
31768
+ const normalized = raw.trim().toLowerCase();
31769
+ switch (normalized) {
31770
+ case "row":
31771
+ case "col":
31772
+ case "rowgroup":
31773
+ case "colgroup":
31774
+ return normalized;
31775
+ default:
31776
+ context.addWarning(`Invalid table scope '${raw}', ignoring.`);
31777
+ return void 0;
31778
+ }
31779
+ };
31780
+ const buildCell = (variant, section) => {
31781
+ const tags2 = variant.data;
31782
+ const heading = tags2.title && tags2.title[1]?.titleAst;
31783
+ const bodyContent = tags2.cardBody?.body ?? tags2.cardBodyStr ?? instance3.EMPTY_STRING;
31784
+ const content = heading ?? bodyContent;
31785
+ const cellTypeRaw = tags2.tableCellType ?? readExtraProperty(tags2.extraProperties, "tableCellType");
31786
+ const rowSpanRaw = tags2.tableRowSpan ?? readExtraProperty(tags2.extraProperties, "tableRowSpan");
31787
+ const colSpanRaw = tags2.tableColSpan ?? readExtraProperty(tags2.extraProperties, "tableColSpan");
31788
+ const scopeRaw = tags2.tableScope ?? readExtraProperty(tags2.extraProperties, "tableScope");
31789
+ cleanupExtraProperties(tags2, ["tableCellType", "tableRowSpan", "tableColSpan", "tableScope"]);
31790
+ const cellType = normalizeCellType(cellTypeRaw, section);
31791
+ const rowspan = normalizeSpan(rowSpanRaw, "rowspan");
31792
+ const colspan = normalizeSpan(colSpanRaw, "colspan");
31793
+ const scope = normalizeScope(scopeRaw);
31794
+ const cell = {
31795
+ content
31796
+ };
31797
+ if (cellType === "th") cell.title = true;
31798
+ if (rowspan > 1) cell.rowspan = rowspan;
31799
+ if (colspan > 1) cell.colspan = colspan;
31800
+ if (scope) cell.scope = scope;
31801
+ return cell;
31802
+ };
31803
+ const resolveSectionQualifier = (card) => {
31804
+ const cardQualifier = getNormalizedQualifier(card.qualifier);
31805
+ if (cardQualifier) return cardQualifier;
31806
+ for (const side of card.sides) {
31807
+ const sideQualifier = getNormalizedQualifier(side.qualifier);
31808
+ if (sideQualifier) return sideQualifier;
31809
+ for (const variant of side.variants) {
31810
+ const variantQualifier = getNormalizedQualifier(variant.qualifier);
31811
+ if (variantQualifier) return variantQualifier;
31812
+ }
31813
+ }
31814
+ return void 0;
31815
+ };
31336
31816
  for (let cardIdx = 0; cardIdx < cardSet.cards.length; cardIdx++) {
31337
31817
  const card = cardSet.cards[cardIdx];
31338
- isHeading = false;
31339
- rowValues = [];
31818
+ const qualifier = resolveSectionQualifier(card);
31819
+ const section = qualifier ? qualifier : isLegacyHeadingRow(card, cardIdx) ? "thead" : "tbody";
31820
+ const cells = [];
31340
31821
  for (const side of card.sides) {
31341
- for (const content of side.variants) {
31342
- const tags2 = content.data;
31343
- const { title, cardBody } = tags2;
31344
- const heading = title && title[1].titleAst;
31345
- if (cardIdx === 0 && heading != null) isHeading = true;
31346
- if (isHeading) {
31347
- columns.push(heading ?? []);
31348
- } else {
31349
- const value = cardBody?.body ?? [];
31350
- rowValues.push(value);
31351
- }
31822
+ for (const variant of side.variants) {
31823
+ cells.push(buildCell(variant, section));
31352
31824
  }
31353
31825
  }
31354
- if (!isHeading) {
31355
- rows.push(rowValues);
31356
- }
31826
+ sectionRows[section].push({
31827
+ cells
31828
+ });
31829
+ }
31830
+ const table = {};
31831
+ const hasHeadRows = sectionRows.thead.length > 0;
31832
+ const hasBodyRows = sectionRows.tbody.length > 0;
31833
+ const hasFootRows = sectionRows.tfoot.length > 0;
31834
+ if (hasHeadRows) {
31835
+ table.head = {
31836
+ rows: sectionRows.thead
31837
+ };
31838
+ }
31839
+ if (hasBodyRows) {
31840
+ table.body = {
31841
+ rows: sectionRows.tbody
31842
+ };
31843
+ }
31844
+ if (hasFootRows) {
31845
+ table.foot = {
31846
+ rows: sectionRows.tfoot
31847
+ };
31848
+ }
31849
+ if (!hasHeadRows && !hasBodyRows && !hasFootRows) {
31850
+ table.head = { rows: [] };
31851
+ table.body = { rows: [] };
31852
+ table.foot = { rows: [] };
31357
31853
  }
31358
- const table = {
31359
- columns,
31360
- data: rows
31361
- };
31362
31854
  return { table };
31363
31855
  }
31364
31856
  function parseBotActionResponses(_context, _bitType, cardSet) {
@@ -31509,11 +32001,11 @@ function extractHeadingCard(cardSet, valuesIsArray = false) {
31509
32001
  function defaultTagContentProcessor(context, _contentDepth, _tagsConfig, content, target) {
31510
32002
  const { type, value } = content;
31511
32003
  const { textFormat } = context;
31512
- const textParser9 = new TextParser();
32004
+ const textParser10 = new TextParser();
31513
32005
  const trimmedStringValue = stringUtils.trimmedString(value);
31514
32006
  switch (type) {
31515
32007
  case TypeKey.Instruction: {
31516
- target.instruction = textParser9.toAst(trimmedStringValue, {
32008
+ target.instruction = textParser10.toAst(trimmedStringValue, {
31517
32009
  format: textFormat,
31518
32010
  location: TextLocation2.tag
31519
32011
  });
@@ -31524,7 +32016,7 @@ function defaultTagContentProcessor(context, _contentDepth, _tagsConfig, content
31524
32016
  break;
31525
32017
  }
31526
32018
  case TypeKey.Hint: {
31527
- target.hint = textParser9.toAst(trimmedStringValue, {
32019
+ target.hint = textParser10.toAst(trimmedStringValue, {
31528
32020
  format: textFormat,
31529
32021
  location: TextLocation2.tag
31530
32022
  });
@@ -31554,7 +32046,7 @@ function defaultTagContentProcessor(context, _contentDepth, _tagsConfig, content
31554
32046
  format: TextFormat2.bitmarkText,
31555
32047
  location: TextLocation2.tag
31556
32048
  });
31557
- target.__sampleSolutionAst = textParser9.toAst(trimmedStringValue, {
32049
+ target.__sampleSolutionAst = textParser10.toAst(trimmedStringValue, {
31558
32050
  format: textFormat,
31559
32051
  location: TextLocation2.tag
31560
32052
  });
@@ -31661,10 +32153,10 @@ function buildGap(context, _contentDepth, tagsConfig, content) {
31661
32153
  function itemLeadTagContentProcessor(context, _contentDepth, _tagsConfig, content, target) {
31662
32154
  const { textFormat } = context;
31663
32155
  const { value } = content;
31664
- const textParser9 = new TextParser();
32156
+ const textParser10 = new TextParser();
31665
32157
  const trimmedStringValue = stringUtils.trimmedString(value);
31666
32158
  if (!target.itemLead) target.itemLead = [];
31667
- const text = textParser9.toAst(trimmedStringValue, {
32159
+ const text = textParser10.toAst(trimmedStringValue, {
31668
32160
  format: textFormat,
31669
32161
  location: TextLocation2.tag
31670
32162
  });
@@ -32415,7 +32907,9 @@ function buildTitles(_context, bitType, title) {
32415
32907
  }
32416
32908
 
32417
32909
  // src/parser/bitmark/peg/contentProcessors/TrueFalseTagContentProcessor.ts
32418
- function trueFalseTagContentProcessor(_context, _contentDepth, content, target) {
32910
+ var textParser9 = new TextParser();
32911
+ function trueFalseTagContentProcessor(context, _contentDepth, content, target) {
32912
+ const { textFormat } = context;
32419
32913
  const { type, value } = content;
32420
32914
  const trueFalse = target.trueFalse;
32421
32915
  if (!trueFalse) return;
@@ -32426,8 +32920,13 @@ function trueFalseTagContentProcessor(_context, _contentDepth, content, target)
32426
32920
  location: TextLocation2.tag
32427
32921
  }
32428
32922
  );
32923
+ const textAst = textParser9.toAst(trimmedStringValue ?? "", {
32924
+ format: textFormat,
32925
+ location: TextLocation2.tag
32926
+ });
32429
32927
  trueFalse.push({
32430
32928
  text: trimmedStringValue,
32929
+ textAst,
32431
32930
  isCorrect: type === TypeKey.True,
32432
32931
  __isDefaultExample: false
32433
32932
  });
@@ -32531,7 +33030,7 @@ function buildStatementsChoicesResponses(context, tagsConfig, trueFalseContent)
32531
33030
  const { statement: _ignore, ...tagsRest } = tags2;
32532
33031
  const statement = {
32533
33032
  ...firstTrueFalse,
32534
- statement: firstTrueFalse.text,
33033
+ statement: firstTrueFalse.textAst ?? [],
32535
33034
  ...tagsRest
32536
33035
  };
32537
33036
  if (statement) statements.push(statement);
@@ -33298,36 +33797,39 @@ function peg$parse2(input, options) {
33298
33797
  const peg$c7 = "text";
33299
33798
  const peg$c8 = "~~~~";
33300
33799
  const peg$c9 = "footer";
33301
- const peg$c10 = "--";
33302
- const peg$c11 = "++";
33303
- const peg$c12 = "===";
33304
- const peg$c13 = "==";
33305
- const peg$c14 = "[@id";
33306
- const peg$c15 = "#";
33307
- const peg$c16 = "[\u25BC";
33308
- const peg$c17 = "[\u25BA";
33309
- const peg$c18 = "[@";
33310
- const peg$c19 = "[%";
33311
- const peg$c20 = "[!";
33312
- const peg$c21 = "[?";
33313
- const peg$c22 = "[+";
33314
- const peg$c23 = "[-";
33315
- const peg$c24 = "[$";
33316
- const peg$c25 = "[_";
33317
- const peg$c26 = "[=";
33318
- const peg$c27 = "[&";
33319
- const peg$c28 = "^]";
33320
- const peg$c29 = "id:";
33321
- const peg$c30 = ".";
33322
- const peg$c31 = "\n";
33323
- const peg$c32 = "\r\n";
33800
+ const peg$c10 = " ";
33801
+ const peg$c11 = "--";
33802
+ const peg$c12 = "++";
33803
+ const peg$c13 = "===";
33804
+ const peg$c14 = "==";
33805
+ const peg$c15 = "[@id";
33806
+ const peg$c16 = "#";
33807
+ const peg$c17 = "[\u25BC";
33808
+ const peg$c18 = "[\u25BA";
33809
+ const peg$c19 = "[@";
33810
+ const peg$c20 = "[%";
33811
+ const peg$c21 = "[!";
33812
+ const peg$c22 = "[?";
33813
+ const peg$c23 = "[+";
33814
+ const peg$c24 = "[-";
33815
+ const peg$c25 = "[$";
33816
+ const peg$c26 = "[_";
33817
+ const peg$c27 = "[=";
33818
+ const peg$c28 = "[&";
33819
+ const peg$c29 = "^]";
33820
+ const peg$c30 = "id:";
33821
+ const peg$c31 = ".";
33822
+ const peg$c32 = "\n";
33823
+ const peg$c33 = "\r\n";
33324
33824
  const peg$r0 = /^[^\]]/;
33325
- const peg$r1 = /^[^:\]]/;
33326
- const peg$r2 = /^[^&:\]]/;
33327
- const peg$r3 = /^[^\n\r\u2028\u2029]/;
33328
- const peg$r4 = /^[ \t]/;
33329
- const peg$r5 = /^[\r\u2028-\u2029]/;
33330
- const peg$r6 = /^[ \t\n\r\u2028\u2029]/;
33825
+ const peg$r1 = /^[a-z]/;
33826
+ const peg$r2 = /^[a-z0-9\-]/;
33827
+ const peg$r3 = /^[^:\]]/;
33828
+ const peg$r4 = /^[^&:\]]/;
33829
+ const peg$r5 = /^[^\n\r\u2028\u2029]/;
33830
+ const peg$r6 = /^[ \t]/;
33831
+ const peg$r7 = /^[\r\u2028-\u2029]/;
33832
+ const peg$r8 = /^[ \t\n\r\u2028\u2029]/;
33331
33833
  const peg$e0 = peg$literalExpectation("[.", false);
33332
33834
  const peg$e1 = peg$classExpectation(["]"], true, false, false);
33333
33835
  const peg$e2 = peg$literalExpectation("]", false);
@@ -33340,40 +33842,43 @@ function peg$parse2(input, options) {
33340
33842
  const peg$e9 = peg$literalExpectation("text", false);
33341
33843
  const peg$e10 = peg$literalExpectation("~~~~", false);
33342
33844
  const peg$e11 = peg$literalExpectation("footer", false);
33343
- const peg$e12 = peg$literalExpectation("--", false);
33344
- const peg$e13 = peg$literalExpectation("++", false);
33345
- const peg$e14 = peg$literalExpectation("===", false);
33346
- const peg$e15 = peg$literalExpectation("==", false);
33347
- const peg$e16 = peg$literalExpectation("[@id", false);
33348
- const peg$e17 = peg$literalExpectation("#", false);
33349
- const peg$e18 = peg$literalExpectation("[\u25BC", false);
33350
- const peg$e19 = peg$literalExpectation("[\u25BA", false);
33351
- const peg$e20 = peg$literalExpectation("[@", false);
33352
- const peg$e21 = peg$literalExpectation("[%", false);
33353
- const peg$e22 = peg$literalExpectation("[!", false);
33354
- const peg$e23 = peg$literalExpectation("[?", false);
33355
- const peg$e24 = peg$literalExpectation("[+", false);
33356
- const peg$e25 = peg$literalExpectation("[-", false);
33357
- const peg$e26 = peg$literalExpectation("[$", false);
33358
- const peg$e27 = peg$literalExpectation("[_", false);
33359
- const peg$e28 = peg$literalExpectation("[=", false);
33360
- const peg$e29 = peg$literalExpectation("[&", false);
33361
- const peg$e30 = peg$literalExpectation("^]", false);
33362
- const peg$e31 = peg$literalExpectation("id:", false);
33363
- const peg$e32 = peg$classExpectation([":", "]"], true, false, false);
33364
- const peg$e33 = peg$literalExpectation(".", false);
33365
- const peg$e34 = peg$classExpectation(["&", ":", "]"], true, false, false);
33366
- const peg$e35 = peg$otherExpectation("Character");
33367
- const peg$e36 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], true, false, false);
33368
- const peg$e37 = peg$otherExpectation("Blank Line");
33369
- const peg$e38 = peg$classExpectation([" ", " "], false, false, false);
33370
- const peg$e39 = peg$otherExpectation("Line Terminator");
33371
- const peg$e40 = peg$literalExpectation("\n", false);
33372
- const peg$e41 = peg$literalExpectation("\r\n", false);
33373
- const peg$e42 = peg$classExpectation(["\r", ["\u2028", "\u2029"]], false, false, false);
33374
- const peg$e43 = peg$otherExpectation("Whitespace, then Line Terminator");
33375
- const peg$e44 = peg$otherExpectation("whitespace");
33376
- const peg$e45 = peg$classExpectation([" ", " ", "\n", "\r", "\u2028", "\u2029"], false, false, false);
33845
+ const peg$e12 = peg$literalExpectation(" ", false);
33846
+ const peg$e13 = peg$literalExpectation("--", false);
33847
+ const peg$e14 = peg$literalExpectation("++", false);
33848
+ const peg$e15 = peg$literalExpectation("===", false);
33849
+ const peg$e16 = peg$literalExpectation("==", false);
33850
+ const peg$e17 = peg$classExpectation([["a", "z"]], false, false, false);
33851
+ const peg$e18 = peg$classExpectation([["a", "z"], ["0", "9"], "-"], false, false, false);
33852
+ const peg$e19 = peg$literalExpectation("[@id", false);
33853
+ const peg$e20 = peg$literalExpectation("#", false);
33854
+ const peg$e21 = peg$literalExpectation("[\u25BC", false);
33855
+ const peg$e22 = peg$literalExpectation("[\u25BA", false);
33856
+ const peg$e23 = peg$literalExpectation("[@", false);
33857
+ const peg$e24 = peg$literalExpectation("[%", false);
33858
+ const peg$e25 = peg$literalExpectation("[!", false);
33859
+ const peg$e26 = peg$literalExpectation("[?", false);
33860
+ const peg$e27 = peg$literalExpectation("[+", false);
33861
+ const peg$e28 = peg$literalExpectation("[-", false);
33862
+ const peg$e29 = peg$literalExpectation("[$", false);
33863
+ const peg$e30 = peg$literalExpectation("[_", false);
33864
+ const peg$e31 = peg$literalExpectation("[=", false);
33865
+ const peg$e32 = peg$literalExpectation("[&", false);
33866
+ const peg$e33 = peg$literalExpectation("^]", false);
33867
+ const peg$e34 = peg$literalExpectation("id:", false);
33868
+ const peg$e35 = peg$classExpectation([":", "]"], true, false, false);
33869
+ const peg$e36 = peg$literalExpectation(".", false);
33870
+ const peg$e37 = peg$classExpectation(["&", ":", "]"], true, false, false);
33871
+ const peg$e38 = peg$otherExpectation("Character");
33872
+ const peg$e39 = peg$classExpectation(["\n", "\r", "\u2028", "\u2029"], true, false, false);
33873
+ const peg$e40 = peg$otherExpectation("Blank Line");
33874
+ const peg$e41 = peg$classExpectation([" ", " "], false, false, false);
33875
+ const peg$e42 = peg$otherExpectation("Line Terminator");
33876
+ const peg$e43 = peg$literalExpectation("\n", false);
33877
+ const peg$e44 = peg$literalExpectation("\r\n", false);
33878
+ const peg$e45 = peg$classExpectation(["\r", ["\u2028", "\u2029"]], false, false, false);
33879
+ const peg$e46 = peg$otherExpectation("Whitespace, then Line Terminator");
33880
+ const peg$e47 = peg$otherExpectation("whitespace");
33881
+ const peg$e48 = peg$classExpectation([" ", " ", "\n", "\r", "\u2028", "\u2029"], false, false, false);
33377
33882
  function peg$f0(firstBit, bits) {
33378
33883
  return processor.buildBits([firstBit, ...bits]);
33379
33884
  }
@@ -33446,91 +33951,112 @@ function peg$parse2(input, options) {
33446
33951
  function peg$f23(value) {
33447
33952
  return helper.handleCardLineOrDivider(value, 2);
33448
33953
  }
33449
- function peg$f24(value) {
33954
+ function peg$f24(qualifier) {
33955
+ return ["====", qualifier];
33956
+ }
33957
+ function peg$f25() {
33958
+ return ["===="];
33959
+ }
33960
+ function peg$f26(qualifier) {
33961
+ return ["--", qualifier];
33962
+ }
33963
+ function peg$f27() {
33964
+ return ["--"];
33965
+ }
33966
+ function peg$f28(qualifier) {
33967
+ return ["++", qualifier];
33968
+ }
33969
+ function peg$f29() {
33970
+ return ["++"];
33971
+ }
33972
+ function peg$f30(value) {
33450
33973
  return helper.handleCardLine(value);
33451
33974
  }
33452
- function peg$f25(value) {
33975
+ function peg$f31(value) {
33453
33976
  return helper.handleCardSet(value[1].flat());
33454
33977
  }
33455
- function peg$f26() {
33978
+ function peg$f32() {
33456
33979
  helper.handleCardSetStart();
33457
33980
  }
33458
- function peg$f27() {
33981
+ function peg$f33() {
33459
33982
  helper.handleCardSetEnd();
33460
33983
  }
33461
- function peg$f28(value) {
33984
+ function peg$f34(value) {
33462
33985
  return helper.handleCards(value);
33463
33986
  }
33464
- function peg$f29(value) {
33987
+ function peg$f35(value) {
33465
33988
  return helper.handleCardLineOrDivider(value, 1);
33466
33989
  }
33467
- function peg$f30(value) {
33990
+ function peg$f36(value) {
33468
33991
  return helper.handleCardLine(value);
33469
33992
  }
33470
- function peg$f31(value) {
33993
+ function peg$f37(value) {
33994
+ return value;
33995
+ }
33996
+ function peg$f38(value) {
33471
33997
  return helper.handleCardContent(value);
33472
33998
  }
33473
- function peg$f32(value) {
33999
+ function peg$f39(value) {
33474
34000
  return { type: TypeKey.CardChar, value };
33475
34001
  }
33476
- function peg$f33(value) {
34002
+ function peg$f40(value) {
33477
34003
  return helper.handlePropertyTag("id", value);
33478
34004
  }
33479
- function peg$f34(level, title) {
34005
+ function peg$f41(level, title) {
33480
34006
  return helper.handleTag(TypeKey.Title, { level, title });
33481
34007
  }
33482
- function peg$f35(value) {
34008
+ function peg$f42(value) {
33483
34009
  return helper.handleTag(TypeKey.Anchor, value);
33484
34010
  }
33485
- function peg$f36(value) {
34011
+ function peg$f43(value) {
33486
34012
  return helper.handleTag(TypeKey.Reference, value);
33487
34013
  }
33488
- function peg$f37(key, value) {
34014
+ function peg$f44(key, value) {
33489
34015
  return helper.handlePropertyTag(key, value);
33490
34016
  }
33491
- function peg$f38(value) {
34017
+ function peg$f45(value) {
33492
34018
  return helper.handleTag(TypeKey.ItemLead, value);
33493
34019
  }
33494
- function peg$f39(value) {
34020
+ function peg$f46(value) {
33495
34021
  return helper.handleTag(TypeKey.Instruction, value);
33496
34022
  }
33497
- function peg$f40(value) {
34023
+ function peg$f47(value) {
33498
34024
  return helper.handleTag(TypeKey.Hint, value);
33499
34025
  }
33500
- function peg$f41(value) {
34026
+ function peg$f48(value) {
33501
34027
  return helper.handleTag(TypeKey.True, value);
33502
34028
  }
33503
- function peg$f42(value) {
34029
+ function peg$f49(value) {
33504
34030
  return helper.handleTag(TypeKey.False, value);
33505
34031
  }
33506
- function peg$f43(value) {
34032
+ function peg$f50(value) {
33507
34033
  return helper.handleTag(TypeKey.SampleSolution, value);
33508
34034
  }
33509
- function peg$f44(value) {
34035
+ function peg$f51(value) {
33510
34036
  return helper.handleTag(TypeKey.Gap, value);
33511
34037
  }
33512
- function peg$f45(value) {
34038
+ function peg$f52(value) {
33513
34039
  return helper.handleTag(TypeKey.Mark, value);
33514
34040
  }
33515
- function peg$f46(key, value) {
34041
+ function peg$f53(key, value) {
33516
34042
  return helper.handleResourceTag(key, value);
33517
34043
  }
33518
- function peg$f47(value) {
34044
+ function peg$f54(value) {
33519
34045
  return value;
33520
34046
  }
33521
- function peg$f48(value) {
34047
+ function peg$f55(value) {
33522
34048
  return value ? value.trim() : "";
33523
34049
  }
33524
- function peg$f49(value) {
34050
+ function peg$f56(value) {
33525
34051
  return value.length;
33526
34052
  }
33527
- function peg$f50(value) {
34053
+ function peg$f57(value) {
33528
34054
  return value ? value.trim() : null;
33529
34055
  }
33530
- function peg$f51(value) {
34056
+ function peg$f58(value) {
33531
34057
  return value ? value.trim() : "";
33532
34058
  }
33533
- function peg$f52() {
34059
+ function peg$f59() {
33534
34060
  return true;
33535
34061
  }
33536
34062
  let peg$currPos = options.peg$currPos | 0;
@@ -34448,35 +34974,28 @@ function peg$parse2(input, options) {
34448
34974
  return s0;
34449
34975
  }
34450
34976
  function peg$parseCardSetStart_V2() {
34451
- let s0, s1, s2, s3, s4, s5;
34977
+ let s0, s1, s2, s3;
34452
34978
  s0 = peg$currPos;
34453
- s1 = peg$parseNL();
34979
+ s1 = [];
34980
+ s2 = peg$parseWNL();
34981
+ if (s2 === peg$FAILED) {
34982
+ s2 = peg$parseNL();
34983
+ }
34984
+ if (s2 !== peg$FAILED) {
34985
+ while (s2 !== peg$FAILED) {
34986
+ s1.push(s2);
34987
+ s2 = peg$parseWNL();
34988
+ if (s2 === peg$FAILED) {
34989
+ s2 = peg$parseNL();
34990
+ }
34991
+ }
34992
+ } else {
34993
+ s1 = peg$FAILED;
34994
+ }
34454
34995
  if (s1 !== peg$FAILED) {
34455
34996
  s2 = peg$currPos;
34456
34997
  peg$silentFails++;
34457
- s3 = peg$currPos;
34458
- if (input.substr(peg$currPos, 4) === peg$c6) {
34459
- s4 = peg$c6;
34460
- peg$currPos += 4;
34461
- } else {
34462
- s4 = peg$FAILED;
34463
- if (peg$silentFails === 0) {
34464
- peg$fail(peg$e8);
34465
- }
34466
- }
34467
- if (s4 !== peg$FAILED) {
34468
- s5 = peg$parseWNL();
34469
- if (s5 !== peg$FAILED) {
34470
- s4 = [s4, s5];
34471
- s3 = s4;
34472
- } else {
34473
- peg$currPos = s3;
34474
- s3 = peg$FAILED;
34475
- }
34476
- } else {
34477
- peg$currPos = s3;
34478
- s3 = peg$FAILED;
34479
- }
34998
+ s3 = peg$parseCardDividerLookahead_V2();
34480
34999
  peg$silentFails--;
34481
35000
  if (s3 !== peg$FAILED) {
34482
35001
  peg$currPos = s2;
@@ -34541,39 +35060,147 @@ function peg$parse2(input, options) {
34541
35060
  return s0;
34542
35061
  }
34543
35062
  function peg$parseCardLineOrDivider_V2() {
34544
- let s0, s1, s2, s3;
35063
+ let s0, s1;
35064
+ s0 = peg$currPos;
35065
+ s1 = peg$parseCardDividerToken_V2();
35066
+ if (s1 === peg$FAILED) {
35067
+ s1 = peg$parseCardSideDividerToken_V2();
35068
+ if (s1 === peg$FAILED) {
35069
+ s1 = peg$parseCardVariantDividerToken_V2();
35070
+ if (s1 === peg$FAILED) {
35071
+ s1 = peg$parseCardLine_V2();
35072
+ }
35073
+ }
35074
+ }
35075
+ if (s1 !== peg$FAILED) {
35076
+ peg$savedPos = s0;
35077
+ s1 = peg$f23(s1);
35078
+ }
35079
+ s0 = s1;
35080
+ return s0;
35081
+ }
35082
+ function peg$parseCardDividerToken_V2() {
35083
+ let s0, s1, s2, s3, s4, s5, s6;
34545
35084
  s0 = peg$currPos;
34546
- s1 = peg$currPos;
34547
35085
  if (input.substr(peg$currPos, 4) === peg$c6) {
34548
- s2 = peg$c6;
35086
+ s1 = peg$c6;
34549
35087
  peg$currPos += 4;
34550
35088
  } else {
34551
- s2 = peg$FAILED;
35089
+ s1 = peg$FAILED;
34552
35090
  if (peg$silentFails === 0) {
34553
35091
  peg$fail(peg$e8);
34554
35092
  }
34555
35093
  }
34556
- if (s2 !== peg$FAILED) {
34557
- s3 = peg$parseWNL();
34558
- if (s3 === peg$FAILED) {
34559
- s3 = peg$parseWEOL();
35094
+ if (s1 !== peg$FAILED) {
35095
+ if (input.charCodeAt(peg$currPos) === 32) {
35096
+ s2 = peg$c10;
35097
+ peg$currPos++;
35098
+ } else {
35099
+ s2 = peg$FAILED;
35100
+ if (peg$silentFails === 0) {
35101
+ peg$fail(peg$e12);
35102
+ }
34560
35103
  }
34561
- if (s3 !== peg$FAILED) {
34562
- s2 = [s2, s3];
34563
- s1 = s2;
35104
+ if (s2 !== peg$FAILED) {
35105
+ s3 = peg$parseQualifier();
35106
+ if (s3 !== peg$FAILED) {
35107
+ if (input.charCodeAt(peg$currPos) === 32) {
35108
+ s4 = peg$c10;
35109
+ peg$currPos++;
35110
+ } else {
35111
+ s4 = peg$FAILED;
35112
+ if (peg$silentFails === 0) {
35113
+ peg$fail(peg$e12);
35114
+ }
35115
+ }
35116
+ if (s4 !== peg$FAILED) {
35117
+ if (input.substr(peg$currPos, 4) === peg$c6) {
35118
+ s5 = peg$c6;
35119
+ peg$currPos += 4;
35120
+ } else {
35121
+ s5 = peg$FAILED;
35122
+ if (peg$silentFails === 0) {
35123
+ peg$fail(peg$e8);
35124
+ }
35125
+ }
35126
+ if (s5 !== peg$FAILED) {
35127
+ s6 = peg$parseWNL();
35128
+ if (s6 === peg$FAILED) {
35129
+ s6 = peg$parseWEOL();
35130
+ }
35131
+ if (s6 !== peg$FAILED) {
35132
+ peg$savedPos = s0;
35133
+ s0 = peg$f24(s3);
35134
+ } else {
35135
+ peg$currPos = s0;
35136
+ s0 = peg$FAILED;
35137
+ }
35138
+ } else {
35139
+ peg$currPos = s0;
35140
+ s0 = peg$FAILED;
35141
+ }
35142
+ } else {
35143
+ peg$currPos = s0;
35144
+ s0 = peg$FAILED;
35145
+ }
35146
+ } else {
35147
+ peg$currPos = s0;
35148
+ s0 = peg$FAILED;
35149
+ }
35150
+ } else {
35151
+ peg$currPos = s0;
35152
+ s0 = peg$FAILED;
35153
+ }
35154
+ } else {
35155
+ peg$currPos = s0;
35156
+ s0 = peg$FAILED;
35157
+ }
35158
+ if (s0 === peg$FAILED) {
35159
+ s0 = peg$currPos;
35160
+ if (input.substr(peg$currPos, 4) === peg$c6) {
35161
+ s1 = peg$c6;
35162
+ peg$currPos += 4;
34564
35163
  } else {
34565
- peg$currPos = s1;
34566
35164
  s1 = peg$FAILED;
35165
+ if (peg$silentFails === 0) {
35166
+ peg$fail(peg$e8);
35167
+ }
34567
35168
  }
35169
+ if (s1 !== peg$FAILED) {
35170
+ s2 = peg$parseWNL();
35171
+ if (s2 === peg$FAILED) {
35172
+ s2 = peg$parseWEOL();
35173
+ }
35174
+ if (s2 !== peg$FAILED) {
35175
+ peg$savedPos = s0;
35176
+ s0 = peg$f25();
35177
+ } else {
35178
+ peg$currPos = s0;
35179
+ s0 = peg$FAILED;
35180
+ }
35181
+ } else {
35182
+ peg$currPos = s0;
35183
+ s0 = peg$FAILED;
35184
+ }
35185
+ }
35186
+ return s0;
35187
+ }
35188
+ function peg$parseCardSideDividerToken_V2() {
35189
+ let s0, s1, s2, s3, s4, s5, s6;
35190
+ s0 = peg$currPos;
35191
+ if (input.substr(peg$currPos, 2) === peg$c11) {
35192
+ s1 = peg$c11;
35193
+ peg$currPos += 2;
34568
35194
  } else {
34569
- peg$currPos = s1;
34570
35195
  s1 = peg$FAILED;
35196
+ if (peg$silentFails === 0) {
35197
+ peg$fail(peg$e13);
35198
+ }
34571
35199
  }
34572
- if (s1 === peg$FAILED) {
34573
- s1 = peg$currPos;
34574
- if (input.substr(peg$currPos, 2) === peg$c10) {
35200
+ if (s1 !== peg$FAILED) {
35201
+ if (input.charCodeAt(peg$currPos) === 32) {
34575
35202
  s2 = peg$c10;
34576
- peg$currPos += 2;
35203
+ peg$currPos++;
34577
35204
  } else {
34578
35205
  s2 = peg$FAILED;
34579
35206
  if (peg$silentFails === 0) {
@@ -34581,58 +35208,277 @@ function peg$parse2(input, options) {
34581
35208
  }
34582
35209
  }
34583
35210
  if (s2 !== peg$FAILED) {
34584
- s3 = peg$parseWNL();
34585
- if (s3 === peg$FAILED) {
34586
- s3 = peg$parseWEOL();
34587
- }
35211
+ s3 = peg$parseQualifier();
34588
35212
  if (s3 !== peg$FAILED) {
34589
- s2 = [s2, s3];
34590
- s1 = s2;
35213
+ if (input.charCodeAt(peg$currPos) === 32) {
35214
+ s4 = peg$c10;
35215
+ peg$currPos++;
35216
+ } else {
35217
+ s4 = peg$FAILED;
35218
+ if (peg$silentFails === 0) {
35219
+ peg$fail(peg$e12);
35220
+ }
35221
+ }
35222
+ if (s4 !== peg$FAILED) {
35223
+ if (input.substr(peg$currPos, 2) === peg$c11) {
35224
+ s5 = peg$c11;
35225
+ peg$currPos += 2;
35226
+ } else {
35227
+ s5 = peg$FAILED;
35228
+ if (peg$silentFails === 0) {
35229
+ peg$fail(peg$e13);
35230
+ }
35231
+ }
35232
+ if (s5 !== peg$FAILED) {
35233
+ s6 = peg$parseWNL();
35234
+ if (s6 === peg$FAILED) {
35235
+ s6 = peg$parseWEOL();
35236
+ }
35237
+ if (s6 !== peg$FAILED) {
35238
+ peg$savedPos = s0;
35239
+ s0 = peg$f26(s3);
35240
+ } else {
35241
+ peg$currPos = s0;
35242
+ s0 = peg$FAILED;
35243
+ }
35244
+ } else {
35245
+ peg$currPos = s0;
35246
+ s0 = peg$FAILED;
35247
+ }
35248
+ } else {
35249
+ peg$currPos = s0;
35250
+ s0 = peg$FAILED;
35251
+ }
34591
35252
  } else {
34592
- peg$currPos = s1;
34593
- s1 = peg$FAILED;
35253
+ peg$currPos = s0;
35254
+ s0 = peg$FAILED;
34594
35255
  }
34595
35256
  } else {
34596
- peg$currPos = s1;
35257
+ peg$currPos = s0;
35258
+ s0 = peg$FAILED;
35259
+ }
35260
+ } else {
35261
+ peg$currPos = s0;
35262
+ s0 = peg$FAILED;
35263
+ }
35264
+ if (s0 === peg$FAILED) {
35265
+ s0 = peg$currPos;
35266
+ if (input.substr(peg$currPos, 2) === peg$c11) {
35267
+ s1 = peg$c11;
35268
+ peg$currPos += 2;
35269
+ } else {
34597
35270
  s1 = peg$FAILED;
35271
+ if (peg$silentFails === 0) {
35272
+ peg$fail(peg$e13);
35273
+ }
34598
35274
  }
34599
- if (s1 === peg$FAILED) {
34600
- s1 = peg$currPos;
34601
- if (input.substr(peg$currPos, 2) === peg$c11) {
34602
- s2 = peg$c11;
34603
- peg$currPos += 2;
34604
- } else {
34605
- s2 = peg$FAILED;
34606
- if (peg$silentFails === 0) {
34607
- peg$fail(peg$e13);
34608
- }
35275
+ if (s1 !== peg$FAILED) {
35276
+ s2 = peg$parseWNL();
35277
+ if (s2 === peg$FAILED) {
35278
+ s2 = peg$parseWEOL();
34609
35279
  }
34610
35280
  if (s2 !== peg$FAILED) {
34611
- s3 = peg$parseWNL();
34612
- if (s3 === peg$FAILED) {
34613
- s3 = peg$parseWEOL();
35281
+ peg$savedPos = s0;
35282
+ s0 = peg$f27();
35283
+ } else {
35284
+ peg$currPos = s0;
35285
+ s0 = peg$FAILED;
35286
+ }
35287
+ } else {
35288
+ peg$currPos = s0;
35289
+ s0 = peg$FAILED;
35290
+ }
35291
+ }
35292
+ return s0;
35293
+ }
35294
+ function peg$parseCardVariantDividerToken_V2() {
35295
+ let s0, s1, s2, s3, s4, s5, s6;
35296
+ s0 = peg$currPos;
35297
+ if (input.substr(peg$currPos, 2) === peg$c12) {
35298
+ s1 = peg$c12;
35299
+ peg$currPos += 2;
35300
+ } else {
35301
+ s1 = peg$FAILED;
35302
+ if (peg$silentFails === 0) {
35303
+ peg$fail(peg$e14);
35304
+ }
35305
+ }
35306
+ if (s1 !== peg$FAILED) {
35307
+ if (input.charCodeAt(peg$currPos) === 32) {
35308
+ s2 = peg$c10;
35309
+ peg$currPos++;
35310
+ } else {
35311
+ s2 = peg$FAILED;
35312
+ if (peg$silentFails === 0) {
35313
+ peg$fail(peg$e12);
35314
+ }
35315
+ }
35316
+ if (s2 !== peg$FAILED) {
35317
+ s3 = peg$parseQualifier();
35318
+ if (s3 !== peg$FAILED) {
35319
+ if (input.charCodeAt(peg$currPos) === 32) {
35320
+ s4 = peg$c10;
35321
+ peg$currPos++;
35322
+ } else {
35323
+ s4 = peg$FAILED;
35324
+ if (peg$silentFails === 0) {
35325
+ peg$fail(peg$e12);
35326
+ }
34614
35327
  }
34615
- if (s3 !== peg$FAILED) {
34616
- s2 = [s2, s3];
34617
- s1 = s2;
35328
+ if (s4 !== peg$FAILED) {
35329
+ if (input.substr(peg$currPos, 2) === peg$c12) {
35330
+ s5 = peg$c12;
35331
+ peg$currPos += 2;
35332
+ } else {
35333
+ s5 = peg$FAILED;
35334
+ if (peg$silentFails === 0) {
35335
+ peg$fail(peg$e14);
35336
+ }
35337
+ }
35338
+ if (s5 !== peg$FAILED) {
35339
+ s6 = peg$parseWNL();
35340
+ if (s6 === peg$FAILED) {
35341
+ s6 = peg$parseWEOL();
35342
+ }
35343
+ if (s6 !== peg$FAILED) {
35344
+ peg$savedPos = s0;
35345
+ s0 = peg$f28(s3);
35346
+ } else {
35347
+ peg$currPos = s0;
35348
+ s0 = peg$FAILED;
35349
+ }
35350
+ } else {
35351
+ peg$currPos = s0;
35352
+ s0 = peg$FAILED;
35353
+ }
34618
35354
  } else {
34619
- peg$currPos = s1;
34620
- s1 = peg$FAILED;
35355
+ peg$currPos = s0;
35356
+ s0 = peg$FAILED;
34621
35357
  }
34622
35358
  } else {
34623
- peg$currPos = s1;
34624
- s1 = peg$FAILED;
35359
+ peg$currPos = s0;
35360
+ s0 = peg$FAILED;
34625
35361
  }
34626
- if (s1 === peg$FAILED) {
34627
- s1 = peg$parseCardLine_V2();
35362
+ } else {
35363
+ peg$currPos = s0;
35364
+ s0 = peg$FAILED;
35365
+ }
35366
+ } else {
35367
+ peg$currPos = s0;
35368
+ s0 = peg$FAILED;
35369
+ }
35370
+ if (s0 === peg$FAILED) {
35371
+ s0 = peg$currPos;
35372
+ if (input.substr(peg$currPos, 2) === peg$c12) {
35373
+ s1 = peg$c12;
35374
+ peg$currPos += 2;
35375
+ } else {
35376
+ s1 = peg$FAILED;
35377
+ if (peg$silentFails === 0) {
35378
+ peg$fail(peg$e14);
34628
35379
  }
34629
35380
  }
35381
+ if (s1 !== peg$FAILED) {
35382
+ s2 = peg$parseWNL();
35383
+ if (s2 === peg$FAILED) {
35384
+ s2 = peg$parseWEOL();
35385
+ }
35386
+ if (s2 !== peg$FAILED) {
35387
+ peg$savedPos = s0;
35388
+ s0 = peg$f29();
35389
+ } else {
35390
+ peg$currPos = s0;
35391
+ s0 = peg$FAILED;
35392
+ }
35393
+ } else {
35394
+ peg$currPos = s0;
35395
+ s0 = peg$FAILED;
35396
+ }
35397
+ }
35398
+ return s0;
35399
+ }
35400
+ function peg$parseCardDividerLookahead_V2() {
35401
+ let s0, s1, s2, s3, s4, s5, s6;
35402
+ s0 = peg$currPos;
35403
+ if (input.substr(peg$currPos, 4) === peg$c6) {
35404
+ s1 = peg$c6;
35405
+ peg$currPos += 4;
35406
+ } else {
35407
+ s1 = peg$FAILED;
35408
+ if (peg$silentFails === 0) {
35409
+ peg$fail(peg$e8);
35410
+ }
34630
35411
  }
34631
35412
  if (s1 !== peg$FAILED) {
34632
- peg$savedPos = s0;
34633
- s1 = peg$f23(s1);
35413
+ s2 = peg$currPos;
35414
+ if (input.charCodeAt(peg$currPos) === 32) {
35415
+ s3 = peg$c10;
35416
+ peg$currPos++;
35417
+ } else {
35418
+ s3 = peg$FAILED;
35419
+ if (peg$silentFails === 0) {
35420
+ peg$fail(peg$e12);
35421
+ }
35422
+ }
35423
+ if (s3 !== peg$FAILED) {
35424
+ s4 = peg$parseQualifier();
35425
+ if (s4 !== peg$FAILED) {
35426
+ if (input.charCodeAt(peg$currPos) === 32) {
35427
+ s5 = peg$c10;
35428
+ peg$currPos++;
35429
+ } else {
35430
+ s5 = peg$FAILED;
35431
+ if (peg$silentFails === 0) {
35432
+ peg$fail(peg$e12);
35433
+ }
35434
+ }
35435
+ if (s5 !== peg$FAILED) {
35436
+ if (input.substr(peg$currPos, 4) === peg$c6) {
35437
+ s6 = peg$c6;
35438
+ peg$currPos += 4;
35439
+ } else {
35440
+ s6 = peg$FAILED;
35441
+ if (peg$silentFails === 0) {
35442
+ peg$fail(peg$e8);
35443
+ }
35444
+ }
35445
+ if (s6 !== peg$FAILED) {
35446
+ s3 = [s3, s4, s5, s6];
35447
+ s2 = s3;
35448
+ } else {
35449
+ peg$currPos = s2;
35450
+ s2 = peg$FAILED;
35451
+ }
35452
+ } else {
35453
+ peg$currPos = s2;
35454
+ s2 = peg$FAILED;
35455
+ }
35456
+ } else {
35457
+ peg$currPos = s2;
35458
+ s2 = peg$FAILED;
35459
+ }
35460
+ } else {
35461
+ peg$currPos = s2;
35462
+ s2 = peg$FAILED;
35463
+ }
35464
+ if (s2 === peg$FAILED) {
35465
+ s2 = null;
35466
+ }
35467
+ s3 = peg$parseWNL();
35468
+ if (s3 === peg$FAILED) {
35469
+ s3 = peg$parseWEOL();
35470
+ }
35471
+ if (s3 !== peg$FAILED) {
35472
+ s1 = [s1, s2, s3];
35473
+ s0 = s1;
35474
+ } else {
35475
+ peg$currPos = s0;
35476
+ s0 = peg$FAILED;
35477
+ }
35478
+ } else {
35479
+ peg$currPos = s0;
35480
+ s0 = peg$FAILED;
34634
35481
  }
34635
- s0 = s1;
34636
35482
  return s0;
34637
35483
  }
34638
35484
  function peg$parseCardLine_V2() {
@@ -34707,7 +35553,7 @@ function peg$parse2(input, options) {
34707
35553
  }
34708
35554
  if (s2 !== peg$FAILED) {
34709
35555
  peg$savedPos = s0;
34710
- s0 = peg$f24(s2);
35556
+ s0 = peg$f30(s2);
34711
35557
  } else {
34712
35558
  peg$currPos = s0;
34713
35559
  s0 = peg$FAILED;
@@ -34744,7 +35590,7 @@ function peg$parse2(input, options) {
34744
35590
  }
34745
35591
  if (s1 !== peg$FAILED) {
34746
35592
  peg$savedPos = s0;
34747
- s1 = peg$f25(s1);
35593
+ s1 = peg$f31(s1);
34748
35594
  }
34749
35595
  s0 = s1;
34750
35596
  return s0;
@@ -34752,18 +35598,33 @@ function peg$parse2(input, options) {
34752
35598
  function peg$parseCardSetStart_V1() {
34753
35599
  let s0, s1, s2, s3, s4, s5;
34754
35600
  s0 = peg$currPos;
34755
- s1 = peg$parseNL();
35601
+ s1 = [];
35602
+ s2 = peg$parseWNL();
35603
+ if (s2 === peg$FAILED) {
35604
+ s2 = peg$parseNL();
35605
+ }
35606
+ if (s2 !== peg$FAILED) {
35607
+ while (s2 !== peg$FAILED) {
35608
+ s1.push(s2);
35609
+ s2 = peg$parseWNL();
35610
+ if (s2 === peg$FAILED) {
35611
+ s2 = peg$parseNL();
35612
+ }
35613
+ }
35614
+ } else {
35615
+ s1 = peg$FAILED;
35616
+ }
34756
35617
  if (s1 !== peg$FAILED) {
34757
35618
  s2 = peg$currPos;
34758
35619
  peg$silentFails++;
34759
35620
  s3 = peg$currPos;
34760
- if (input.substr(peg$currPos, 3) === peg$c12) {
34761
- s4 = peg$c12;
35621
+ if (input.substr(peg$currPos, 3) === peg$c13) {
35622
+ s4 = peg$c13;
34762
35623
  peg$currPos += 3;
34763
35624
  } else {
34764
35625
  s4 = peg$FAILED;
34765
35626
  if (peg$silentFails === 0) {
34766
- peg$fail(peg$e14);
35627
+ peg$fail(peg$e15);
34767
35628
  }
34768
35629
  }
34769
35630
  if (s4 !== peg$FAILED) {
@@ -34788,7 +35649,7 @@ function peg$parse2(input, options) {
34788
35649
  }
34789
35650
  if (s2 !== peg$FAILED) {
34790
35651
  peg$savedPos = s0;
34791
- s0 = peg$f26();
35652
+ s0 = peg$f32();
34792
35653
  } else {
34793
35654
  peg$currPos = s0;
34794
35655
  s0 = peg$FAILED;
@@ -34826,7 +35687,7 @@ function peg$parse2(input, options) {
34826
35687
  }
34827
35688
  if (s1 !== peg$FAILED) {
34828
35689
  peg$savedPos = s0;
34829
- s1 = peg$f27();
35690
+ s1 = peg$f33();
34830
35691
  }
34831
35692
  s0 = s1;
34832
35693
  return s0;
@@ -34837,7 +35698,7 @@ function peg$parse2(input, options) {
34837
35698
  s1 = peg$parseCardLineOrDivider_V1();
34838
35699
  if (s1 !== peg$FAILED) {
34839
35700
  peg$savedPos = s0;
34840
- s1 = peg$f28(s1);
35701
+ s1 = peg$f34(s1);
34841
35702
  }
34842
35703
  s0 = s1;
34843
35704
  return s0;
@@ -34846,13 +35707,13 @@ function peg$parse2(input, options) {
34846
35707
  let s0, s1, s2, s3;
34847
35708
  s0 = peg$currPos;
34848
35709
  s1 = peg$currPos;
34849
- if (input.substr(peg$currPos, 3) === peg$c12) {
34850
- s2 = peg$c12;
35710
+ if (input.substr(peg$currPos, 3) === peg$c13) {
35711
+ s2 = peg$c13;
34851
35712
  peg$currPos += 3;
34852
35713
  } else {
34853
35714
  s2 = peg$FAILED;
34854
35715
  if (peg$silentFails === 0) {
34855
- peg$fail(peg$e14);
35716
+ peg$fail(peg$e15);
34856
35717
  }
34857
35718
  }
34858
35719
  if (s2 !== peg$FAILED) {
@@ -34873,13 +35734,13 @@ function peg$parse2(input, options) {
34873
35734
  }
34874
35735
  if (s1 === peg$FAILED) {
34875
35736
  s1 = peg$currPos;
34876
- if (input.substr(peg$currPos, 2) === peg$c13) {
34877
- s2 = peg$c13;
35737
+ if (input.substr(peg$currPos, 2) === peg$c14) {
35738
+ s2 = peg$c14;
34878
35739
  peg$currPos += 2;
34879
35740
  } else {
34880
35741
  s2 = peg$FAILED;
34881
35742
  if (peg$silentFails === 0) {
34882
- peg$fail(peg$e15);
35743
+ peg$fail(peg$e16);
34883
35744
  }
34884
35745
  }
34885
35746
  if (s2 !== peg$FAILED) {
@@ -34900,13 +35761,13 @@ function peg$parse2(input, options) {
34900
35761
  }
34901
35762
  if (s1 === peg$FAILED) {
34902
35763
  s1 = peg$currPos;
34903
- if (input.substr(peg$currPos, 2) === peg$c10) {
34904
- s2 = peg$c10;
35764
+ if (input.substr(peg$currPos, 2) === peg$c11) {
35765
+ s2 = peg$c11;
34905
35766
  peg$currPos += 2;
34906
35767
  } else {
34907
35768
  s2 = peg$FAILED;
34908
35769
  if (peg$silentFails === 0) {
34909
- peg$fail(peg$e12);
35770
+ peg$fail(peg$e13);
34910
35771
  }
34911
35772
  }
34912
35773
  if (s2 !== peg$FAILED) {
@@ -34932,7 +35793,7 @@ function peg$parse2(input, options) {
34932
35793
  }
34933
35794
  if (s1 !== peg$FAILED) {
34934
35795
  peg$savedPos = s0;
34935
- s1 = peg$f29(s1);
35796
+ s1 = peg$f35(s1);
34936
35797
  }
34937
35798
  s0 = s1;
34938
35799
  return s0;
@@ -35009,7 +35870,7 @@ function peg$parse2(input, options) {
35009
35870
  }
35010
35871
  if (s2 !== peg$FAILED) {
35011
35872
  peg$savedPos = s0;
35012
- s0 = peg$f30(s2);
35873
+ s0 = peg$f36(s2);
35013
35874
  } else {
35014
35875
  peg$currPos = s0;
35015
35876
  s0 = peg$FAILED;
@@ -35020,6 +35881,102 @@ function peg$parse2(input, options) {
35020
35881
  }
35021
35882
  return s0;
35022
35883
  }
35884
+ function peg$parseQualifier() {
35885
+ let s0, s1, s2;
35886
+ s0 = peg$currPos;
35887
+ s1 = peg$currPos;
35888
+ peg$silentFails++;
35889
+ if (input.substr(peg$currPos, 6) === peg$c9) {
35890
+ s2 = peg$c9;
35891
+ peg$currPos += 6;
35892
+ } else {
35893
+ s2 = peg$FAILED;
35894
+ if (peg$silentFails === 0) {
35895
+ peg$fail(peg$e11);
35896
+ }
35897
+ }
35898
+ if (s2 === peg$FAILED) {
35899
+ if (input.substr(peg$currPos, 4) === peg$c7) {
35900
+ s2 = peg$c7;
35901
+ peg$currPos += 4;
35902
+ } else {
35903
+ s2 = peg$FAILED;
35904
+ if (peg$silentFails === 0) {
35905
+ peg$fail(peg$e9);
35906
+ }
35907
+ }
35908
+ }
35909
+ peg$silentFails--;
35910
+ if (s2 === peg$FAILED) {
35911
+ s1 = void 0;
35912
+ } else {
35913
+ peg$currPos = s1;
35914
+ s1 = peg$FAILED;
35915
+ }
35916
+ if (s1 !== peg$FAILED) {
35917
+ s2 = peg$parseQualifierName();
35918
+ if (s2 !== peg$FAILED) {
35919
+ peg$savedPos = s0;
35920
+ s0 = peg$f37(s2);
35921
+ } else {
35922
+ peg$currPos = s0;
35923
+ s0 = peg$FAILED;
35924
+ }
35925
+ } else {
35926
+ peg$currPos = s0;
35927
+ s0 = peg$FAILED;
35928
+ }
35929
+ return s0;
35930
+ }
35931
+ function peg$parseQualifierName() {
35932
+ let s0, s1, s2, s3, s4;
35933
+ s0 = peg$currPos;
35934
+ s1 = peg$currPos;
35935
+ s2 = input.charAt(peg$currPos);
35936
+ if (peg$r1.test(s2)) {
35937
+ peg$currPos++;
35938
+ } else {
35939
+ s2 = peg$FAILED;
35940
+ if (peg$silentFails === 0) {
35941
+ peg$fail(peg$e17);
35942
+ }
35943
+ }
35944
+ if (s2 !== peg$FAILED) {
35945
+ s3 = [];
35946
+ s4 = input.charAt(peg$currPos);
35947
+ if (peg$r2.test(s4)) {
35948
+ peg$currPos++;
35949
+ } else {
35950
+ s4 = peg$FAILED;
35951
+ if (peg$silentFails === 0) {
35952
+ peg$fail(peg$e18);
35953
+ }
35954
+ }
35955
+ while (s4 !== peg$FAILED) {
35956
+ s3.push(s4);
35957
+ s4 = input.charAt(peg$currPos);
35958
+ if (peg$r2.test(s4)) {
35959
+ peg$currPos++;
35960
+ } else {
35961
+ s4 = peg$FAILED;
35962
+ if (peg$silentFails === 0) {
35963
+ peg$fail(peg$e18);
35964
+ }
35965
+ }
35966
+ }
35967
+ s2 = [s2, s3];
35968
+ s1 = s2;
35969
+ } else {
35970
+ peg$currPos = s1;
35971
+ s1 = peg$FAILED;
35972
+ }
35973
+ if (s1 !== peg$FAILED) {
35974
+ s0 = input.substring(s0, peg$currPos);
35975
+ } else {
35976
+ s0 = s1;
35977
+ }
35978
+ return s0;
35979
+ }
35023
35980
  function peg$parsecardContent() {
35024
35981
  let s0, s1, s2;
35025
35982
  s0 = peg$currPos;
@@ -35036,7 +35993,7 @@ function peg$parse2(input, options) {
35036
35993
  }
35037
35994
  }
35038
35995
  peg$savedPos = s0;
35039
- s1 = peg$f31(s1);
35996
+ s1 = peg$f38(s1);
35040
35997
  s0 = s1;
35041
35998
  return s0;
35042
35999
  }
@@ -35054,7 +36011,7 @@ function peg$parse2(input, options) {
35054
36011
  }
35055
36012
  if (s1 !== peg$FAILED) {
35056
36013
  peg$savedPos = s0;
35057
- s1 = peg$f32(s1);
36014
+ s1 = peg$f39(s1);
35058
36015
  }
35059
36016
  s0 = s1;
35060
36017
  return s0;
@@ -35062,13 +36019,13 @@ function peg$parse2(input, options) {
35062
36019
  function peg$parseIDTag() {
35063
36020
  let s0, s1, s2, s3;
35064
36021
  s0 = peg$currPos;
35065
- if (input.substr(peg$currPos, 4) === peg$c14) {
35066
- s1 = peg$c14;
36022
+ if (input.substr(peg$currPos, 4) === peg$c15) {
36023
+ s1 = peg$c15;
35067
36024
  peg$currPos += 4;
35068
36025
  } else {
35069
36026
  s1 = peg$FAILED;
35070
36027
  if (peg$silentFails === 0) {
35071
- peg$fail(peg$e16);
36028
+ peg$fail(peg$e19);
35072
36029
  }
35073
36030
  }
35074
36031
  if (s1 !== peg$FAILED) {
@@ -35077,7 +36034,7 @@ function peg$parse2(input, options) {
35077
36034
  s3 = peg$parseTag_Close();
35078
36035
  if (s3 !== peg$FAILED) {
35079
36036
  peg$savedPos = s0;
35080
- s0 = peg$f33(s2);
36037
+ s0 = peg$f40(s2);
35081
36038
  } else {
35082
36039
  peg$currPos = s0;
35083
36040
  s0 = peg$FAILED;
@@ -35107,24 +36064,24 @@ function peg$parse2(input, options) {
35107
36064
  if (s1 !== peg$FAILED) {
35108
36065
  s2 = [];
35109
36066
  if (input.charCodeAt(peg$currPos) === 35) {
35110
- s3 = peg$c15;
36067
+ s3 = peg$c16;
35111
36068
  peg$currPos++;
35112
36069
  } else {
35113
36070
  s3 = peg$FAILED;
35114
36071
  if (peg$silentFails === 0) {
35115
- peg$fail(peg$e17);
36072
+ peg$fail(peg$e20);
35116
36073
  }
35117
36074
  }
35118
36075
  if (s3 !== peg$FAILED) {
35119
36076
  while (s3 !== peg$FAILED) {
35120
36077
  s2.push(s3);
35121
36078
  if (input.charCodeAt(peg$currPos) === 35) {
35122
- s3 = peg$c15;
36079
+ s3 = peg$c16;
35123
36080
  peg$currPos++;
35124
36081
  } else {
35125
36082
  s3 = peg$FAILED;
35126
36083
  if (peg$silentFails === 0) {
35127
- peg$fail(peg$e17);
36084
+ peg$fail(peg$e20);
35128
36085
  }
35129
36086
  }
35130
36087
  }
@@ -35136,7 +36093,7 @@ function peg$parse2(input, options) {
35136
36093
  s4 = peg$parseTag_CloseOrEOF();
35137
36094
  if (s4 !== peg$FAILED) {
35138
36095
  peg$savedPos = s0;
35139
- s0 = peg$f34(s2, s3);
36096
+ s0 = peg$f41(s2, s3);
35140
36097
  } else {
35141
36098
  peg$currPos = s0;
35142
36099
  s0 = peg$FAILED;
@@ -35154,13 +36111,13 @@ function peg$parse2(input, options) {
35154
36111
  function peg$parseAnchorTag() {
35155
36112
  let s0, s1, s2, s3;
35156
36113
  s0 = peg$currPos;
35157
- if (input.substr(peg$currPos, 2) === peg$c16) {
35158
- s1 = peg$c16;
36114
+ if (input.substr(peg$currPos, 2) === peg$c17) {
36115
+ s1 = peg$c17;
35159
36116
  peg$currPos += 2;
35160
36117
  } else {
35161
36118
  s1 = peg$FAILED;
35162
36119
  if (peg$silentFails === 0) {
35163
- peg$fail(peg$e18);
36120
+ peg$fail(peg$e21);
35164
36121
  }
35165
36122
  }
35166
36123
  if (s1 !== peg$FAILED) {
@@ -35168,7 +36125,7 @@ function peg$parse2(input, options) {
35168
36125
  s3 = peg$parseTag_CloseOrEOF();
35169
36126
  if (s3 !== peg$FAILED) {
35170
36127
  peg$savedPos = s0;
35171
- s0 = peg$f35(s2);
36128
+ s0 = peg$f42(s2);
35172
36129
  } else {
35173
36130
  peg$currPos = s0;
35174
36131
  s0 = peg$FAILED;
@@ -35182,13 +36139,13 @@ function peg$parse2(input, options) {
35182
36139
  function peg$parseReferenceTag() {
35183
36140
  let s0, s1, s2, s3;
35184
36141
  s0 = peg$currPos;
35185
- if (input.substr(peg$currPos, 2) === peg$c17) {
35186
- s1 = peg$c17;
36142
+ if (input.substr(peg$currPos, 2) === peg$c18) {
36143
+ s1 = peg$c18;
35187
36144
  peg$currPos += 2;
35188
36145
  } else {
35189
36146
  s1 = peg$FAILED;
35190
36147
  if (peg$silentFails === 0) {
35191
- peg$fail(peg$e19);
36148
+ peg$fail(peg$e22);
35192
36149
  }
35193
36150
  }
35194
36151
  if (s1 !== peg$FAILED) {
@@ -35196,7 +36153,7 @@ function peg$parse2(input, options) {
35196
36153
  s3 = peg$parseTag_CloseOrEOF();
35197
36154
  if (s3 !== peg$FAILED) {
35198
36155
  peg$savedPos = s0;
35199
- s0 = peg$f36(s2);
36156
+ s0 = peg$f43(s2);
35200
36157
  } else {
35201
36158
  peg$currPos = s0;
35202
36159
  s0 = peg$FAILED;
@@ -35210,13 +36167,13 @@ function peg$parse2(input, options) {
35210
36167
  function peg$parsePropertyTag() {
35211
36168
  let s0, s1, s2, s3, s4;
35212
36169
  s0 = peg$currPos;
35213
- if (input.substr(peg$currPos, 2) === peg$c18) {
35214
- s1 = peg$c18;
36170
+ if (input.substr(peg$currPos, 2) === peg$c19) {
36171
+ s1 = peg$c19;
35215
36172
  peg$currPos += 2;
35216
36173
  } else {
35217
36174
  s1 = peg$FAILED;
35218
36175
  if (peg$silentFails === 0) {
35219
- peg$fail(peg$e20);
36176
+ peg$fail(peg$e23);
35220
36177
  }
35221
36178
  }
35222
36179
  if (s1 !== peg$FAILED) {
@@ -35227,7 +36184,7 @@ function peg$parse2(input, options) {
35227
36184
  s4 = peg$parseTag_CloseOrEOF();
35228
36185
  if (s4 !== peg$FAILED) {
35229
36186
  peg$savedPos = s0;
35230
- s0 = peg$f37(s2, s3);
36187
+ s0 = peg$f44(s2, s3);
35231
36188
  } else {
35232
36189
  peg$currPos = s0;
35233
36190
  s0 = peg$FAILED;
@@ -35249,13 +36206,13 @@ function peg$parse2(input, options) {
35249
36206
  function peg$parseItemLeadTag() {
35250
36207
  let s0, s1, s2, s3;
35251
36208
  s0 = peg$currPos;
35252
- if (input.substr(peg$currPos, 2) === peg$c19) {
35253
- s1 = peg$c19;
36209
+ if (input.substr(peg$currPos, 2) === peg$c20) {
36210
+ s1 = peg$c20;
35254
36211
  peg$currPos += 2;
35255
36212
  } else {
35256
36213
  s1 = peg$FAILED;
35257
36214
  if (peg$silentFails === 0) {
35258
- peg$fail(peg$e21);
36215
+ peg$fail(peg$e24);
35259
36216
  }
35260
36217
  }
35261
36218
  if (s1 !== peg$FAILED) {
@@ -35263,7 +36220,7 @@ function peg$parse2(input, options) {
35263
36220
  s3 = peg$parseTag_CloseOrEOF();
35264
36221
  if (s3 !== peg$FAILED) {
35265
36222
  peg$savedPos = s0;
35266
- s0 = peg$f38(s2);
36223
+ s0 = peg$f45(s2);
35267
36224
  } else {
35268
36225
  peg$currPos = s0;
35269
36226
  s0 = peg$FAILED;
@@ -35277,13 +36234,13 @@ function peg$parse2(input, options) {
35277
36234
  function peg$parseInstructionTag() {
35278
36235
  let s0, s1, s2, s3;
35279
36236
  s0 = peg$currPos;
35280
- if (input.substr(peg$currPos, 2) === peg$c20) {
35281
- s1 = peg$c20;
36237
+ if (input.substr(peg$currPos, 2) === peg$c21) {
36238
+ s1 = peg$c21;
35282
36239
  peg$currPos += 2;
35283
36240
  } else {
35284
36241
  s1 = peg$FAILED;
35285
36242
  if (peg$silentFails === 0) {
35286
- peg$fail(peg$e22);
36243
+ peg$fail(peg$e25);
35287
36244
  }
35288
36245
  }
35289
36246
  if (s1 !== peg$FAILED) {
@@ -35291,7 +36248,7 @@ function peg$parse2(input, options) {
35291
36248
  s3 = peg$parseTag_CloseOrEOF();
35292
36249
  if (s3 !== peg$FAILED) {
35293
36250
  peg$savedPos = s0;
35294
- s0 = peg$f39(s2);
36251
+ s0 = peg$f46(s2);
35295
36252
  } else {
35296
36253
  peg$currPos = s0;
35297
36254
  s0 = peg$FAILED;
@@ -35305,13 +36262,13 @@ function peg$parse2(input, options) {
35305
36262
  function peg$parseHintTag() {
35306
36263
  let s0, s1, s2, s3;
35307
36264
  s0 = peg$currPos;
35308
- if (input.substr(peg$currPos, 2) === peg$c21) {
35309
- s1 = peg$c21;
36265
+ if (input.substr(peg$currPos, 2) === peg$c22) {
36266
+ s1 = peg$c22;
35310
36267
  peg$currPos += 2;
35311
36268
  } else {
35312
36269
  s1 = peg$FAILED;
35313
36270
  if (peg$silentFails === 0) {
35314
- peg$fail(peg$e23);
36271
+ peg$fail(peg$e26);
35315
36272
  }
35316
36273
  }
35317
36274
  if (s1 !== peg$FAILED) {
@@ -35319,7 +36276,7 @@ function peg$parse2(input, options) {
35319
36276
  s3 = peg$parseTag_CloseOrEOF();
35320
36277
  if (s3 !== peg$FAILED) {
35321
36278
  peg$savedPos = s0;
35322
- s0 = peg$f40(s2);
36279
+ s0 = peg$f47(s2);
35323
36280
  } else {
35324
36281
  peg$currPos = s0;
35325
36282
  s0 = peg$FAILED;
@@ -35333,13 +36290,13 @@ function peg$parse2(input, options) {
35333
36290
  function peg$parseTrueTag() {
35334
36291
  let s0, s1, s2, s3;
35335
36292
  s0 = peg$currPos;
35336
- if (input.substr(peg$currPos, 2) === peg$c22) {
35337
- s1 = peg$c22;
36293
+ if (input.substr(peg$currPos, 2) === peg$c23) {
36294
+ s1 = peg$c23;
35338
36295
  peg$currPos += 2;
35339
36296
  } else {
35340
36297
  s1 = peg$FAILED;
35341
36298
  if (peg$silentFails === 0) {
35342
- peg$fail(peg$e24);
36299
+ peg$fail(peg$e27);
35343
36300
  }
35344
36301
  }
35345
36302
  if (s1 !== peg$FAILED) {
@@ -35347,7 +36304,7 @@ function peg$parse2(input, options) {
35347
36304
  s3 = peg$parseTag_CloseOrEOF();
35348
36305
  if (s3 !== peg$FAILED) {
35349
36306
  peg$savedPos = s0;
35350
- s0 = peg$f41(s2);
36307
+ s0 = peg$f48(s2);
35351
36308
  } else {
35352
36309
  peg$currPos = s0;
35353
36310
  s0 = peg$FAILED;
@@ -35361,13 +36318,13 @@ function peg$parse2(input, options) {
35361
36318
  function peg$parseFalseTag() {
35362
36319
  let s0, s1, s2, s3;
35363
36320
  s0 = peg$currPos;
35364
- if (input.substr(peg$currPos, 2) === peg$c23) {
35365
- s1 = peg$c23;
36321
+ if (input.substr(peg$currPos, 2) === peg$c24) {
36322
+ s1 = peg$c24;
35366
36323
  peg$currPos += 2;
35367
36324
  } else {
35368
36325
  s1 = peg$FAILED;
35369
36326
  if (peg$silentFails === 0) {
35370
- peg$fail(peg$e25);
36327
+ peg$fail(peg$e28);
35371
36328
  }
35372
36329
  }
35373
36330
  if (s1 !== peg$FAILED) {
@@ -35375,7 +36332,7 @@ function peg$parse2(input, options) {
35375
36332
  s3 = peg$parseTag_CloseOrEOF();
35376
36333
  if (s3 !== peg$FAILED) {
35377
36334
  peg$savedPos = s0;
35378
- s0 = peg$f42(s2);
36335
+ s0 = peg$f49(s2);
35379
36336
  } else {
35380
36337
  peg$currPos = s0;
35381
36338
  s0 = peg$FAILED;
@@ -35389,13 +36346,13 @@ function peg$parse2(input, options) {
35389
36346
  function peg$parseSampleSolutionTag() {
35390
36347
  let s0, s1, s2, s3;
35391
36348
  s0 = peg$currPos;
35392
- if (input.substr(peg$currPos, 2) === peg$c24) {
35393
- s1 = peg$c24;
36349
+ if (input.substr(peg$currPos, 2) === peg$c25) {
36350
+ s1 = peg$c25;
35394
36351
  peg$currPos += 2;
35395
36352
  } else {
35396
36353
  s1 = peg$FAILED;
35397
36354
  if (peg$silentFails === 0) {
35398
- peg$fail(peg$e26);
36355
+ peg$fail(peg$e29);
35399
36356
  }
35400
36357
  }
35401
36358
  if (s1 !== peg$FAILED) {
@@ -35403,7 +36360,7 @@ function peg$parse2(input, options) {
35403
36360
  s3 = peg$parseTag_CloseOrEOF();
35404
36361
  if (s3 !== peg$FAILED) {
35405
36362
  peg$savedPos = s0;
35406
- s0 = peg$f43(s2);
36363
+ s0 = peg$f50(s2);
35407
36364
  } else {
35408
36365
  peg$currPos = s0;
35409
36366
  s0 = peg$FAILED;
@@ -35417,13 +36374,13 @@ function peg$parse2(input, options) {
35417
36374
  function peg$parseGapTag() {
35418
36375
  let s0, s1, s2, s3;
35419
36376
  s0 = peg$currPos;
35420
- if (input.substr(peg$currPos, 2) === peg$c25) {
35421
- s1 = peg$c25;
36377
+ if (input.substr(peg$currPos, 2) === peg$c26) {
36378
+ s1 = peg$c26;
35422
36379
  peg$currPos += 2;
35423
36380
  } else {
35424
36381
  s1 = peg$FAILED;
35425
36382
  if (peg$silentFails === 0) {
35426
- peg$fail(peg$e27);
36383
+ peg$fail(peg$e30);
35427
36384
  }
35428
36385
  }
35429
36386
  if (s1 !== peg$FAILED) {
@@ -35431,7 +36388,7 @@ function peg$parse2(input, options) {
35431
36388
  s3 = peg$parseTag_CloseOrEOF();
35432
36389
  if (s3 !== peg$FAILED) {
35433
36390
  peg$savedPos = s0;
35434
- s0 = peg$f44(s2);
36391
+ s0 = peg$f51(s2);
35435
36392
  } else {
35436
36393
  peg$currPos = s0;
35437
36394
  s0 = peg$FAILED;
@@ -35445,13 +36402,13 @@ function peg$parse2(input, options) {
35445
36402
  function peg$parseMarkTag() {
35446
36403
  let s0, s1, s2, s3;
35447
36404
  s0 = peg$currPos;
35448
- if (input.substr(peg$currPos, 2) === peg$c26) {
35449
- s1 = peg$c26;
36405
+ if (input.substr(peg$currPos, 2) === peg$c27) {
36406
+ s1 = peg$c27;
35450
36407
  peg$currPos += 2;
35451
36408
  } else {
35452
36409
  s1 = peg$FAILED;
35453
36410
  if (peg$silentFails === 0) {
35454
- peg$fail(peg$e28);
36411
+ peg$fail(peg$e31);
35455
36412
  }
35456
36413
  }
35457
36414
  if (s1 !== peg$FAILED) {
@@ -35459,7 +36416,7 @@ function peg$parse2(input, options) {
35459
36416
  s3 = peg$parseTag_CloseOrEOF();
35460
36417
  if (s3 !== peg$FAILED) {
35461
36418
  peg$savedPos = s0;
35462
- s0 = peg$f45(s2);
36419
+ s0 = peg$f52(s2);
35463
36420
  } else {
35464
36421
  peg$currPos = s0;
35465
36422
  s0 = peg$FAILED;
@@ -35473,13 +36430,13 @@ function peg$parse2(input, options) {
35473
36430
  function peg$parseResourceTag() {
35474
36431
  let s0, s1, s2, s3, s4;
35475
36432
  s0 = peg$currPos;
35476
- if (input.substr(peg$currPos, 2) === peg$c27) {
35477
- s1 = peg$c27;
36433
+ if (input.substr(peg$currPos, 2) === peg$c28) {
36434
+ s1 = peg$c28;
35478
36435
  peg$currPos += 2;
35479
36436
  } else {
35480
36437
  s1 = peg$FAILED;
35481
36438
  if (peg$silentFails === 0) {
35482
- peg$fail(peg$e29);
36439
+ peg$fail(peg$e32);
35483
36440
  }
35484
36441
  }
35485
36442
  if (s1 !== peg$FAILED) {
@@ -35490,7 +36447,7 @@ function peg$parse2(input, options) {
35490
36447
  s4 = peg$parseTag_CloseOrEOF();
35491
36448
  if (s4 !== peg$FAILED) {
35492
36449
  peg$savedPos = s0;
35493
- s0 = peg$f46(s2, s3);
36450
+ s0 = peg$f53(s2, s3);
35494
36451
  } else {
35495
36452
  peg$currPos = s0;
35496
36453
  s0 = peg$FAILED;
@@ -35514,13 +36471,13 @@ function peg$parse2(input, options) {
35514
36471
  s0 = peg$currPos;
35515
36472
  s1 = peg$currPos;
35516
36473
  s2 = [];
35517
- if (input.substr(peg$currPos, 2) === peg$c28) {
35518
- s3 = peg$c28;
36474
+ if (input.substr(peg$currPos, 2) === peg$c29) {
36475
+ s3 = peg$c29;
35519
36476
  peg$currPos += 2;
35520
36477
  } else {
35521
36478
  s3 = peg$FAILED;
35522
36479
  if (peg$silentFails === 0) {
35523
- peg$fail(peg$e30);
36480
+ peg$fail(peg$e33);
35524
36481
  }
35525
36482
  }
35526
36483
  if (s3 === peg$FAILED) {
@@ -35536,13 +36493,13 @@ function peg$parse2(input, options) {
35536
36493
  }
35537
36494
  while (s3 !== peg$FAILED) {
35538
36495
  s2.push(s3);
35539
- if (input.substr(peg$currPos, 2) === peg$c28) {
35540
- s3 = peg$c28;
36496
+ if (input.substr(peg$currPos, 2) === peg$c29) {
36497
+ s3 = peg$c29;
35541
36498
  peg$currPos += 2;
35542
36499
  } else {
35543
36500
  s3 = peg$FAILED;
35544
36501
  if (peg$silentFails === 0) {
35545
- peg$fail(peg$e30);
36502
+ peg$fail(peg$e33);
35546
36503
  }
35547
36504
  }
35548
36505
  if (s3 === peg$FAILED) {
@@ -35559,7 +36516,7 @@ function peg$parse2(input, options) {
35559
36516
  }
35560
36517
  s1 = input.substring(s1, peg$currPos);
35561
36518
  peg$savedPos = s0;
35562
- s1 = peg$f47(s1);
36519
+ s1 = peg$f54(s1);
35563
36520
  s0 = s1;
35564
36521
  return s0;
35565
36522
  }
@@ -35568,13 +36525,13 @@ function peg$parse2(input, options) {
35568
36525
  s0 = peg$currPos;
35569
36526
  s1 = peg$currPos;
35570
36527
  peg$silentFails++;
35571
- if (input.substr(peg$currPos, 3) === peg$c29) {
35572
- s2 = peg$c29;
36528
+ if (input.substr(peg$currPos, 3) === peg$c30) {
36529
+ s2 = peg$c30;
35573
36530
  peg$currPos += 3;
35574
36531
  } else {
35575
36532
  s2 = peg$FAILED;
35576
36533
  if (peg$silentFails === 0) {
35577
- peg$fail(peg$e31);
36534
+ peg$fail(peg$e34);
35578
36535
  }
35579
36536
  }
35580
36537
  peg$silentFails--;
@@ -35588,29 +36545,29 @@ function peg$parse2(input, options) {
35588
36545
  s2 = peg$currPos;
35589
36546
  s3 = [];
35590
36547
  s4 = input.charAt(peg$currPos);
35591
- if (peg$r1.test(s4)) {
36548
+ if (peg$r3.test(s4)) {
35592
36549
  peg$currPos++;
35593
36550
  } else {
35594
36551
  s4 = peg$FAILED;
35595
36552
  if (peg$silentFails === 0) {
35596
- peg$fail(peg$e32);
36553
+ peg$fail(peg$e35);
35597
36554
  }
35598
36555
  }
35599
36556
  while (s4 !== peg$FAILED) {
35600
36557
  s3.push(s4);
35601
36558
  s4 = input.charAt(peg$currPos);
35602
- if (peg$r1.test(s4)) {
36559
+ if (peg$r3.test(s4)) {
35603
36560
  peg$currPos++;
35604
36561
  } else {
35605
36562
  s4 = peg$FAILED;
35606
36563
  if (peg$silentFails === 0) {
35607
- peg$fail(peg$e32);
36564
+ peg$fail(peg$e35);
35608
36565
  }
35609
36566
  }
35610
36567
  }
35611
36568
  s2 = input.substring(s2, peg$currPos);
35612
36569
  peg$savedPos = s0;
35613
- s0 = peg$f48(s2);
36570
+ s0 = peg$f55(s2);
35614
36571
  } else {
35615
36572
  peg$currPos = s0;
35616
36573
  s0 = peg$FAILED;
@@ -35665,24 +36622,24 @@ function peg$parse2(input, options) {
35665
36622
  s0 = peg$currPos;
35666
36623
  s1 = [];
35667
36624
  if (input.charCodeAt(peg$currPos) === 46) {
35668
- s2 = peg$c30;
36625
+ s2 = peg$c31;
35669
36626
  peg$currPos++;
35670
36627
  } else {
35671
36628
  s2 = peg$FAILED;
35672
36629
  if (peg$silentFails === 0) {
35673
- peg$fail(peg$e33);
36630
+ peg$fail(peg$e36);
35674
36631
  }
35675
36632
  }
35676
36633
  if (s2 !== peg$FAILED) {
35677
36634
  while (s2 !== peg$FAILED) {
35678
36635
  s1.push(s2);
35679
36636
  if (input.charCodeAt(peg$currPos) === 46) {
35680
- s2 = peg$c30;
36637
+ s2 = peg$c31;
35681
36638
  peg$currPos++;
35682
36639
  } else {
35683
36640
  s2 = peg$FAILED;
35684
36641
  if (peg$silentFails === 0) {
35685
- peg$fail(peg$e33);
36642
+ peg$fail(peg$e36);
35686
36643
  }
35687
36644
  }
35688
36645
  }
@@ -35691,7 +36648,7 @@ function peg$parse2(input, options) {
35691
36648
  }
35692
36649
  if (s1 !== peg$FAILED) {
35693
36650
  peg$savedPos = s0;
35694
- s1 = peg$f49(s1);
36651
+ s1 = peg$f56(s1);
35695
36652
  }
35696
36653
  s0 = s1;
35697
36654
  return s0;
@@ -35702,29 +36659,29 @@ function peg$parse2(input, options) {
35702
36659
  s1 = peg$currPos;
35703
36660
  s2 = [];
35704
36661
  s3 = input.charAt(peg$currPos);
35705
- if (peg$r2.test(s3)) {
36662
+ if (peg$r4.test(s3)) {
35706
36663
  peg$currPos++;
35707
36664
  } else {
35708
36665
  s3 = peg$FAILED;
35709
36666
  if (peg$silentFails === 0) {
35710
- peg$fail(peg$e34);
36667
+ peg$fail(peg$e37);
35711
36668
  }
35712
36669
  }
35713
36670
  while (s3 !== peg$FAILED) {
35714
36671
  s2.push(s3);
35715
36672
  s3 = input.charAt(peg$currPos);
35716
- if (peg$r2.test(s3)) {
36673
+ if (peg$r4.test(s3)) {
35717
36674
  peg$currPos++;
35718
36675
  } else {
35719
36676
  s3 = peg$FAILED;
35720
36677
  if (peg$silentFails === 0) {
35721
- peg$fail(peg$e34);
36678
+ peg$fail(peg$e37);
35722
36679
  }
35723
36680
  }
35724
36681
  }
35725
36682
  s1 = input.substring(s1, peg$currPos);
35726
36683
  peg$savedPos = s0;
35727
- s1 = peg$f50(s1);
36684
+ s1 = peg$f57(s1);
35728
36685
  s0 = s1;
35729
36686
  return s0;
35730
36687
  }
@@ -35743,7 +36700,7 @@ function peg$parse2(input, options) {
35743
36700
  if (s1 !== peg$FAILED) {
35744
36701
  s2 = peg$parseTag_Value();
35745
36702
  peg$savedPos = s0;
35746
- s0 = peg$f51(s2);
36703
+ s0 = peg$f58(s2);
35747
36704
  } else {
35748
36705
  peg$currPos = s0;
35749
36706
  s0 = peg$FAILED;
@@ -35752,7 +36709,7 @@ function peg$parse2(input, options) {
35752
36709
  s0 = peg$currPos;
35753
36710
  s1 = "";
35754
36711
  peg$savedPos = s0;
35755
- s1 = peg$f52();
36712
+ s1 = peg$f59();
35756
36713
  s0 = s1;
35757
36714
  }
35758
36715
  return s0;
@@ -35789,19 +36746,19 @@ function peg$parse2(input, options) {
35789
36746
  let s0, s1;
35790
36747
  peg$silentFails++;
35791
36748
  s0 = input.charAt(peg$currPos);
35792
- if (peg$r3.test(s0)) {
36749
+ if (peg$r5.test(s0)) {
35793
36750
  peg$currPos++;
35794
36751
  } else {
35795
36752
  s0 = peg$FAILED;
35796
36753
  if (peg$silentFails === 0) {
35797
- peg$fail(peg$e36);
36754
+ peg$fail(peg$e39);
35798
36755
  }
35799
36756
  }
35800
36757
  peg$silentFails--;
35801
36758
  if (s0 === peg$FAILED) {
35802
36759
  s1 = peg$FAILED;
35803
36760
  if (peg$silentFails === 0) {
35804
- peg$fail(peg$e35);
36761
+ peg$fail(peg$e38);
35805
36762
  }
35806
36763
  }
35807
36764
  return s0;
@@ -35824,23 +36781,23 @@ function peg$parse2(input, options) {
35824
36781
  s0 = peg$currPos;
35825
36782
  s1 = [];
35826
36783
  s2 = input.charAt(peg$currPos);
35827
- if (peg$r4.test(s2)) {
36784
+ if (peg$r6.test(s2)) {
35828
36785
  peg$currPos++;
35829
36786
  } else {
35830
36787
  s2 = peg$FAILED;
35831
36788
  if (peg$silentFails === 0) {
35832
- peg$fail(peg$e38);
36789
+ peg$fail(peg$e41);
35833
36790
  }
35834
36791
  }
35835
36792
  while (s2 !== peg$FAILED) {
35836
36793
  s1.push(s2);
35837
36794
  s2 = input.charAt(peg$currPos);
35838
- if (peg$r4.test(s2)) {
36795
+ if (peg$r6.test(s2)) {
35839
36796
  peg$currPos++;
35840
36797
  } else {
35841
36798
  s2 = peg$FAILED;
35842
36799
  if (peg$silentFails === 0) {
35843
- peg$fail(peg$e38);
36800
+ peg$fail(peg$e41);
35844
36801
  }
35845
36802
  }
35846
36803
  }
@@ -35856,7 +36813,7 @@ function peg$parse2(input, options) {
35856
36813
  if (s0 === peg$FAILED) {
35857
36814
  s1 = peg$FAILED;
35858
36815
  if (peg$silentFails === 0) {
35859
- peg$fail(peg$e37);
36816
+ peg$fail(peg$e40);
35860
36817
  }
35861
36818
  }
35862
36819
  return s0;
@@ -35865,32 +36822,32 @@ function peg$parse2(input, options) {
35865
36822
  let s0, s1;
35866
36823
  peg$silentFails++;
35867
36824
  if (input.charCodeAt(peg$currPos) === 10) {
35868
- s0 = peg$c31;
36825
+ s0 = peg$c32;
35869
36826
  peg$currPos++;
35870
36827
  } else {
35871
36828
  s0 = peg$FAILED;
35872
36829
  if (peg$silentFails === 0) {
35873
- peg$fail(peg$e40);
36830
+ peg$fail(peg$e43);
35874
36831
  }
35875
36832
  }
35876
36833
  if (s0 === peg$FAILED) {
35877
- if (input.substr(peg$currPos, 2) === peg$c32) {
35878
- s0 = peg$c32;
36834
+ if (input.substr(peg$currPos, 2) === peg$c33) {
36835
+ s0 = peg$c33;
35879
36836
  peg$currPos += 2;
35880
36837
  } else {
35881
36838
  s0 = peg$FAILED;
35882
36839
  if (peg$silentFails === 0) {
35883
- peg$fail(peg$e41);
36840
+ peg$fail(peg$e44);
35884
36841
  }
35885
36842
  }
35886
36843
  if (s0 === peg$FAILED) {
35887
36844
  s0 = input.charAt(peg$currPos);
35888
- if (peg$r5.test(s0)) {
36845
+ if (peg$r7.test(s0)) {
35889
36846
  peg$currPos++;
35890
36847
  } else {
35891
36848
  s0 = peg$FAILED;
35892
36849
  if (peg$silentFails === 0) {
35893
- peg$fail(peg$e42);
36850
+ peg$fail(peg$e45);
35894
36851
  }
35895
36852
  }
35896
36853
  }
@@ -35899,7 +36856,7 @@ function peg$parse2(input, options) {
35899
36856
  if (s0 === peg$FAILED) {
35900
36857
  s1 = peg$FAILED;
35901
36858
  if (peg$silentFails === 0) {
35902
- peg$fail(peg$e39);
36859
+ peg$fail(peg$e42);
35903
36860
  }
35904
36861
  }
35905
36862
  return s0;
@@ -35910,23 +36867,23 @@ function peg$parse2(input, options) {
35910
36867
  s0 = peg$currPos;
35911
36868
  s1 = [];
35912
36869
  s2 = input.charAt(peg$currPos);
35913
- if (peg$r4.test(s2)) {
36870
+ if (peg$r6.test(s2)) {
35914
36871
  peg$currPos++;
35915
36872
  } else {
35916
36873
  s2 = peg$FAILED;
35917
36874
  if (peg$silentFails === 0) {
35918
- peg$fail(peg$e38);
36875
+ peg$fail(peg$e41);
35919
36876
  }
35920
36877
  }
35921
36878
  while (s2 !== peg$FAILED) {
35922
36879
  s1.push(s2);
35923
36880
  s2 = input.charAt(peg$currPos);
35924
- if (peg$r4.test(s2)) {
36881
+ if (peg$r6.test(s2)) {
35925
36882
  peg$currPos++;
35926
36883
  } else {
35927
36884
  s2 = peg$FAILED;
35928
36885
  if (peg$silentFails === 0) {
35929
- peg$fail(peg$e38);
36886
+ peg$fail(peg$e41);
35930
36887
  }
35931
36888
  }
35932
36889
  }
@@ -35942,7 +36899,7 @@ function peg$parse2(input, options) {
35942
36899
  if (s0 === peg$FAILED) {
35943
36900
  s1 = peg$FAILED;
35944
36901
  if (peg$silentFails === 0) {
35945
- peg$fail(peg$e43);
36902
+ peg$fail(peg$e46);
35946
36903
  }
35947
36904
  }
35948
36905
  return s0;
@@ -35951,19 +36908,19 @@ function peg$parse2(input, options) {
35951
36908
  let s0, s1;
35952
36909
  peg$silentFails++;
35953
36910
  s0 = input.charAt(peg$currPos);
35954
- if (peg$r6.test(s0)) {
36911
+ if (peg$r8.test(s0)) {
35955
36912
  peg$currPos++;
35956
36913
  } else {
35957
36914
  s0 = peg$FAILED;
35958
36915
  if (peg$silentFails === 0) {
35959
- peg$fail(peg$e45);
36916
+ peg$fail(peg$e48);
35960
36917
  }
35961
36918
  }
35962
36919
  peg$silentFails--;
35963
36920
  if (s0 === peg$FAILED) {
35964
36921
  s1 = peg$FAILED;
35965
36922
  if (peg$silentFails === 0) {
35966
- peg$fail(peg$e44);
36923
+ peg$fail(peg$e47);
35967
36924
  }
35968
36925
  }
35969
36926
  return s0;