iutils-raku/lib/IUtils/Regexes.rakumod

26 lines
552 B
Raku
Raw Normal View History

2024-12-31 16:28:24 +00:00
unit module IUtils::Regexes;
2024-12-31 02:32:25 +00:00
my token type {
'test' | 'bench'
}
2024-12-31 23:12:35 +00:00
my token output-type {
'()' | 'Bool' | 'Either'
}
my token comment-start { \- \- }
2024-12-31 02:32:25 +00:00
my token flag { \@ \@ <type> }
my token name { <[\w \-]>+ }
2025-01-01 01:40:00 +00:00
my token test-name { \V+ }
2024-12-31 02:32:25 +00:00
2024-12-31 23:12:35 +00:00
my token comment-line { <&comment-start> \V* \v }
2024-12-31 02:32:25 +00:00
my regex flagged-expression is export {
2025-01-01 01:40:00 +00:00
\h* <&comment-start> \h* <flag> \h* <test-name> \V* \v
2024-12-31 23:12:35 +00:00
<comment-line>*
<expression-name=&name> \h+ \: \h+ 'IO' \h+ <output-type> \V* \v
2024-12-31 02:32:25 +00:00
}
2024-12-31 19:11:46 +00:00
my regex module-name is export {
'module' \h* $<name>=(\S+)
}