From a0629a04f4fc6093900c9e4703e440d6b0ba24ad Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Thu, 6 Jul 2023 21:02:25 -0400 Subject: [PATCH] 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. --- tests/decl-good.at | 8 ++++++++ 1 file changed, 8 insertions(+) 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]]) -- 2.43.2