From 7292209b349b88f9b278244781a8ea244dd10e8a Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Mon, 16 Oct 2023 11:42:17 +0100 Subject: [PATCH] [inspect] Add temporary error if an *alt-name* is present --- source/parse.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/parse.h b/source/parse.h index 213fd20ca4..038499d7f6 100644 --- a/source/parse.h +++ b/source/parse.h @@ -6709,7 +6709,7 @@ class parser //G alt-name? is-value-constraint '=' statement //G alt-name? as-type-cast '=' statement //G - //G alt-name: + //GTODO alt-name: //G unqualified-id ':' //G auto alternative() @@ -6717,6 +6717,16 @@ class parser { auto n = std::make_unique(); + if ( + curr().type() == lexeme::Identifier + && peek(1) + && peek(1)->type() == lexeme::Colon + ) + { + error("(temporary alpha limitation) declaring an identifier is not supported yet"); + return {}; + } + // Now we should be as "is" or "as" // (initial partial implementation, just "is/as id-expression") if (