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

fmt: support static too

This commit is contained in:
Delyan Angelov 2021-02-28 13:08:16 +02:00
parent 7e08e84bc1
commit 276c08e7f7
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -141,7 +141,7 @@ fn (mut p Parser) partial_assign_stmt(left []ast.Expr, left_comments []ast.Comme
iv := lx.info as ast.IdentVar iv := lx.info as ast.IdentVar
share = iv.share share = iv.share
if iv.is_static { if iv.is_static {
if !p.pref.translated { if !p.pref.translated && !p.pref.is_fmt {
p.error_with_pos('static variables are supported only in -translated mode', p.error_with_pos('static variables are supported only in -translated mode',
lx.pos) lx.pos)
return ast.Stmt{} return ast.Stmt{}