parrotcode: Untitled | |
Contents | Libraries |
.param pmc args :slurpy
.local pmc dir
.local pmc file
$I0= args
unless $I0, return
$P1= pop args
file= new 'String'
file= $P1
file= self.'canonpath'( file )
$I0= args
unless $I0, return_file
dir= self.'catdir'( args :flat )
.local pmc p6rule
.local pmc rulesub
.local pmc match
p6rule= compreg 'PGE::Perl6Regex'
## dir =~ m{\\$}is
rulesub= p6rule( '\\ $' )
match= rulesub( dir )
if match, return_dir_file
dir .= "\\"
return_dir_file: dir .= file .return( dir ) return_file: .return( file ) return:
|