Skip to content

Commit fdeb700

Browse files
authored
[inspect] Add temporary error if an *alt-name* is present (#758)
1 parent e6a1cc3 commit fdeb700

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

source/parse.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6709,14 +6709,24 @@ class parser
67096709
//G alt-name? is-value-constraint '=' statement
67106710
//G alt-name? as-type-cast '=' statement
67116711
//G
6712-
//G alt-name:
6712+
//GTODO alt-name:
67136713
//G unqualified-id ':'
67146714
//G
67156715
auto alternative()
67166716
-> std::unique_ptr<alternative_node>
67176717
{
67186718
auto n = std::make_unique<alternative_node>();
67196719

6720+
if (
6721+
curr().type() == lexeme::Identifier
6722+
&& peek(1)
6723+
&& peek(1)->type() == lexeme::Colon
6724+
)
6725+
{
6726+
error("(temporary alpha limitation) declaring an identifier is not supported yet");
6727+
return {};
6728+
}
6729+
67206730
// Now we should be as "is" or "as"
67216731
// (initial partial implementation, just "is/as id-expression")
67226732
if (

0 commit comments

Comments
 (0)