parser: check (mut f Foo) syntax

This commit is contained in:
yuyi 2020-05-17 19:51:18 +08:00 committed by GitHub
parent b138cadbcb
commit 7f4cf08516
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
87 changed files with 492 additions and 480 deletions

View file

@ -17,27 +17,27 @@ fn main() {
vweb.run<App>(port)
}
pub fn (app mut App) init() {
pub fn (mut app App) init() {
app.vweb.handle_static('.')
}
pub fn (app mut App) json_endpoint() {
pub fn (mut app App) json_endpoint() {
app.vweb.json('{"a": 3}')
}
pub fn (app mut App) index() {
pub fn (mut app App) index() {
app.cnt++
$vweb.html()
}
pub fn (app mut App) reset() {
pub fn (mut app App) reset() {
}
pub fn (app mut App) text() {
pub fn (mut app App) text() {
app.vweb.text('Hello world')
}
pub fn (app mut App) cookie() {
pub fn (mut app App) cookie() {
app.vweb.set_cookie('cookie', 'test')
app.vweb.text('Headers: $app.vweb.headers')
}