26 lines
552 B
Raku
26 lines
552 B
Raku
unit module IUtils::Regexes;
|
|
|
|
my token type {
|
|
'test' | 'bench'
|
|
}
|
|
my token output-type {
|
|
'()' | 'Bool' | 'Either'
|
|
}
|
|
|
|
my token comment-start { \- \- }
|
|
my token flag { \@ \@ <type> }
|
|
my token name { <[\w \-]>+ }
|
|
my token test-name { \V+ }
|
|
|
|
my token comment-line { <&comment-start> \V* \v }
|
|
|
|
my regex flagged-expression is export {
|
|
\h* <&comment-start> \h* <flag> \h* <test-name> \V* \v
|
|
<comment-line>*
|
|
<expression-name=&name> \h+ \: \h+ 'IO' \h+ <output-type> \V* \v
|
|
}
|
|
|
|
my regex module-name is export {
|
|
'module' \h* $<name>=(\S+)
|
|
}
|