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

ci: add a parser fuzzer step too (#7288)

This commit is contained in:
Daniel Däschle
2020-12-12 14:20:38 +01:00
committed by GitHub
parent b76c91ec05
commit 7e3e30aa9c
3 changed files with 33 additions and 1 deletions

View File

@@ -380,7 +380,7 @@ pub fn (mut p Parser) parse_generic_struct_inst_type(name string) table.Type {
bs_cname += '_T_'
mut generic_types := []table.Type{}
mut is_instance := false
for {
for p.tok.kind != .eof {
gt := p.parse_type()
if !gt.has_flag(.generic) {
is_instance = true

View File

@@ -233,6 +233,9 @@ fn (mut s Scanner) ident_hex_number() string {
mut first_wrong_digit_pos := 0
mut first_wrong_digit := `\0`
start_pos := s.pos
if s.pos + 2 >= s.text.len {
return '0x'
}
s.pos += 2 // skip '0x'
if s.text[s.pos] == num_sep {
s.error('separator `_` is only valid between digits in a numeric literal')