mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: fix error in case of void function used as a value
This commit is contained in:

committed by
Alexander Medvednikov

parent
f7f5f43c48
commit
ba699d8b4f
@ -292,9 +292,16 @@ pub fn (t Token) str() string {
|
||||
if t.tok == .str {
|
||||
return "'$t.lit'"
|
||||
}
|
||||
if t.tok == .eof {
|
||||
return '.EOF'
|
||||
}
|
||||
if t.tok < .plus {
|
||||
return t.lit // string, number etc
|
||||
}
|
||||
return t.tok.str()
|
||||
}
|
||||
|
||||
pub fn (t Token) detailed_str() string {
|
||||
return 'Token{ .line:${t.line_nr:4d}, .pos:${t.pos:5d}, .tok: ${t.tok:3d} } = $t '
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user