mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: enhanced wording of obsolete import const error message
This commit is contained in:
parent
2ac80485c0
commit
f332e858d1
@ -470,8 +470,12 @@ fn (p mut Parser) import_statement() {
|
|||||||
|
|
||||||
fn (p mut Parser) const_decl() {
|
fn (p mut Parser) const_decl() {
|
||||||
if p.tok == .key_import {
|
if p.tok == .key_import {
|
||||||
p.error('`import const` was removed from the language, ' +
|
p.error_with_token_index(
|
||||||
'use `foo(C.CONST_NAME)` instead')
|
'`import const` was removed from the language, ' +
|
||||||
|
'because predeclaring C constants is not needed anymore. ' +
|
||||||
|
'You can use them directly with C.CONST_NAME',
|
||||||
|
p.cur_tok_index()
|
||||||
|
)
|
||||||
}
|
}
|
||||||
p.inside_const = true
|
p.inside_const = true
|
||||||
p.check(.key_const)
|
p.check(.key_const)
|
||||||
|
Loading…
Reference in New Issue
Block a user