1
0
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:
Delyan Angelov
2020-01-12 02:46:25 +02:00
committed by Alexander Medvednikov
parent f7f5f43c48
commit ba699d8b4f
4 changed files with 44 additions and 6 deletions

View File

@ -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 '
}