From d4f6f5eec4ff5c6ac4f7aa90a5f9aadb847bbc48 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 23 Jan 2021 11:39:12 +0200 Subject: [PATCH] sokol,fontstash: move f_d_use_freetype.v to vlib/fontstash/a_d_use_freetype.v --- .../f/f_d_use_freetype.v => fontstash/a_d_use_freetype.v} | 2 +- vlib/v/ast/ast.v | 5 +++-- vlib/v/gen/cgen.v | 2 +- vlib/v/parser/comptime.v | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) rename vlib/{sokol/f/f_d_use_freetype.v => fontstash/a_d_use_freetype.v} (96%) diff --git a/vlib/sokol/f/f_d_use_freetype.v b/vlib/fontstash/a_d_use_freetype.v similarity index 96% rename from vlib/sokol/f/f_d_use_freetype.v rename to vlib/fontstash/a_d_use_freetype.v index 38ff462e7d..849e287ebb 100644 --- a/vlib/sokol/f/f_d_use_freetype.v +++ b/vlib/fontstash/a_d_use_freetype.v @@ -1,4 +1,4 @@ -module f +module fontstash #define FONS_USE_FREETYPE diff --git a/vlib/v/ast/ast.v b/vlib/v/ast/ast.v index 041a94e258..e3e8025d45 100644 --- a/vlib/v/ast/ast.v +++ b/vlib/v/ast/ast.v @@ -765,8 +765,9 @@ pub mut: // #include etc pub struct HashStmt { pub: - mod string - pos token.Position + mod string + pos token.Position + source_file string pub mut: val string // example: 'include # please install openssl // comment' kind string // : 'include' diff --git a/vlib/v/gen/cgen.v b/vlib/v/gen/cgen.v index a8eced4227..ddd26a36c8 100644 --- a/vlib/v/gen/cgen.v +++ b/vlib/v/gen/cgen.v @@ -1165,7 +1165,7 @@ fn (mut g Gen) stmt(node ast.Stmt) { g.includes.writeln(guarded_include) } } else if node.kind == 'define' { - g.includes.writeln('// defined by module `$node.mod`:') + g.includes.writeln('// defined by module `$node.mod` in file `$node.source_file`:') g.includes.writeln('#define $node.main') } } diff --git a/vlib/v/parser/comptime.v b/vlib/v/parser/comptime.v index c05a902b44..86557f8d61 100644 --- a/vlib/v/parser/comptime.v +++ b/vlib/v/parser/comptime.v @@ -33,6 +33,7 @@ fn (mut p Parser) hash() ast.HashStmt { // p.trace('a.v', 'kind: ${kind:-10s} | pos: ${pos:-45s} | hash: $val') return ast.HashStmt{ mod: p.mod + source_file: p.file_name val: val kind: kind main: main_str