You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
449 B

  1. "use strict";
  2. const parser = require("./generated-parser.js");
  3. exports.name = function (potentialName) {
  4. return mapResult(parser.startWith("Name").exec(potentialName));
  5. };
  6. exports.qname = function (potentialQname) {
  7. return mapResult(parser.startWith("QName").exec(potentialQname));
  8. };
  9. function mapResult(result) {
  10. return {
  11. success: result.success,
  12. error: result.error && parser.getTrace(result.error.message)
  13. };
  14. }