From 0d7cf4b1e052642642fea63c5f328b7fa994fd05 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 21 Mar 2015 15:41:59 +0800 Subject: (minor) Commenting on ! in Parse_Type --- src/parse/types.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/parse/types.cpp b/src/parse/types.cpp index 23101dba..aa29af64 100644 --- a/src/parse/types.cpp +++ b/src/parse/types.cpp @@ -46,6 +46,9 @@ TypeRef Parse_Type(TokenStream& lex) switch( GET_TOK(tok, lex) ) { + // '!' - Only ever used as part of function prototypes, but is kinda a type... not allowed here though + case TOK_EXCLAM: + throw ParseError::Generic(lex, "! is not a real type"); // '_' = Wildcard (type inferrence variable) case TOK_UNDERSCORE: return TypeRef(); @@ -185,8 +188,6 @@ TypeRef Parse_Type(TokenStream& lex) CHECK_TOK(tok, TOK_PAREN_CLOSE); return TypeRef(TypeRef::TagTuple(), types); } } - case TOK_EXCLAM: - throw ParseError::Generic(lex, "! is not a real type"); default: throw ParseError::Unexpected(lex, tok); } -- cgit v1.2.3