v
v copied to clipboard
vweb: unable to serve index.html with $type=\
V version: latest OS: Arch Linux x64
What did you do? Tried to use vweb to serve index.html from tiddlywiki.com.
What did you expect to see? vweb to compile
What did you see instead? internal_memory:4738:887143: error: invalid character `\`
testcase:
// index.html
$type=\
//fail.v
import vweb
fn(mut a A) index() {
$vweb.html()
}
Probably the cause of this problem is that type is a reserved word
https://github.com/vlang/v/blob/650cdef8b406955ec4d3d24853b49663a3a209a4/vlib/v/scanner/scanner.v#L712
$type is scanned into $ key_type
I don't understand, why is it scanning .html for v code?
$type is translated to v code at compile time
https://github.com/vlang/v/blob/650cdef8b406955ec4d3d24853b49663a3a209a4/vlib/v/parser/comptime.v#L47-L114
Hi @Dialga ,
can you confirm that the problem still exists on a fresh V (0.2.4)?
Still broken for me:
internal_memory:18:1: error: unfinished string literal
internal_memory:12:1: details: literal started here
Is this issue still present @Dialga ?
Try changing to typ instead of type. Or almost anything other than type, really.
Still failing in: V 0.4.7 b947750
@spytheman I think this should be closed
Closing. vweb is deprecated. If the same error happens with veb, please open a new issue.