index.cjs 580 B

1234567891011121314151617181920212223
  1. const convertTokens = require("./convertTokens.cjs");
  2. const convertComments = require("./convertComments.cjs");
  3. const convertAST = require("./convertAST.cjs");
  4. exports.ast = function convert(ast, code, tokLabels, visitorKeys) {
  5. ast.tokens = convertTokens(ast.tokens, code, tokLabels);
  6. convertComments(ast.comments);
  7. convertAST(ast, visitorKeys);
  8. return ast;
  9. };
  10. exports.error = function convertError(err) {
  11. if (err instanceof SyntaxError) {
  12. err.lineNumber = err.loc.line;
  13. err.column = err.loc.column;
  14. }
  15. return err;
  16. };
  17. //# sourceMappingURL=index.cjs.map