mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.parser: support for [if expr], part 1
Enables bootstrapping. Supports the new [if x?] syntax, without using it.
This commit is contained in:
parent
6a19a13812
commit
c2a7a84c72
@ -1524,6 +1524,12 @@ fn (mut p Parser) parse_attr() ast.Attr {
|
||||
kind = .comptime_define
|
||||
p.next()
|
||||
p.check(.name)
|
||||
// TODO: remove this check after bootstrapping
|
||||
// it is only for compatibility with the new
|
||||
// [if user_defined?] syntax.
|
||||
if p.tok.kind == .question {
|
||||
p.next()
|
||||
}
|
||||
name = p.prev_tok.lit
|
||||
} else if p.tok.kind == .string {
|
||||
name = p.tok.lit
|
||||
|
Loading…
Reference in New Issue
Block a user