1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

docs: mention deprecated attribute with argument (#9218)

This commit is contained in:
Lukas Neubert 2021-03-09 17:24:21 +01:00 committed by GitHub
parent b68784aa7f
commit 4aa0504ad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -193,7 +193,7 @@ println('hello world')
## Running a project folder with several files ## Running a project folder with several files
Suppose you have a folder with several .v files in it, where one of them Suppose you have a folder with several .v files in it, where one of them
contains your `main()` function, and the other files have other helper contains your `main()` function, and the other files have other helper
functions. They may be organized by topic, but still *not yet* structured functions. They may be organized by topic, but still *not yet* structured
enough to be their own separate reusable modules, and you want to compile enough to be their own separate reusable modules, and you want to compile
them all into one program. them all into one program.
@ -221,7 +221,7 @@ If you want to keep it, use `v -keepc run .` instead, or just compile
manually with `v .` . manually with `v .` .
NB: any V compiler flags should be passed *before* the `run` command. NB: any V compiler flags should be passed *before* the `run` command.
Everything after the source file/folder, will be passed to the program Everything after the source file/folder, will be passed to the program
as is - it will not be processed by V. as is - it will not be processed by V.
## Comments ## Comments
@ -4021,6 +4021,10 @@ function/struct/enum declaration and applies only to the following declaration.
fn old_function() { fn old_function() {
} }
// It can also display a custom deprecation message
[deprecated: 'use new_function() instead']
fn legacy_function() {}
// This function's calls will be inlined. // This function's calls will be inlined.
[inline] [inline]
fn inlined_function() { fn inlined_function() {