diff --git a/META6.json b/META6.json index 702d193..e370616 100644 --- a/META6.json +++ b/META6.json @@ -8,7 +8,8 @@ ], "provides": { "IUtils": "lib/IUtils.rakumod", - "IUtils::IDEMode": "lib/IUtils/IDEMode.rakumod" + "IUtils::IDEMode": "lib/IUtils/IDEMode.rakumod", + "IUtils::Comments": "lib/IUtils/Comments.rakumod" }, "bin": { "iutils": "bin/iutils" diff --git a/bin/iutils b/bin/iutils index 6dca9b4..85452e8 100755 --- a/bin/iutils +++ b/bin/iutils @@ -1,5 +1,14 @@ #!/usr/bin/env raku use v6.d; use IUtils; +use IUtils::Comments; -pack-run 'help'; +my $contents = "/home/nathan/Projects/Idris/structures/test/src/Main.idr".IO.slurp; + +say "\nTesting full flagged-expression:"; +say $contents ~~ &flagged-expression; +when $contents ~~ &flagged-expression { + say $; + say $; + say $; +} diff --git a/lib/IUtils/Comments.rakumod b/lib/IUtils/Comments.rakumod new file mode 100644 index 0000000..9274e64 --- /dev/null +++ b/lib/IUtils/Comments.rakumod @@ -0,0 +1,14 @@ +unit module IUtils::Comments; + +my token comment-start { \- \- } +my token type { + 'test' | 'bench' +} +my token flag { \@ \@ } +my token name { <[\w \-]>+ } + +my regex flagged-expression is export { + <&comment-start> \h* \h* \V* \v + [<&comment-start> \V* \v]* + $= \h+ \: \V* \v +}