The parser doesn't work as expected, it should display the lines where the error lies on. Instead, it only shows Unexpected token ...
and the traceback in the library.
/Users/username/test/test.js:25
throw err;
^
SyntaxError: Unexpected token: "h"
at d.getNextToken (/Users/username/test/node_modules/formkl/dist/index.cjs:1:1968)
at d.getNextToken (/Users/username/test/node_modules/formkl/dist/index.cjs:1:1930)
at L._eat (/Users/username/test/node_modules/formkl/dist/index.cjs:2:8437)
at L.StringLiteral (/Users/username/test/node_modules/formkl/dist/index.cjs:2:8008)
at L.SectionBlock (/Users/username/test/node_modules/formkl/dist/index.cjs:2:1886)
at L.SectionBlockList (/Users/username/test/node_modules/formkl/dist/index.cjs:2:1540)
at L.FormBlock (/Users/username/test/node_modules/formkl/dist/index.cjs:2:1070)
at L.parse (/Users/username/test/node_modules/formkl/dist/index.cjs:2:398)
at Object.<anonymous> (/Users/username/test/test.js:17:22)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
const { Parser: FormklParser } = require('formkl');
try {
const text = `
formkl "Your Formkl example" "This form is generated by the formkl adapter" {
multiple "Work Experience" has {
require text;
}
"Personal Information" ha{
text;
multiple paragraph;
multiple text as "something";
}
}
`;
new FormklParser().parse(text);
} catch (err) {
throw err;
}
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.