From: Nick Bowler Date: Fri, 7 Jul 2023 01:02:25 +0000 (-0400) Subject: tests: Ensure that English keywords can be parsed. X-Git-Tag: v1.3~126 X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/commitdiff_plain/a0629a04f4fc6093900c9e4703e440d6b0ba24ad tests: Ensure that English keywords can be parsed. We don't want to reject words like "declare" in identifiers, at least when parsing C code, so add test cases to make sure that works. --- diff --git a/tests/decl-good.at b/tests/decl-good.at index 230202b..e06fb76 100644 --- a/tests/decl-good.at +++ b/tests/decl-good.at @@ -104,3 +104,11 @@ SIMPLE_DECLS_EXPLAIN( SIMPLE_DECLS_EXPLAIN( [[int (x())], [declare x as function returning int], [int x()]], [[int ((x)())], [declare x as function returning int], [int x()]]) + +dnl Test that english-only keywords are not rejected as idenfitiers in C mode. +SIMPLE_DECLS_EXPLAIN( + [[of array@<:@@:>@], [declare array as array of of]], + [[returning as(function)], + [declare as as function (function) returning returning]], + [[pointer *declare], [declare declare as pointer to pointer]], + [[type to], [declare to as type]])