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

@ for escaping keywords

This commit is contained in:
Alexander Medvednikov
2019-07-24 02:22:34 +02:00
parent facf55cbc0
commit c28a490c17
4 changed files with 21 additions and 6 deletions

View File

@ -21,6 +21,10 @@ struct User {
name string
age int
}
struct Foo {
@type string
}
fn test_struct_levels() {
mut c := C{}
@ -54,3 +58,8 @@ fn test_struct_str() {
println(u) // make sure the struct is printable
// assert u.str() == '{name:"Bob", age:30}' // TODO
}
fn test_at() {
foo := Foo{ @type: 'test' }
println(foo.@type)
}