-
Notifications
You must be signed in to change notification settings - Fork 1
/
faster.regex
31 lines (20 loc) · 1.48 KB
/
faster.regex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(?<typeorqualifortypdf>((?&identifierpure))(?(?{checktypeorqualifortypdf(1)})|(*F)))
(?<qualifonly>((?&identifierpure))(?(?{checkqualifonly()})|(*F)))
(?<fasterdecls>(?(?=(?{push2 \@matches, {}})(?<declbod>((?(<tagend>)(*F))(\s*+(?&typeorqualifortypdf)\s*+
|(\s*+\b(?<tagtype>struct|union)\b\s*+(?<identtag>((?&identifierpure)?+))(?{eval {$matches[-1]{strc}=$^N}})\s*+
((?&brackets)(?{register_taggable()}))?+\s*+
|\s*+\benum\b\s*+(?<ident_enum>(((?&identifierpure))(?{eval {$matches[-1]{strc}=$^N}}))?+)\s*+
(\{\s*+(?{push2 \@matches, {}})
((?&normal_rec)(?&init_q)?+
(,(?&normal_rec)(?&init_q)?+)*+,?+)?+
(?{pop2 \@matches})\s*+\}\s*+)?+)((?<tagend>;)(?{dispatch_file_scope_stm(pos(),$minlen)}))?+
))*+
(?(<tagend>)|(?&identoutter)
(\s*+(?&parens)\s*+)*+(?&init_q)?+((,(?&identoutter)(\s*+(?&parens)\s*+)*+(?<init_q>=((?&parens)|(?&brackets)|(?&strunus)|[^\[\]\(\)\{\}'";,])*+)?+)*+
(;(?{dispatch_file_scope_stm(pos(),$minlen)}))
|\s*+(?&brackets)(?{dispatch_file_scope_stm(pos(),$minlen)})))))
\g{declbod}(?<=[};])
(?{pop2 \@matches})|(*F)(?{pop2 \@matches})))
(?<rndbrcksdecl>\s*\((?<inparen>(?<inparenin>\s*+(?&ptr)*+\s*+((?<identinside>(?&identifierpure))(?{register_normal_decl($+{identinside})})|(?&rndbrcksdecl))(\s*+(?&parens)\s*+)*+\s*)*+
((?&inparenin)(?&inparen))?+)\)\s*)
(?<identoutter>\s*+(?&ptr)*+((?&rndbrcksdecl)|(?<normal_rec>\s*+(?<identnormal>(?&identifierpure))(?{register_normal_decl($+{identnormal})})\s*+))\s*+)