]> git.draconx.ca Git - cdecl99.git/commitdiff
tests: Ensure that English keywords can be parsed.
authorNick Bowler <nbowler@draconx.ca>
Fri, 7 Jul 2023 01:02:25 +0000 (21:02 -0400)
committerNick Bowler <nbowler@draconx.ca>
Fri, 7 Jul 2023 01:02:25 +0000 (21:02 -0400)
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.

tests/decl-good.at

index 230202badd6dac0db39767bbdc28cb1dc860f28d..e06fb76c036b65e8e42b1770471cac16ad289a1b 100644 (file)
@@ -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]])