summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2015-03-21 15:41:59 +0800
committerJohn Hodge <tpg@mutabah.net>2015-03-21 15:41:59 +0800
commit0d7cf4b1e052642642fea63c5f328b7fa994fd05 (patch)
treecc1eff239efc6cdd0c5ea8758c092218aa07b141 /src
parent75205189d5e33a33193fa76a29f7518a9797299d (diff)
downloadmrust-0d7cf4b1e052642642fea63c5f328b7fa994fd05.tar.gz
(minor) Commenting on ! in Parse_Type
Diffstat (limited to 'src')
-rw-r--r--src/parse/types.cpp5
1 files changed, 3 insertions, 2 deletions
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);
}