checker: relax naming requirements for translated code (#10619)
parent
e108a67952
commit
9d02ca51d1
|
@ -296,7 +296,8 @@ fn (mut c Checker) file_has_main_fn(file &ast.File) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn (mut c Checker) check_valid_snake_case(name string, identifier string, pos token.Position) {
|
fn (mut c Checker) check_valid_snake_case(name string, identifier string, pos token.Position) {
|
||||||
if !c.pref.is_vweb && name.len > 0 && (name[0] == `_` || name.contains('._')) {
|
if !c.pref.is_vweb && !c.pref.translated && name.len > 0
|
||||||
|
&& (name[0] == `_` || name.contains('._')) {
|
||||||
c.error('$identifier `$name` cannot start with `_`', pos)
|
c.error('$identifier `$name` cannot start with `_`', pos)
|
||||||
}
|
}
|
||||||
if !c.pref.experimental && !c.pref.translated && util.contains_capital(name) {
|
if !c.pref.experimental && !c.pref.translated && util.contains_capital(name) {
|
||||||
|
|
Loading…
Reference in New Issue