From cb8a19efaf49d0f0202d9e536d89640aec0d459d Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Tue, 26 Nov 2019 09:34:04 +0300 Subject: [PATCH] vweb: bring back html() test --- examples/vweb/vweb_example.v | 4 +--- vlib/compiler/comptime.v | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/vweb/vweb_example.v b/examples/vweb/vweb_example.v index 6df5b9cbec..91ede68e37 100644 --- a/examples/vweb/vweb_example.v +++ b/examples/vweb/vweb_example.v @@ -26,16 +26,14 @@ pub fn (app & App) json_endpoint() { app.vweb.json('{"a": 3}') } -/* pub fn (app mut App) index() { app.cnt ++ $vweb.html() } -*/ pub fn (app & App) text() { - app.vweb.text('hello world') + app.vweb.text('Hello world') } pub fn (app mut App) cookie() { diff --git a/vlib/compiler/comptime.v b/vlib/compiler/comptime.v index 042b86e5dc..14a495fa71 100644 --- a/vlib/compiler/comptime.v +++ b/vlib/compiler/comptime.v @@ -172,7 +172,7 @@ fn (p mut Parser) comp_time() { p.statements_from_text(v_code, false) p.genln('/////////////////// tmpl end') receiver := p.cur_fn.args[0] - dot := if receiver.is_mut || receiver.ptr { '->' } else { '.' } + dot := if receiver.is_mut || receiver.ptr || receiver.typ.ends_with('*') { '->' } else { '.' } p.genln('vweb__Context_html($receiver.name /*!*/$dot vweb, tmpl_res)') } else {