1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

View File

@ -875,6 +875,9 @@ fn (mut p Parser) asm_stmt(is_top_level bool) ast.AsmStmt {
p.next() p.next()
} }
if arch == ._auto && !p.pref.is_fmt { 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') p.error('unknown assembly architecture')
} }
if p.tok.kind != .name { if p.tok.kind != .name {