1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: make codegen generate correct module name (#12929)

This commit is contained in:
zakuro 2021-12-22 08:55:57 +09:00 committed by GitHub
parent cfb814a0e3
commit 2693631643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -308,7 +308,7 @@ pub fn (mut p Parser) parse() &ast.File {
// codegen
if p.codegen_text.len > 0 && !p.pref.is_fmt {
ptext := 'module ' + p.mod.all_after('.') + p.codegen_text
ptext := 'module ' + p.mod.all_after_last('.') + p.codegen_text
codegen_file := parse_text(ptext, p.file_name, p.table, p.comments_mode, p.pref)
stmts << codegen_file.stmts
}