diff --git a/compiler/parser.v b/compiler/parser.v index 33264172aa..9a079a3b1e 100644 --- a/compiler/parser.v +++ b/compiler/parser.v @@ -518,9 +518,9 @@ fn (p mut Parser) const_decl() { continue } mut name := p.check_name() // `Age = 20` - //if ! (name[0] >= `A` && name[0] <= `Z`) { - //p.error('const name must be capitalized') - //} + if p.mod != 'os' && contains_capital(name) { + //p.warn('const names cannot contain uppercase letters, use snake_case instead') + } name = p.prepend_mod(name) mut typ := '' if p.is_vh { diff --git a/vlib/os/os_nix.v b/vlib/os/os_nix.v index 67d4ddda87..e2c5374418 100644 --- a/vlib/os/os_nix.v +++ b/vlib/os/os_nix.v @@ -5,6 +5,7 @@ module os const ( PathSeparator = '/' + path_separator = '/' ) fn init_os_args(argc int, argv &byteptr) []string { diff --git a/vlib/os/os_win.v b/vlib/os/os_win.v index 4128832a2a..0da2514b1c 100644 --- a/vlib/os/os_win.v +++ b/vlib/os/os_win.v @@ -5,6 +5,7 @@ module os const ( PathSeparator = '\\' + path_separator = '\\' ) // Ref - https://docs.microsoft.com/en-us/windows/desktop/winprog/windows-data-types