]> git.draconx.ca Git - cdecl99.git/blobdiff - tests/decl-good.at
tests: Ensure that English keywords can be parsed.
[cdecl99.git] / tests / decl-good.at
index 1c948721572b872dd0b45ebca8ca318586624d0e..e06fb76c036b65e8e42b1770471cac16ad289a1b 100644 (file)
@@ -85,6 +85,30 @@ SIMPLE_DECLS(
 SIMPLE_DECLS(
   [[int (x*)], [type function (pointer to x) returning int], [int (x *)]])
 
+SIMPLE_DECLS(
+  [[int (x)()], [declare x as function returning int], [int x()]])
+
+dnl Check that function reduction does not occur in english parses
+SIMPLE_DECLS(
+  [[int (x)], [type function (x) returning int], [], [declare x as int]])
+
 SIMPLE_DECLS(
   [[int x@<:@@:>@], [declare x as array of int]],
   [[int @<:@@:>@],  [type array of int]])
+
+SIMPLE_DECLS_EXPLAIN(
+  [[int ((int))], [type function (int) returning int], [int (int)]],
+  [[int (x(int))], [declare x as function (int) returning int], [int x(int)]],
+  [[int (())], [type function returning int], [int ()]])
+
+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]])