From b1183dfe2c3f529168086e13cd5fa13fd91e0f8d Mon Sep 17 00:00:00 2001 From: Henrixounez Date: Wed, 26 Jun 2019 20:23:10 +0200 Subject: [PATCH] parser: prompt error if struct is made public and if pub is wrongly used added *yet* to the pub struct error --- compiler/parser.v | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/parser.v b/compiler/parser.v index 6423ffb950..99dbaeeab5 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -179,8 +179,12 @@ fn (p mut Parser) parse() { case PUB: if p.peek() == FUNC { p.fn_decl() + } else if p.peek() == STRUCT { + p.error('structs can\'t be declared public *yet*') + // TODO public structs + } else { + p.error('wrong pub keyword usage') } - // TODO public structs case FUNC: p.fn_decl() case TIP: