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

pull/12931/head
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
1 changed files with 1 additions and 1 deletions

View File

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