@podlite/schema 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## Upcoming
4
4
 
5
+ ## 0.0.14
6
+
7
+ - fix parse `=alias` and `=config` directives
8
+ - improve brackets support for C<> and L<> codes
9
+ - support for `=toc` block
10
+ - support for `=markdown` block
11
+
5
12
  ## 0.0.13
6
13
 
7
14
  - refactor
package/lib/grammar.js CHANGED
@@ -134,7 +134,7 @@ function peg$parse(input, options) {
134
134
  type: "boolean"
135
135
  };
136
136
  }, peg$c88 = function (isFalse, key, value) { return { name: key, ...value }; }, peg$c89 = function (first, rest) { return rest; }, peg$c90 = function (first, cont) { return flattenDeep([...first, ...cont]); }, peg$c91 = /^[^'"]/, peg$c92 = peg$classExpectation(["'", "\""], true, false), peg$c93 = function (text) { return text; }, peg$c94 = /^[0-9]/, peg$c95 = peg$classExpectation([["0", "9"]], false, false), peg$c96 = /^[\-+]/, peg$c97 = peg$classExpectation(["-", "+"], false, false), peg$c98 = "True", peg$c99 = peg$literalExpectation("True", false), peg$c100 = function () { return true; }, peg$c101 = "False", peg$c102 = peg$literalExpectation("False", false), peg$c103 = function () { return false; }, peg$c104 = ".", peg$c105 = peg$literalExpectation(".", false), peg$c106 = /^[eE]/, peg$c107 = peg$classExpectation(["e", "E"], false, false), peg$c108 = /^["]/, peg$c109 = peg$classExpectation(["\""], false, false), peg$c110 = /^[^"]/, peg$c111 = peg$classExpectation(["\""], true, false), peg$c112 = /^[']/, peg$c113 = peg$classExpectation(["'"], false, false), peg$c114 = /^[^']/, peg$c115 = peg$classExpectation(["'"], true, false), peg$c116 = function (numberFloat) { return parseFloat(numberFloat); }, peg$c117 = function (number) { return parseInt(number, 10); }, peg$c118 = function (vmargin, name, config) {
137
- return ((name.match(/code|comment|output|input|data/))
137
+ return ((name.match(/code|comment|output|input|markdown|toc|data/))
138
138
  ||
139
139
  isNamedBlock(name));
140
140
  }, peg$c119 = function (vmargin, name, config, margins, ename) { return vmargin.length === margins.length && name === ename; }, peg$c120 = function (vmargin, name, config, margins, line) { return exludeVMargin(vmargin, `${margins}${line}`); }, peg$c121 = function (vmargin, name, config, content, vmargin2, ename) { return name === ename; }, peg$c122 = function (vmargin, name, config, content, vmargin2, ename) {
@@ -261,7 +261,7 @@ function peg$parse(input, options) {
261
261
  location: location(),
262
262
  };
263
263
  }, peg$c150 = function () { return { empty: 1 }; }, peg$c151 = /^[s]/, peg$c152 = peg$classExpectation(["s"], false, false), peg$c153 = function (line) { return { text: text(), type: "ambient1" }; }, peg$c154 = function (vmargin, name) {
264
- return ((name.match(/code|comment|output|input|data/))
264
+ return ((name.match(/code|comment|output|input|markdown|toc|data/))
265
265
  ||
266
266
  isNamedBlock(name));
267
267
  }, peg$c155 = function (vmargin, name, content) {
@@ -320,7 +320,7 @@ function peg$parse(input, options) {
320
320
  margin: vmargin
321
321
  };
322
322
  }, peg$c168 = function (vmargin, marker, name, config) {
323
- return ((name.match(/code|comment|output|input|data/))
323
+ return ((name.match(/code|comment|output|input|markdown|toc|data/))
324
324
  ||
325
325
  isNamedBlock(name));
326
326
  }, peg$c169 = function (vmargin, marker, name, config, content) {
@@ -1171,25 +1171,31 @@ function peg$parse(input, options) {
1171
1171
  s2 = peg$currPos;
1172
1172
  s3 = peg$parse_();
1173
1173
  if (s3 !== peg$FAILED) {
1174
- s4 = peg$currPos;
1175
- s5 = peg$parsemarkers();
1176
- if (s5 !== peg$FAILED) {
1177
- s6 = peg$parsestrictIdentifier();
1178
- if (s6 !== peg$FAILED) {
1179
- s5 = [s5, s6];
1180
- s4 = s5;
1181
- }
1182
- else {
1183
- peg$currPos = s4;
1184
- s4 = peg$FAILED;
1185
- }
1186
- }
1187
- else {
1188
- peg$currPos = s4;
1189
- s4 = peg$FAILED;
1190
- }
1174
+ s4 = peg$parsemarkerConfig();
1191
1175
  if (s4 === peg$FAILED) {
1192
- s4 = peg$parsemarkerAbbreviatedBlock();
1176
+ s4 = peg$parsemarkerAlias();
1177
+ if (s4 === peg$FAILED) {
1178
+ s4 = peg$currPos;
1179
+ s5 = peg$parsemarkers();
1180
+ if (s5 !== peg$FAILED) {
1181
+ s6 = peg$parsestrictIdentifier();
1182
+ if (s6 !== peg$FAILED) {
1183
+ s5 = [s5, s6];
1184
+ s4 = s5;
1185
+ }
1186
+ else {
1187
+ peg$currPos = s4;
1188
+ s4 = peg$FAILED;
1189
+ }
1190
+ }
1191
+ else {
1192
+ peg$currPos = s4;
1193
+ s4 = peg$FAILED;
1194
+ }
1195
+ if (s4 === peg$FAILED) {
1196
+ s4 = peg$parsemarkerAbbreviatedBlock();
1197
+ }
1198
+ }
1193
1199
  }
1194
1200
  if (s4 !== peg$FAILED) {
1195
1201
  s3 = [s3, s4];
@@ -6354,11 +6360,13 @@ function peg$parse(input, options) {
6354
6360
  'head',
6355
6361
  'input',
6356
6362
  'item',
6363
+ 'markdown',
6357
6364
  'nested',
6358
6365
  'output',
6359
6366
  'para',
6360
6367
  'pod',
6361
6368
  'table',
6369
+ 'toc',
6362
6370
  ].includes(name)
6363
6371
  ||
6364
6372
  isSemanticBlock(name)