Browse Source

refactor and move ns commands to punk::ns - namespace path-glob search improvements

master
Julian Noble 1 year ago
parent
commit
54e3cf4daf
  1. 7
      src/bootsupport/modules/punk/mix-0.2.tm
  2. 1394
      src/modules/punk-0.1.tm
  3. 8
      src/modules/punk/mix/commandset/loadedlib-999999.0a1.0.tm
  4. 1307
      src/modules/punk/ns-999999.0a1.0.tm
  5. 3
      src/modules/punk/ns-buildversion.txt
  6. 13
      src/modules/punk/repl-0.1.tm

7
src/bootsupport/modules/punk/mix-0.2.tm

@ -5,6 +5,7 @@ package provide punk::mix [namespace eval punk::mix {
}] }]
package require punk::repo package require punk::repo
package rqeuire punk::ns
namespace eval punk::mix::cli { namespace eval punk::mix::cli {
namespace ensemble create namespace ensemble create
@ -509,14 +510,14 @@ namespace eval punk::mix::cli {
return false return false
} }
set moduleprefix [punk::nsprefix $libfound] set moduleprefix [punk::ns::nsprefix $libfound]
if {[string length $moduleprefix]} { if {[string length $moduleprefix]} {
set moduleprefix_parts [punk::nsparts $moduleprefix] set moduleprefix_parts [punk::ns::nsparts $moduleprefix]
set relative_path [file join {*}$moduleprefix_parts] set relative_path [file join {*}$moduleprefix_parts]
} else { } else {
set relative_path "" set relative_path ""
} }
set pkgtail [punk::nstail $libfound] set pkgtail [punk::ns::nstail $libfound]
set target_path [file join $modulefolder_path $relative_path ${pkgtail}-${ver}.tm] set target_path [file join $modulefolder_path $relative_path ${pkgtail}-${ver}.tm]
if {$opt_askme} { if {$opt_askme} {

1394
src/modules/punk-0.1.tm

File diff suppressed because it is too large Load Diff

8
src/modules/punk/mix/commandset/loadedlib-999999.0a1.0.tm

@ -17,7 +17,7 @@
# ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++ # ++ +++ +++ +++ +++ +++ +++ +++ +++ +++ +++
## Requirements ## Requirements
##e.g package require frobz ##e.g package require frobz
package require punk::ns
@ -442,14 +442,14 @@ namespace eval punk::mix::commandset::loadedlib {
} }
# -- --------------------------------------- # -- ---------------------------------------
set moduleprefix [punk::nsprefix $libfound] set moduleprefix [punk::ns::nsprefix $libfound]
if {[string length $moduleprefix]} { if {[string length $moduleprefix]} {
set moduleprefix_parts [punk::nsparts $moduleprefix] set moduleprefix_parts [punk::ns::nsparts $moduleprefix]
set relative_path [file join {*}$moduleprefix_parts] set relative_path [file join {*}$moduleprefix_parts]
} else { } else {
set relative_path "" set relative_path ""
} }
set pkgtail [punk::nstail $libfound] set pkgtail [punk::ns::nstail $libfound]
set target_path [file join $modulefolder_path $relative_path ${pkgtail}-${ver}.tm] set target_path [file join $modulefolder_path $relative_path ${pkgtail}-${ver}.tm]
if {$opt_askme} { if {$opt_askme} {

1307
src/modules/punk/ns-999999.0a1.0.tm

File diff suppressed because it is too large Load Diff

3
src/modules/punk/ns-buildversion.txt

@ -0,0 +1,3 @@
0.1.0
#First line must be a semantic version number
#all other lines are ignored.

13
src/modules/punk/repl-0.1.tm

@ -35,6 +35,7 @@ package require Thread
package require shellfilter package require shellfilter
package require shellrun package require shellrun
package require punk package require punk
package require punk::ns
@ -1010,7 +1011,7 @@ proc repl::repl_handler {inputchan prompt_config} {
append info "repl loopinstance: $loopinstance\n" append info "repl loopinstance: $loopinstance\n"
append info "last_run_info\n" append info "last_run_info\n"
append info "length: [llength $::punk::last_run_display]\n" append info "length: [llength $::punk::last_run_display]\n"
append info "namespace: $punk::ns_current" append info "namespace: $punk::ns::ns_current"
debug_repl_emit $info debug_repl_emit $info
} else { } else {
proc debug_repl_emit {msg} {return} proc debug_repl_emit {msg} {return}
@ -1056,9 +1057,9 @@ proc repl::repl_handler {inputchan prompt_config} {
#puts stderr "repl uplevel 0 '$command'" #puts stderr "repl uplevel 0 '$command'"
set status [catch { set status [catch {
#uplevel 1 $run_command_string #uplevel 1 $run_command_string
#uplevel 1 {namespace eval $punk::ns_current $run_command_string} #uplevel 1 {namespace eval $punk::ns::ns_current $run_command_string}
set weirdns 0 set weirdns 0
set parts [punk::nsparts $punk::ns_current] set parts [punk::ns::nsparts $punk::ns::ns_current]
foreach p $parts { foreach p $parts {
if {[string match :* $p] || [string match *: $p]} { if {[string match :* $p] || [string match *: $p]} {
set weirdns 1 set weirdns 1
@ -1067,9 +1068,9 @@ proc repl::repl_handler {inputchan prompt_config} {
} }
if {$weirdns} { if {$weirdns} {
uplevel 1 {punk::nseval $punk::ns_current $run_command_string} uplevel 1 {punk::ns::nseval $punk::ns::ns_current $run_command_string}
} else { } else {
uplevel 1 {namespace inscope $punk::ns_current $run_command_string} uplevel 1 {namespace inscope $punk::ns::ns_current $run_command_string}
} }
} raw_result] } raw_result]
} }
@ -1337,7 +1338,7 @@ proc repl::repl_handler {inputchan prompt_config} {
puts stderr "*> stdin reader active" puts stderr "*> stdin reader active"
} }
puts stderr "Attempting restart of repl on input channel: $inputchan" puts stderr "Attempting restart of repl on input channel: $inputchan"
catch {set ::punk::ns_current "::"} catch {set ::punk::ns::ns_current "::"}
tailcall repl::start $inputchan tailcall repl::start $inputchan
} }

Loading…
Cancel
Save