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

[if vfmt] function attribute for skipping functions for performance

This commit is contained in:
Alexander Medvednikov
2019-10-27 02:03:06 +03:00
parent ee51313e2c
commit ef022c2326
3 changed files with 12 additions and 2 deletions

View File

@@ -3872,7 +3872,13 @@ fn (p mut Parser) js_decode() string {
fn (p mut Parser) attribute() {
p.check(.lsbr)
p.attr = p.check_name()
if p.tok == .key_if {
// [if vfmt]
p.next()
p.attr = 'if ' + p.check_name()
} else {
p.attr = p.check_name()
}
attr_token_idx := p.cur_tok_index()
if p.tok == .colon {
p.check(.colon)