text: // Generated by ReScript, PLEASE EDIT WITH CARE
  'use strict';
  
  var Belt_Array = require("bs-platform/lib/js/belt_Array.js");
  var Mocha$BsMocha = require("bs-mocha/lib/js/src/Mocha.bs.js");
  var Assert$BsMocha = require("bs-mocha/lib/js/src/Assert.bs.js");
  var Promise$BsMocha = require("bs-mocha/lib/js/src/Promise.bs.js");
  var Parser$AgdaModeVscode = require("../../../src/Parser.bs.js");
  var Test__Util$AgdaModeVscode = require("../Test__Util.bs.js");
  
  function parseSExpression(breakpoints, input) {
    var output = {
      contents: []
    };
    var parser = Parser$AgdaModeVscode.SExpression.makeIncr(function (x) {
          if (!x) {
            return ;
          }
          var a = x._0;
          if (a.TAG === /* Ok */0) {
            output.contents.push(a._0);
            return ;
          }
          var match = a._0;
          return Assert$BsMocha.fail("Failed when parsing S-expression: " + Parser$AgdaModeVscode.$$Error.toString({
                          TAG: 0,
                          _0: match[0],
                          _1: match[1],
                          [Symbol.for("name")]: "SExpression"
                        }));
        });
    Belt_Array.forEach(Belt_Array.concatMany(Belt_Array.map(Test__Util$AgdaModeVscode.Strings.breakInput(input.trim(), breakpoints), Parser$AgdaModeVscode.split)), (function (param) {
            return Parser$AgdaModeVscode.Incr.feed(parser, param);
          }));
    return output.contents;
  }
  
  Mocha$BsMocha.describe("when parsing S-expressions as a whole")(undefined, undefined, undefined, (function (param) {
          return Belt_Array.forEach(Test__Util$AgdaModeVscode.Golden.getGoldenFilepathsSync("../../../../test/tests/Parser/SExpression"), (function (filepath) {
                        return Promise$BsMocha.it("should golden test " + filepath)(undefined, undefined, undefined, (function (param) {
                                      return Test__Util$AgdaModeVscode.Golden.readFile(filepath).then(function (raw) {
                                                  var partial_arg = [];
                                                  return Test__Util$AgdaModeVscode.Golden.compare(Test__Util$AgdaModeVscode.Golden.map(Test__Util$AgdaModeVscode.Golden.map(raw, (function (param) {
                                                                        return parseSExpression(partial_arg, param);
                                                                      })), (function (param) {
                                                                    return Test__Util$AgdaModeVscode.Strings.serializeWith(Parser$AgdaModeVscode.SExpression.toString, param);
                                                                  })));
                                                });
                                    }));
                      }));
        }));
  
  Mocha$BsMocha.describe("when parsing S-expressions incrementally")(undefined, undefined, undefined, (function (param) {
          return Belt_Array.forEach(Test__Util$AgdaModeVscode.Golden.getGoldenFilepathsSync("../../../../test/tests/Parser/SExpression"), (function (filepath) {
                        return Promise$BsMocha.it("should golden test " + filepath)(undefined, undefined, undefined, (function (param) {
                                      return Test__Util$AgdaModeVscode.Golden.readFile(filepath).then(function (raw) {
                                                  var partial_arg = [
                                                    3,
                                                    23,
                                                    171,
                                                    217,
                                                    1234,
                                                    2342,
                                                    3453
                                                  ];
                                                  return Test__Util$AgdaModeVscode.Golden.compare(Test__Util$AgdaModeVscode.Golden.map(Test__Util$AgdaModeVscode.Golden.map(raw, (function (param) {
                                                                        return parseSExpression(partial_arg, param);
                                                                      })), (function (param) {
                                                                    return Test__Util$AgdaModeVscode.Strings.serializeWith(Parser$AgdaModeVscode.SExpression.toString, param);
                                                                  })));
                                                });
                                    }));
                      }));
        }));
  
  exports.parseSExpression = parseSExpression;
  /*  Not a pure module */
  