mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: fix panic on open bracket without newline
This commit is contained in:
parent
5c29a7ef7d
commit
81cdda842c
@ -769,7 +769,7 @@ fn (p mut Parser) check(expected Token) {
|
|||||||
}
|
}
|
||||||
p.fgen(p.strtok())
|
p.fgen(p.strtok())
|
||||||
// vfmt: increase indentation on `{` unless it's `{}`
|
// vfmt: increase indentation on `{` unless it's `{}`
|
||||||
if expected == .lcbr && p.scanner.text[p.scanner.pos + 1] != `}` {
|
if expected == .lcbr && p.scanner.pos + 1 < p.scanner.text.len && p.scanner.text[p.scanner.pos + 1] != `}` {
|
||||||
p.fgenln('')
|
p.fgenln('')
|
||||||
p.fmt_inc()
|
p.fmt_inc()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user