plugin.js 405 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. module.exports = {
  3. languages: [
  4. {
  5. name: "foo",
  6. parsers: ["foo-parser"],
  7. extensions: [".foo"],
  8. since: "1.0.0"
  9. }
  10. ],
  11. parsers: {
  12. "foo-parser": {
  13. preprocess: text => `preprocessed:${text}`,
  14. parse: text => ({ text }),
  15. astFormat: "foo-ast"
  16. }
  17. },
  18. printers: {
  19. "foo-ast": {
  20. print: path => path.getValue().text
  21. }
  22. }
  23. };