Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
add dump_paths which introspects the interpreter (dev only)
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Sep 21, 2009
1 parent 52d9285 commit 16f2b05
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua.pir
Expand Up @@ -94,6 +94,7 @@ show version information.
.sub 'main' :anon :main
.param pmc args
load_language 'lua'
# dump_paths()
lua_openlibs()
.local int status
status = handle_luainit()
Expand Down
37 changes: 37 additions & 0 deletions src/lib/luaaux.pir
Expand Up @@ -1105,6 +1105,43 @@ This function never returns.
.end


=item C<dump_paths>

For development only.

=cut

.include 'iglobals.pasm'
.include 'libpaths.pasm'

.sub 'dump_paths'
$P0 = getinterp
$P1 = $P0[.IGLOBALS_LIB_PATHS]
$P2 = $P1[.PARROT_LIB_PATH_INCLUDE]
print_path('PATH_INCLUDE', $P2)
$P2 = $P1[.PARROT_LIB_PATH_LIBRARY]
print_path('PATH_LIBRARY', $P2)
$P2 = $P1[.PARROT_LIB_PATH_DYNEXT]
print_path('PATH_PATH_DYNEXT', $P2)
$P2 = $P1[.PARROT_LIB_PATH_LANG]
print_path('PATH_LANG', $P2)
.end

.sub 'print_path' :anon
.param string name
.param pmc paths
$S0 = name . ' :'
say $S0
$P0 = iter paths
L1:
unless $P0 goto L2
$S0 = shift $P0
$S0 = "\t" . $S0
say $S0
goto L1
L2:
.end

=item C<mkarg (argv)>

Support variable number of arguments function call.
Expand Down

0 comments on commit 16f2b05

Please sign in to comment.