diff --git a/src/api/js/scripts/parse-api.js b/src/api/js/scripts/parse-api.js index 621a38590..53655424f 100644 --- a/src/api/js/scripts/parse-api.js +++ b/src/api/js/scripts/parse-api.js @@ -120,6 +120,8 @@ for (let file of files) { if (text !== '') { throw new Error(`extra text in parameter list ${JSON.stringify(text)}`); } + + if (name in defApis) { throw new Error(`multiple defApi calls for ${name}`); } @@ -130,6 +132,12 @@ for (let file of files) { types[match.groups.type] = match.groups.type; } + // we don't have to pre-populate the types map with closure types + // use the Z3_DECLARE_CLOSURE to identify closure types + // for (let match of contents.matchAll(/Z3_DECLARE_CLOSURE\((?[A-Za-z0-9_]+),/g)) { + // types[match.groups.type] = match.groups.type + // } + // parse enum declarations for (let idx = 0; idx < contents.length; ) { let nextIdx = contents.indexOf('typedef enum', idx);