diff --git a/bin/heta-build.js b/bin/heta-build.js index 79fe99c1..162b1416 100644 --- a/bin/heta-build.js +++ b/bin/heta-build.js @@ -23,7 +23,7 @@ program .description('Compile Heta based platform and create set of export files.') //.arguments(' [dir]') .usage('[options] [dir]') - .option('-d, --declaration ', 'declaration file name without extension to search throught extensions: ["", ".json", ".json5", ".yml"]') + .option('-d, --declaration ', 'declaration file name without extension to search throught extensions: ["", ".json", ".yml"]') // options .option('--units-check', 'Check all Records for unit consistency.') .option('-L, --log-mode ', 'When to create log file.') @@ -33,7 +33,7 @@ program // moduleImport .option('-s, --source ', 'path to main heta module.') .option('-t, --type ', 'type of source file.') - .option('-e, --export ', 'format names or structures: "JSON,XLSX" or "{format:JSON},{format:XLSX,omitRows:3}"') + .option('-e, --export ', 'export formats: "JSON,XLSX" or "{format:JSON},{format:XLSX,omitRows:3}"') // checking newer version of heta-compiler .option('--skip-updates', 'Skip checking newer version of heta-compiler.') .parse(process.argv); @@ -53,7 +53,7 @@ async function main() { // === read declaration file === // search - let searches = ['', '.json', '.json5', '.yml'] + let searches = ['', '.json', '.yml'] .map((ext) => path.join(targetDir, (opts.declaration || 'platform') + ext)); let extensionNumber = searches .map((x) => fs.existsSync(x) && fs.statSync(x).isFile() ) // check if it exist and is file diff --git a/src/container/actions.js b/src/container/actions.js index c50ea0e5..e8532fa1 100644 --- a/src/container/actions.js +++ b/src/container/actions.js @@ -15,7 +15,7 @@ const reservedWords = [ * The inheritor depends on `q.format` property. * For example `{id: 'output', format: 'JSON', ...}` creates the object of `JSONExport` type. * - * @param {object} q The `#export` statement in JS object format. + * @param {object} q The `export` object in JS object format. * @param {Boolean} isCore Set element as a "core" which means you cannot rewrite or delete it. * * @returns {AbstractExport} The created object. @@ -25,14 +25,11 @@ const reservedWords = [ Container.prototype.export = function(q = {}, isCore = false) { let { exportClasses, exportArray } = this._builder; if (q.format === undefined) { - this.logger.error( - 'Empty "format" option in #export', - {type: 'QError'} - ); + this.logger.error('Empty "format" option in export', {type: 'QError'}); return; // BRAKE } if (typeof exportClasses[q.format] !== 'function') { - this.logger.error(`Unknown format "${q.format}" in #export action.`, {type: 'QError'}); + this.logger.error(`Unknown format "${q.format}" in export.`, {type: 'QError'}); return; // BRAKE } diff --git a/src/templates/simbio.m.njk b/src/templates/simbio.m.njk index dbcfbde7..2c3174e1 100644 --- a/src/templates/simbio.m.njk +++ b/src/templates/simbio.m.njk @@ -1,7 +1,7 @@ %{ This model was created by Heta compiler. Additional functions see in the directory - export from : #export { format: Simbio, namespace: {{ population.spaceName }}, ...}; + export from : { format: Simbio, namespace: {{ population.spaceName }}, ...}; %} %sbioaddtolibrary(sbiounit('week', 'day', 7)); diff --git a/test/cases/0.js b/test/cases/0.js index 3ded6106..30c9302a 100644 --- a/test/cases/0.js +++ b/test/cases/0.js @@ -59,21 +59,21 @@ describe('Testing "cases/0-hello-world"', () => { b.run(); }); - it('Run #export {format: SBML}, check and compare.', () => { + it('Run {format: SBML}, check and compare.', () => { let sbml_export = b.exportArray[0]; let code = sbml_export.makeText(true)[0].content; expect(code).xml.to.to.be.valid(); expect(code).xml.be.deep.equal(sbml_l2v4_correct); }); - it('Run #export {format: SBML}, check and compare.', () => { + it('Run export {format: SBML}, check and compare.', () => { let sbml_export = b.exportArray[1]; let code = sbml_export.makeText(true)[0].content; expect(code).xml.to.to.be.valid(); expect(code).xml.be.deep.equal(sbml_l3v1_correct); }); - it('Run #export {format: JSON}, check and compare.', () => { + it('Run export {format: JSON}, check and compare.', () => { let json_export = b.exportArray[2]; let code = json_export.makeText(true)[0].content; let obj = JSON.parse(code); @@ -81,7 +81,7 @@ describe('Testing "cases/0-hello-world"', () => { //console.log(obj); }); - it('Run #export {format: YAML}, check and compare.', () => { + it('Run export {format: YAML}, check and compare.', () => { let yaml_export = b.exportArray[3]; let code = yaml_export.makeText(true)[0].content; let obj = load(code); @@ -89,7 +89,7 @@ describe('Testing "cases/0-hello-world"', () => { //console.log(code); }); - it('Run #export {format: SLV}, check and compare.', () => { + it('Run export {format: SLV}, check and compare.', () => { let slv_export = b.exportArray[4]; let code = slv_export.makeText(true)[0].content; let obj = slvParse.parse(code); @@ -97,7 +97,7 @@ describe('Testing "cases/0-hello-world"', () => { //console.log(obj); }); - it('Run #export {format: XLSX}, check and compare.', () => { + it('Run export {format: XLSX}, check and compare.', () => { let xlsx_export = b.exportArray[5]; let code = xlsx_export.makeSheet(true); // check only sheet #0 @@ -121,7 +121,7 @@ describe('Testing "cases/0-hello-world"', () => { //console.log(correctJSON_0); }); - it('Run #export {format: Mrgsolve}, check and compare.', () => { + it('Run export {format: Mrgsolve}, check and compare.', () => { let mm_mrg = b.exportArray[6]; let code = mm_mrg.makeText(true); // compare model.cpp text content @@ -130,7 +130,7 @@ describe('Testing "cases/0-hello-world"', () => { expect(code[0].content).to.be.equal(mrgsolve_correct); }); - it('Run #export {format: Julia}, check and compare.', () => { + it('Run export {format: Julia}, check and compare.', () => { let mm_mrg = b.exportArray[7]; let code = mm_mrg.makeText(true); // compare model.js text content diff --git a/test/export/export-check.js b/test/export/export-check.js index 06646ba6..4376985f 100644 --- a/test/export/export-check.js +++ b/test/export/export-check.js @@ -24,7 +24,7 @@ describe('General argument checking', () => { p.logger.resetErrors(); }); - it('Create JSON Export with #export', () => { + it('Create JSON Export with export', () => { let json_export = p.export({ format: 'JSON', filepath: './_1.json' @@ -36,7 +36,7 @@ describe('General argument checking', () => { p.logger.resetErrors(); }); - it('Error in #export: no "format"', () => { + it('Error in export: no "format"', () => { let json_export = p.export({ filepath: './1.json' }); @@ -45,7 +45,7 @@ describe('General argument checking', () => { p.logger.resetErrors(); }); - it('Error in #export: wrong "format"', () => { + it('Error in export: wrong "format"', () => { let json_export = p.export({ format: 'XXX', filepath: '1' @@ -55,7 +55,7 @@ describe('General argument checking', () => { p.logger.resetErrors(); }); - it('Error in #export: no "filepath"', () => { + it('Error in export: no "filepath"', () => { let json_export = p.export({ format: 'JSON' }); @@ -65,7 +65,7 @@ describe('General argument checking', () => { p.logger.resetErrors(); }); - it('Error in #export: wrong "filepath"', () => { + it('Error in export: wrong "filepath"', () => { let json_export = p.export({ format: 'JSON', filepath: './@1.xxx' @@ -75,7 +75,7 @@ describe('General argument checking', () => { p.logger.resetErrors(); }); - it('Error in #export: wrong "omit"', () => { + it('Error in export: wrong "omit"', () => { let json_export = p.export({ format: 'JSON', filepath: './1.txt', @@ -87,7 +87,7 @@ describe('General argument checking', () => { p.logger.resetErrors(); }); - it('Error in #export: wrong "noUnitsExpr"', () => { + it('Error in export: wrong "noUnitsExpr"', () => { let json_export = p.export({ format: 'JSON', filepath: './1.txt', @@ -98,7 +98,7 @@ describe('General argument checking', () => { p.logger.resetErrors(); }); - it('Error in #export: wrong "spaceFilter"', () => { + it('Error in export: wrong "spaceFilter"', () => { let json_export = p.export({ format: 'JSON', filepath: './1.txt',