From e503a1b27973828a130809ccd160c617647ce731 Mon Sep 17 00:00:00 2001 From: eisenwave Date: Fri, 30 Aug 2024 21:34:10 +0200 Subject: [PATCH] closes #30; fix signed bool being permitted --- js/prose-decl.js | 2 +- test/test.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/js/prose-decl.js b/js/prose-decl.js index a866da5..d51eb14 100644 --- a/js/prose-decl.js +++ b/js/prose-decl.js @@ -7,7 +7,7 @@ const SPECIFIER_CONFLICTS = [ ['class', 'struct', 'union', 'enum', 'void', 'complex', '_Atomic()', 'bool'], ['class', 'struct', 'union', 'enum', 'signed', 'unsigned', 'float', 'double', 'void', '_Atomic()'], - ['class', 'struct', 'union', 'enum', 'signed', 'unsigned', 'complex'], + ['class', 'struct', 'union', 'enum', 'signed', 'unsigned', 'typedef-name', 'bool', 'complex'], ['int', 'complex'], ['char', 'short', 'long', 'void', 'bool', 'complex'], ['int', 'float', 'double', 'void', '_Atomic()'], diff --git a/test/test.js b/test/test.js index 1e3e75c..6ee872e 100644 --- a/test/test.js +++ b/test/test.js @@ -178,4 +178,12 @@ describe('Examples', function () { assert.deepEqual(actual, expected); }); }); + + code = 'signed bool'; + describe(code, function () { + it('throws because "signed" and "bool" conflict', function () { + assert.throws(() => codeToProse(code), + {message: 'Conflicting specifiers signed and bool'}); + }); + }); });