v.parser: support for [if expr], part 1
Enables bootstrapping. Supports the new [if x?] syntax, without using it.pull/10493/head
parent
6a19a13812
commit
c2a7a84c72
|
@ -1524,6 +1524,12 @@ fn (mut p Parser) parse_attr() ast.Attr {
|
||||||
kind = .comptime_define
|
kind = .comptime_define
|
||||||
p.next()
|
p.next()
|
||||||
p.check(.name)
|
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
|
name = p.prev_tok.lit
|
||||||
} else if p.tok.kind == .string {
|
} else if p.tok.kind == .string {
|
||||||
name = p.tok.lit
|
name = p.tok.lit
|
||||||
|
|
Loading…
Reference in New Issue