parser: do not allow "int?", only "?int"

This commit is contained in:
Alexander Medvednikov 2019-09-23 23:17:06 +03:00
parent f27f3515ae
commit d2d75f3824
6 changed files with 10 additions and 17 deletions

View file

@ -1022,12 +1022,9 @@ fn (p mut Parser) get_type() string {
p.register_array(typ)
}
p.next()
if p.tok == .question || is_question {
if is_question {
typ = 'Option_$typ'
p.table.register_type_with_parent(typ, 'Option')
if p.tok == .question {
p.next()
}
}
// Because the code uses * to see if it's a pointer
if typ == 'byteptr' {