mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Unnamed groups are not captured when named groups are used
This commit is contained in:
parent
5d124a3b68
commit
f7f8dc5fd4
1 changed files with 1 additions and 1 deletions
|
@ -105,7 +105,7 @@ module MJITHeader
|
||||||
su2_regex = /{([^{}]|#{su1_regex})*}/
|
su2_regex = /{([^{}]|#{su1_regex})*}/
|
||||||
su3_regex = /{([^{}]|#{su2_regex})*}/ # 3 nested structs/unions is probably enough
|
su3_regex = /{([^{}]|#{su2_regex})*}/ # 3 nested structs/unions is probably enough
|
||||||
reduced_decl.gsub!(su3_regex, '') # remove structs/unions in the header
|
reduced_decl.gsub!(su3_regex, '') # remove structs/unions in the header
|
||||||
id_seq_regex = /\s*(#{ident_regex}(\s+|\s*[*]+\s*))*/
|
id_seq_regex = /\s*(?:#{ident_regex}(?:\s+|\s*[*]+\s*))*/
|
||||||
# Process function header:
|
# Process function header:
|
||||||
match = /\A#{id_seq_regex}(?<name>#{ident_regex})\s*\(/.match(reduced_decl)
|
match = /\A#{id_seq_regex}(?<name>#{ident_regex})\s*\(/.match(reduced_decl)
|
||||||
return match[:name] if match
|
return match[:name] if match
|
||||||
|
|
Loading…
Reference in a new issue