v.parser: improve error message when no arch is set 'asm{}' (#12093)

pull/12097/head
pancake 2021-10-07 02:44:27 +02:00 committed by GitHub
parent e53682320c
commit 32259af2c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -875,6 +875,9 @@ fn (mut p Parser) asm_stmt(is_top_level bool) ast.AsmStmt {
p.next()
}
if arch == ._auto && !p.pref.is_fmt {
if p.tok.lit == '' {
p.error('missing assembly architecture. Try i386, amd64 or arm64.')
}
p.error('unknown assembly architecture')
}
if p.tok.kind != .name {