skewer-format 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -9
- package/dist/src/interface.js +1 -2
- package/dist/src/lexer.js +1 -4
- package/dist/src/methods.js +4 -7
- package/dist/src/parser.js +4 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var lexer_1 = require("./src/lexer");
|
|
5
|
-
Object.defineProperty(exports, "lexer", { enumerable: true, get: function () { return lexer_1.lexer; } });
|
|
6
|
-
var parser_1 = require("./src/parser");
|
|
7
|
-
Object.defineProperty(exports, "parser", { enumerable: true, get: function () { return parser_1.parser; } });
|
|
8
|
-
var methods_1 = require("./src/methods");
|
|
9
|
-
Object.defineProperty(exports, "skewerToJSON", { enumerable: true, get: function () { return methods_1.skewerToJSON; } });
|
|
1
|
+
export { lexer } from "./src/lexer";
|
|
2
|
+
export { parser } from "./src/parser";
|
|
3
|
+
export { skewerToJSON } from "./src/methods";
|
package/dist/src/interface.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/src/lexer.js
CHANGED
package/dist/src/methods.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const parser_1 = require("./parser");
|
|
6
|
-
function skewerToJSON(input) {
|
|
7
|
-
return (0, parser_1.parser)((0, lexer_1.lexer)(input));
|
|
1
|
+
import { lexer } from "./lexer";
|
|
2
|
+
import { parser } from "./parser";
|
|
3
|
+
export function skewerToJSON(input) {
|
|
4
|
+
return parser(lexer(input));
|
|
8
5
|
}
|
package/dist/src/parser.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.parser = parser;
|
|
4
|
-
const lexer_js_1 = require("./lexer.js");
|
|
5
|
-
function parser(tokens) {
|
|
6
|
-
var _a;
|
|
1
|
+
import { lexer } from "./lexer.js";
|
|
2
|
+
export function parser(tokens) {
|
|
7
3
|
const resultArr = [];
|
|
8
4
|
let question = {
|
|
9
5
|
options: [],
|
|
@@ -68,7 +64,7 @@ function parser(tokens) {
|
|
|
68
64
|
if (token.type == "OPTION_KEY") {
|
|
69
65
|
const optionValueToken = tokens[i + 2];
|
|
70
66
|
if (optionValueToken && optionValueToken.type === "OPTION_VALUE") {
|
|
71
|
-
|
|
67
|
+
question.options?.push({
|
|
72
68
|
key: token.value,
|
|
73
69
|
value: optionValueToken.value,
|
|
74
70
|
});
|
|
@@ -136,6 +132,6 @@ ANSWER: B
|
|
|
136
132
|
EXPLANATION: Serif fonts are often chosen for their historical significance and readability, making them a popular choice for body text in web design to ensure clarity and ease of reading.
|
|
137
133
|
|
|
138
134
|
---`;
|
|
139
|
-
const lex_out =
|
|
135
|
+
const lex_out = lexer(input);
|
|
140
136
|
// console.log(lex_out);
|
|
141
137
|
console.log(parser(lex_out));
|