2020-12-25 20:41:59 +01:00
|
|
|
enum Abc {
|
|
|
|
a
|
|
|
|
b // after a value
|
|
|
|
c
|
|
|
|
// between values
|
|
|
|
d
|
|
|
|
}
|
|
|
|
|
2020-07-01 18:57:14 +02:00
|
|
|
struct User {
|
|
|
|
name string // name
|
2020-12-09 10:11:22 +01:00
|
|
|
// middle comment
|
|
|
|
age int
|
2020-07-01 18:57:14 +02:00
|
|
|
// last comment
|
|
|
|
// last comment2
|
|
|
|
}
|
|
|
|
|
2020-07-01 19:07:19 +02:00
|
|
|
fn main() {
|
2020-07-01 20:07:33 +02:00
|
|
|
u := User{
|
|
|
|
name: 'Peter'
|
|
|
|
}
|
2020-07-01 19:07:19 +02:00
|
|
|
if true {
|
|
|
|
}
|
2020-07-20 16:48:33 +02:00
|
|
|
// some comment after an if without else
|
2020-07-01 20:07:33 +02:00
|
|
|
n := sizeof(User)
|
2020-07-01 19:07:19 +02:00
|
|
|
// else
|
|
|
|
// else {
|
|
|
|
// }
|
2020-12-09 10:11:22 +01:00
|
|
|
_ := User{
|
|
|
|
name: 'Henry' // comment after name
|
|
|
|
// on the next line
|
|
|
|
age: 42
|
|
|
|
// after age line
|
|
|
|
// after line2
|
|
|
|
}
|
2020-12-09 15:35:03 +01:00
|
|
|
_ := User{
|
|
|
|
// Just a comment
|
|
|
|
}
|
2020-12-11 18:20:24 +01:00
|
|
|
a := 123 // comment after assign
|
|
|
|
b := 'foo' // also comment after assign
|
|
|
|
c := true
|
2020-12-15 04:26:28 +01:00
|
|
|
// Between two assigns
|
2020-12-11 18:20:24 +01:00
|
|
|
d := false
|
2020-12-15 04:26:28 +01:00
|
|
|
//////
|
|
|
|
// /
|
|
|
|
// 123
|
2020-07-01 19:07:19 +02:00
|
|
|
}
|