@informalsystems/quint
Version:
Core tool for the Quint specification language
35 lines • 1.45 kB
JavaScript
;
/* ----------------------------------------------------------------------------------
* Copyright 2023 Informal Systems
* Licensed under the Apache License, Version 2.0.
* See LICENSE in the project root for license information.
* --------------------------------------------------------------------------------- */
Object.defineProperty(exports, "__esModule", { value: true });
exports.builtinDocs = void 0;
/**
* Builtin operators and values, defined in `builtin.qnt`
*
* @author Gabriela Moreira
*
* @module
*/
const docs_1 = require("./docs");
const path_1 = require("path");
const fs_1 = require("fs");
const quintParserFrontend_1 = require("./parsing/quintParserFrontend");
const eol_1 = require("eol");
/**
* The documentation map for the builtin definitions
*
* @returns a map of builtin definition names to their documentation
*/
function builtinDocs(gen) {
const path = (0, path_1.resolve)(__dirname, 'builtin.qnt');
// Read file and remove windows line endings (\r) using `lf`
const sourceCode = (0, eol_1.lf)((0, fs_1.readFileSync)(path, 'utf8'));
const { modules } = (0, quintParserFrontend_1.parsePhase1fromText)(gen, sourceCode, path);
return (0, docs_1.produceDocs)(modules[0]);
}
exports.builtinDocs = builtinDocs;
// TODO: Move builtinSignatures() to this file and read it from builtin.qnt, see https://github.com/informalsystems/quint/issues/452
//# sourceMappingURL=builtin.js.map