Skip to content

Commit

Permalink
closes #30; fix signed bool being permitted
Browse files Browse the repository at this point in the history
  • Loading branch information
Eisenwave committed Aug 30, 2024
1 parent 011e3d1 commit e503a1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/prose-decl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()'],
Expand Down
8 changes: 8 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'});
});
});
});

0 comments on commit e503a1b

Please sign in to comment.