parser: support _js.v and _c.v for `-Wimpure-v`

pull/7342/head
Delyan Angelov 2020-12-15 08:24:26 +02:00
parent 0da1d757cb
commit ed50e22e18
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 3 additions and 2 deletions

View File

@ -116,9 +116,10 @@ pub fn (mut p Parser) set_path(path string) {
p.file_name = path p.file_name = path
p.file_base = os.base(path) p.file_base = os.base(path)
p.file_name_dir = os.dir(path) p.file_name_dir = os.dir(path)
if path.ends_with('.c.v') || path.ends_with('.c.vv') || path.ends_with('.c.vsh') { if path.ends_with('_c.v') || path.ends_with('.c.v') || path.ends_with('.c.vv') || path.ends_with('.c.vsh') {
p.file_backend_mode = .c p.file_backend_mode = .c
} else if path.ends_with('.js.v') || path.ends_with('.js.vv') || path.ends_with('.js.vsh') { } else if path.ends_with('_js.v') || path.ends_with('.js.v') || path.ends_with('.js.vv') ||
path.ends_with('.js.vsh') {
p.file_backend_mode = .js p.file_backend_mode = .js
} else { } else {
p.file_backend_mode = .v p.file_backend_mode = .v