parser: prompt error if struct is made public and if pub is wrongly used

added *yet* to the pub struct error
pull/691/head
Henrixounez 2019-06-26 20:23:10 +02:00 committed by Alexander Medvednikov
parent 7e641cd5ba
commit b1183dfe2c
1 changed files with 5 additions and 1 deletions

View File

@ -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: