commit 6261e1011e0ea30d375b75da4bdb0079564e057a
parent af4b6ab697116368b02883fb82c057c4d032c435
Author: Eyal Sawady <ecs@d2evs.net>
Date: Tue, 20 Apr 2021 10:58:55 -0400
hare::parse: disallow null as a primitive type
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hare/parse/type.ha b/hare/parse/type.ha
@@ -93,7 +93,6 @@ fn primitive_type(lexer: *lex::lexer) (ast::_type | error) = {
ltok::F64 => builtin_type::F64,
ltok::BOOL => builtin_type::BOOL,
ltok::VOID => builtin_type::VOID,
- ltok::NULL => builtin_type::NULL,
* => return syntaxerr(mkloc(lexer),
"Unexected {}, was expecting primitive type",
lex::tokstr(tok)),
@@ -392,7 +391,7 @@ export fn _type(lexer: *lex::lexer) (ast::_type | error) = {
ltok::U16, ltok::U32, ltok::U64, ltok::U64,
ltok::U8, ltok::UINT, ltok::UINTPTR, ltok::RUNE,
ltok::STR, ltok::F32, ltok::F64, ltok::BOOL,
- ltok::VOID, ltok::NULL => primitive_type(lexer)?,
+ ltok::VOID => primitive_type(lexer)?,
ltok::ENUM => enum_type(lexer)?,
ltok::NULLABLE, ltok::TIMES => pointer_type(lexer)?,
ltok::STRUCT, ltok::UNION => struct_union_type(lexer)?,