File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -225,8 +225,7 @@ pub fn (mut p Parser) compile_template_file(template_file string, fn_name string
225225 mut source := strings.new_builder (1000 )
226226 source.writeln ('
227227import strings
228- import veb as _
229- // === veb html template ===
228+ // === veb html template for file: ${template_file} ===
230229fn veb_tmpl_${fn_name} () string {
231230 mut sb_${fn_name} := strings.new_builder(${lstartlength} )\n
232231
@@ -457,7 +456,10 @@ fn veb_tmpl_${fn_name}() string {
457456 source.writeln ('}' )
458457 source.writeln ('// === end of veb html template_file: ${template_file} ===' )
459458
460- result := source.str ()
459+ mut result := source.str ()
460+ if result.contains ('veb.' ) {
461+ result = 'import veb\n ' + result
462+ }
461463 $if trace_tmpl_expansion ? {
462464 eprintln ('>>>>>>> template expanded to:' )
463465 eprintln (result)
You can’t perform that action at this time.
0 commit comments