Tcl Library Source Code

Check-in [d843b2df15]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Tkt [31868eeaff] Almost-identical path management utility package. (Differences due to 8.4 / 8.5 requirements) Removed doctools::paths (doctools2base, 8.4) Removed paths (pt, 8.5) Consolidated as fileutil::paths, Tcl 8.5 requirement. paths - No version bump. - T (NEW) - D (NEW) Updated internal users: - pt::peg::import 1.0.1 (I) - doctools::idx::import 0.2.1 (I) - Tcl 8.5 required - doctools::toc::import 0.2.1 (I) - Tcl 8.5 required
Timelines: family | ancestors | descendants | both | ak-31868eeaff
Files: files | file ages | folders
SHA3-256: d843b2df1597ab551075ecc41e7c597cb50e2d0b05d7cfcd0c8ce63a831c1654
User & Date: aku 2019-04-17 06:29:58
References
2019-04-17
06:31 Ticket [31868eeaff] Consolidate (duplicated) utility packages status still Open with 3 other changes artifact: 32575c1d61 user: aku
Context
2019-04-17
19:52
fileutil::paths - Doc fix, test tweak check-in: b424206ff3 user: aku tags: ak-31868eeaff
06:29
Tkt [31868eeaff] Almost-identical path management utility package. (Differences due to 8.4 / 8.5 requirements) Removed doctools::paths (doctools2base, 8.4) Removed paths (pt, 8.5) Consolidated as fileutil::paths, Tcl 8.5 requirement. paths - No version bump. - T (NEW) - D (NEW) Updated internal users: - pt::peg::import 1.0.1 (I) - doctools::idx::import 0.2.1 (I) - Tcl 8.5 required - doctools::toc::import 0.2.1 (I) - Tcl 8.5 required check-in: d843b2df15 user: aku tags: ak-31868eeaff
2019-04-16
22:56
Doctools - markdown - Tkt [c17f7019ec] Multiple fixes - Handling of multi-line input to emphasis and similar doctools markup. The markdown markup for these are limited to inline. Fixed by emitting markup for each line of the input. - Flush command results in example_end. Fixes the markup of such commands getting wrongly moved to after the example. Tweaked example formatting, dropping trailing linebreak and empty line in block quote. Version bump 1.5.5 - B (markdown, text) - T (markdown, text) - D (Various manpages affected by the issues, and tweak) check-in: f5786278a4 user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Deleted modules/doctools2base/paths.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# docidx.tcl --
#
#	Generic path list management, for use by import management.
#
# Copyright (c) 2009 Andreas Kupries <[email protected]>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
# 
# RCS: @(#) $Id: paths.tcl,v 1.2 2009/04/29 02:09:46 andreas_kupries Exp $

# Each object manages a list of paths.

# ### ### ### ######### ######### #########
## Requisites

package require Tcl 8.4
package require snit

# ### ### ### ######### ######### #########
## API

snit::type ::doctools::paths {

    # ### ### ### ######### ######### #########
    ## Options :: None

    # ### ### ### ######### ######### #########
    ## Creation, destruction

    # Default constructor.
    # Default destructor.

    # ### ### ### ######### ######### #########
    ## Methods :: Querying and manipulating the list of paths.

    method paths {} {
	return $mypaths
    }

    method add {path} {
	set pos [lsearch $mypaths $path]
	if {$pos >= 0 } return
	lappend mypaths $path
	return
    }

    method remove {path} {
	set pos [lsearch $mypaths $path]
	if {$pos < 0} return
	set  mypaths [lreplace $mypaths $pos $pos]
	return
    }

    method clear {} {
	set mypaths {}
	return
    }

    # ### ### ### ######### ######### #########
    ## Internal methods :: None

    # ### ### ### ######### ######### #########
    ## State :: List of paths.

    variable mypaths {}

    ##
    # ### ### ### ######### ######### #########
}

# ### ### ### ######### ######### #########
## Ready

package provide doctools::paths 0.1
return
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






















































































































































Changes to modules/doctools2base/pkgIndex.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
if {![package vsatisfies [package provide Tcl] 8.4]} {return}

# Packages for the doctools {idx,toc,doc} v2 implementation
# (still v1.1 doc{idx,toc} languages).

# Supporting packages
# - Handling configuration variables, and include paths.
# - Handling text generation, the nroff man.macros definitions,
#            HTML/XML generation, and the default CSS style
# - Handling of message catalogs as packages.
# - Recursive descent parser for Tcl strings (as expected by 'subst -novariables').

package ifneeded doctools::config            0.1 [list source [file join $dir config.tcl]]
package ifneeded doctools::paths             0.1 [list source [file join $dir paths.tcl]]
package ifneeded doctools::text              0.1 [list source [file join $dir text.tcl]]
package ifneeded doctools::nroff::man_macros 0.1 [list source [file join $dir nroff_manmacros.tcl]]
package ifneeded doctools::html              0.1 [list source [file join $dir html.tcl]]
package ifneeded doctools::html::cssdefaults 0.1 [list source [file join $dir html_cssdefaults.tcl]]
package ifneeded doctools::msgcat            0.1 [list source [file join $dir msgcat.tcl]]
package ifneeded doctools::tcl::parse        0.1 [list source [file join $dir tcl_parse.tcl]]





|






<






1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
if {![package vsatisfies [package provide Tcl] 8.4]} {return}

# Packages for the doctools {idx,toc,doc} v2 implementation
# (still v1.1 doc{idx,toc} languages).

# Supporting packages
# - Handling configuration variables.
# - Handling text generation, the nroff man.macros definitions,
#            HTML/XML generation, and the default CSS style
# - Handling of message catalogs as packages.
# - Recursive descent parser for Tcl strings (as expected by 'subst -novariables').

package ifneeded doctools::config            0.1 [list source [file join $dir config.tcl]]

package ifneeded doctools::text              0.1 [list source [file join $dir text.tcl]]
package ifneeded doctools::nroff::man_macros 0.1 [list source [file join $dir nroff_manmacros.tcl]]
package ifneeded doctools::html              0.1 [list source [file join $dir html.tcl]]
package ifneeded doctools::html::cssdefaults 0.1 [list source [file join $dir html_cssdefaults.tcl]]
package ifneeded doctools::msgcat            0.1 [list source [file join $dir msgcat.tcl]]
package ifneeded doctools::tcl::parse        0.1 [list source [file join $dir tcl_parse.tcl]]

Changes to modules/doctools2idx/container.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

22
23
24
25
26
27
28
29
30
31
32
33
# -*- tcl -*-
# idx.test:  Tests for the doctools::idx package. Index management.
#
# Copyright (c) 2009 by Andreas Kupries <[email protected]>
# All rights reserved.
#
# RCS: @(#) $Id: container.test,v 1.2 2009/04/29 02:10:34 andreas_kupries Exp $

# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

testsNeedTcl     8.4
testsNeedTcltest 2

support {
    use struct/list.tcl          struct::list
    use snit/snit.tcl            snit
    use fileutil/fileutil.tcl    fileutil

    use log/logger.tcl           logger
    use pluginmgr/pluginmgr.tcl  pluginmgr

    use doctools2base/config.tcl          doctools::config
    use doctools2base/paths.tcl           doctools::paths
    useLocal export.tcl      doctools::idx::export
    useLocal import.tcl      doctools::idx::import
    use doctools2base/nroff_manmacros.tcl doctools::nroff::man_macros

    source [tcllibPath doctools2base/tests/common]
}
testing {


|

<
<







|






>




<







1
2
3
4
5


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

25
26
27
28
29
30
31
# -*- tcl -*-
# idx.test:  Tests for the doctools::idx package. Index management.
#
# Copyright (c) 2009-2019 by Andreas Kupries <[email protected]>
# All rights reserved.



# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

testsNeedTcl     8.5
testsNeedTcltest 2

support {
    use struct/list.tcl          struct::list
    use snit/snit.tcl            snit
    use fileutil/fileutil.tcl    fileutil
    use fileutil/paths.tcl       fileutil::paths
    use log/logger.tcl           logger
    use pluginmgr/pluginmgr.tcl  pluginmgr

    use doctools2base/config.tcl          doctools::config

    useLocal export.tcl      doctools::idx::export
    useLocal import.tcl      doctools::idx::import
    use doctools2base/nroff_manmacros.tcl doctools::nroff::man_macros

    source [tcllibPath doctools2base/tests/common]
}
testing {

Changes to modules/doctools2idx/import.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
..
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
...
183
184
185
186
187
188
189
190
191
# import.tcl --
#
#	Importing indices into other formats.
#
# Copyright (c) 2009-2018 Andreas Kupries <[email protected]>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
# 
# RCS: @(#) $Id: import.tcl,v 1.2 2011/11/17 08:00:45 andreas_kupries Exp $

# Each object manages a set of plugins for the conversion of keyword
# indices into some textual representation. I.e. this object manages
# the conversion to specialized serializations of keyword indices.

# ### ### ### ######### ######### #########
## Requisites

package require Tcl 8.4
package require doctools::config
package require doctools::idx::structure
package require doctools::paths
package require pluginmgr
package require snit

# ### ### ### ######### ######### #########
## API

snit::type ::doctools::idx::import {
................................................................................
    ## Options :: None

    # ### ### ### ######### ######### #########
    ## Creation, destruction.

    constructor {} {
	install myconfig  using ::doctools::config ${selfns}::config
	install myinclude using ::doctools::paths  ${selfns}::include
	return
    }

    destructor {
	$myconfig  destroy
	$myinclude destroy
	# Clear the cache of loaded import plugins.
................................................................................
    ##
    # ### ### ### ######### ######### #########
}

# ### ### ### ######### ######### #########
## Ready

package provide doctools::idx::import 0.2
return



|



<
<








|


|







 







|







 







|

1
2
3
4
5
6
7
8


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
...
181
182
183
184
185
186
187
188
189
# import.tcl --
#
#	Importing indices into other formats.
#
# Copyright (c) 2009-2019 Andreas Kupries <[email protected]>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.



# Each object manages a set of plugins for the conversion of keyword
# indices into some textual representation. I.e. this object manages
# the conversion to specialized serializations of keyword indices.

# ### ### ### ######### ######### #########
## Requisites

package require Tcl 8.5
package require doctools::config
package require doctools::idx::structure
package require fileutil::paths
package require pluginmgr
package require snit

# ### ### ### ######### ######### #########
## API

snit::type ::doctools::idx::import {
................................................................................
    ## Options :: None

    # ### ### ### ######### ######### #########
    ## Creation, destruction.

    constructor {} {
	install myconfig  using ::doctools::config ${selfns}::config
	install myinclude using ::fileutil::paths  ${selfns}::include
	return
    }

    destructor {
	$myconfig  destroy
	$myinclude destroy
	# Clear the cache of loaded import plugins.
................................................................................
    ##
    # ### ### ### ######### ######### #########
}

# ### ### ### ######### ######### #########
## Ready

package provide doctools::idx::import 0.2.1
return

Changes to modules/doctools2idx/import.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

23
24
25
26
27
28
29
30
31
32
33
34
...
148
149
150
151
152
153
154



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# -*- tcl -*-
# -- idx_import.test:
# -- Tests for package "doctools::idx::import": Management of import plugins.
#
# Copyright (c) 2009 by Andreas Kupries <[email protected]>
# All rights reserved.
#
# RCS: @(#) $Id: import.test,v 1.1 2009/04/01 04:28:37 andreas_kupries Exp $

# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

testsNeedTcl     8.4
testsNeedTcltest 2

support {
    use struct/list.tcl         struct::list
    use snit/snit.tcl           snit
    use fileutil/fileutil.tcl   fileutil

    use log/logger.tcl          logger
    use pluginmgr/pluginmgr.tcl pluginmgr

    use      doctools2base/config.tcl    doctools::config
    use      doctools2base/paths.tcl     doctools::paths

    source [tcllibPath doctools2base/tests/common]
}
testing {
    useLocalKeep import.tcl doctools::idx::import
}

................................................................................
    I config set N V X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::config::Snit_methodset type selfns win self name ?value?"}

# config unset - accepts any number of arguments.




test doctools-idx-import-8.0 {include paths, wrong#args} -setup {
    doctools::idx::import I
} -body {
    I include paths X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::paths::Snit_methodpaths type selfns win self"}

test doctools-idx-import-9.0 {include clear, wrong#args} -setup {
    doctools::idx::import I
} -body {
    I include clear X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::paths::Snit_methodclear type selfns win self"}

test doctools-idx-import-10.0 {include add, wrong#args} -setup {
    doctools::idx::import I
} -body {
    I include add
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::paths::Snit_methodadd type selfns win self path"}

test doctools-idx-import-10.1 {include add, wrong#args} -setup {
    doctools::idx::import I
} -body {
    I include add P X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::paths::Snit_methodadd type selfns win self path"}

test doctools-idx-import-11.0 {include remove, wrong#args} -setup {
    doctools::idx::import I
} -body {
    I include remove
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::paths::Snit_methodremove type selfns win self path"}

test doctools-idx-import-11.1 {include remove, wrong#args} -setup {
    doctools::idx::import I
} -body {
    I include remove P X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::paths::Snit_methodremove type selfns win self path"}

# -------------------------------------------------------------------------

test doctools-idx-import-12.0 {config set, define single var} -setup {
    doctools::idx::import I
} -body {
    I config set N V



|

<
<







|






>



|
<







 







>
>
>






|







|







|







|







|







|







1
2
3
4
5
6


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
...
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# -*- tcl -*-
# -- idx_import.test:
# -- Tests for package "doctools::idx::import": Management of import plugins.
#
# Copyright (c) 2009-2019 by Andreas Kupries <[email protected]>
# All rights reserved.



# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

testsNeedTcl     8.5
testsNeedTcltest 2

support {
    use struct/list.tcl         struct::list
    use snit/snit.tcl           snit
    use fileutil/fileutil.tcl   fileutil
    use fileutil/paths.tcl      fileutil::paths
    use log/logger.tcl          logger
    use pluginmgr/pluginmgr.tcl pluginmgr

    use doctools2base/config.tcl    doctools::config


    source [tcllibPath doctools2base/tests/common]
}
testing {
    useLocalKeep import.tcl doctools::idx::import
}

................................................................................
    I config set N V X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::config::Snit_methodset type selfns win self name ?value?"}

# config unset - accepts any number of arguments.

# -------------------------------------------------------------------------
## `include paths` component, provided via fileutil::paths, search path for includes

test doctools-idx-import-8.0 {include paths, wrong#args} -setup {
    doctools::idx::import I
} -body {
    I include paths X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodpaths type selfns win self"}

test doctools-idx-import-9.0 {include clear, wrong#args} -setup {
    doctools::idx::import I
} -body {
    I include clear X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodclear type selfns win self"}

test doctools-idx-import-10.0 {include add, wrong#args} -setup {
    doctools::idx::import I
} -body {
    I include add
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodadd type selfns win self path"}

test doctools-idx-import-10.1 {include add, wrong#args} -setup {
    doctools::idx::import I
} -body {
    I include add P X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodadd type selfns win self path"}

test doctools-idx-import-11.0 {include remove, wrong#args} -setup {
    doctools::idx::import I
} -body {
    I include remove
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodremove type selfns win self path"}

test doctools-idx-import-11.1 {include remove, wrong#args} -setup {
    doctools::idx::import I
} -body {
    I include remove P X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodremove type selfns win self path"}

# -------------------------------------------------------------------------

test doctools-idx-import-12.0 {config set, define single var} -setup {
    doctools::idx::import I
} -body {
    I config set N V

Changes to modules/doctools2idx/include/import/plugin.inc.

1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
[comment {-*- tcl -*- --- !doctools ---}]

[manpage_begin doctools::idx::import::[vset PACKAGE] n 0.1]
[copyright {2009 Andreas Kupries <[email protected]>}]
[moddesc   {Documentation tools}]
[titledesc "[vset NAME] import plugin"]
[category  {Text formatter plugin}]
[require Tcl 8.4]
[require doctools::idx::import::[vset PACKAGE] [opt 0.1]]
[include format/[vset REQUIRE].inc]
[keywords doctools index deserialization import [vset NAME]]
[description]

This package implements the doctools keyword index import plugin for
the parsing of [vset NAME] markup.

>
|
|



|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[comment {-*- tcl -*- --- !doctools ---}]
[vset VERSION 0.2.1]
[manpage_begin doctools::idx::import::[vset PACKAGE] n [vset VERSION]]
[copyright {2009-2019 Andreas Kupries <[email protected]>}]
[moddesc   {Documentation tools}]
[titledesc "[vset NAME] import plugin"]
[category  {Text formatter plugin}]
[require Tcl 8.5]
[require doctools::idx::import::[vset PACKAGE] [opt [vset VERSION]]]
[include format/[vset REQUIRE].inc]
[keywords doctools index deserialization import [vset NAME]]
[description]

This package implements the doctools keyword index import plugin for
the parsing of [vset NAME] markup.

Changes to modules/doctools2idx/pkgIndex.tcl.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
27
28
29
30
31
32
33




# - Index container, mutable index objects
# - Export and import management
# - Export and import plugins
# - Parser for docidx markup, and handling serializations
# - Message catalogs for the parser

package ifneeded doctools::idx                 2   [list source [file join $dir container.tcl]]

package ifneeded doctools::idx::export         0.2 [list source [file join $dir export.tcl]]
package ifneeded doctools::idx::import         0.2 [list source [file join $dir import.tcl]]

package ifneeded doctools::idx::export::docidx 0.1 [list source [file join $dir export_docidx.tcl]]
package ifneeded doctools::idx::export::html   0.2 [list source [file join $dir export_html.tcl]]
package ifneeded doctools::idx::export::json   0.1 [list source [file join $dir export_json.tcl]]
package ifneeded doctools::idx::export::nroff  0.3 [list source [file join $dir export_nroff.tcl]]
package ifneeded doctools::idx::export::text   0.2 [list source [file join $dir export_text.tcl]]
package ifneeded doctools::idx::export::wiki   0.2 [list source [file join $dir export_wiki.tcl]]
................................................................................
package ifneeded doctools::idx::parse          0.1 [list source [file join $dir parse.tcl]]
package ifneeded doctools::idx::structure      0.1 [list source [file join $dir structure.tcl]]

package ifneeded doctools::msgcat::idx::c      0.1 [list source [file join $dir msgcat_c.tcl]]
package ifneeded doctools::msgcat::idx::de     0.1 [list source [file join $dir msgcat_de.tcl]]
package ifneeded doctools::msgcat::idx::en     0.1 [list source [file join $dir msgcat_en.tcl]]
package ifneeded doctools::msgcat::idx::fr     0.1 [list source [file join $dir msgcat_fr.tcl]]










<

<







 







>
>
>
>
6
7
8
9
10
11
12

13

14
15
16
17
18
19
20
..
25
26
27
28
29
30
31
32
33
34
35
# - Index container, mutable index objects
# - Export and import management
# - Export and import plugins
# - Parser for docidx markup, and handling serializations
# - Message catalogs for the parser

package ifneeded doctools::idx                 2   [list source [file join $dir container.tcl]]

package ifneeded doctools::idx::export         0.2 [list source [file join $dir export.tcl]]


package ifneeded doctools::idx::export::docidx 0.1 [list source [file join $dir export_docidx.tcl]]
package ifneeded doctools::idx::export::html   0.2 [list source [file join $dir export_html.tcl]]
package ifneeded doctools::idx::export::json   0.1 [list source [file join $dir export_json.tcl]]
package ifneeded doctools::idx::export::nroff  0.3 [list source [file join $dir export_nroff.tcl]]
package ifneeded doctools::idx::export::text   0.2 [list source [file join $dir export_text.tcl]]
package ifneeded doctools::idx::export::wiki   0.2 [list source [file join $dir export_wiki.tcl]]
................................................................................
package ifneeded doctools::idx::parse          0.1 [list source [file join $dir parse.tcl]]
package ifneeded doctools::idx::structure      0.1 [list source [file join $dir structure.tcl]]

package ifneeded doctools::msgcat::idx::c      0.1 [list source [file join $dir msgcat_c.tcl]]
package ifneeded doctools::msgcat::idx::de     0.1 [list source [file join $dir msgcat_de.tcl]]
package ifneeded doctools::msgcat::idx::en     0.1 [list source [file join $dir msgcat_en.tcl]]
package ifneeded doctools::msgcat::idx::fr     0.1 [list source [file join $dir msgcat_fr.tcl]]

if {![package vsatisfies [package provide Tcl] 8.5]} {return}

package ifneeded doctools::idx::import         0.2.1 [list source [file join $dir import.tcl]]

Changes to modules/doctools2toc/container.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

25
26
27
28
29
30
31
32
33
34
35
36
# -*- tcl -*-
# toc.test:  Tests for the doctools::toc package. ToC management.
#
# Copyright (c) 2009 by Andreas Kupries <[email protected]>
# All rights reserved.
#
# RCS: @(#) $Id: container.test,v 1.3 2009/11/15 05:50:03 andreas_kupries Exp $

# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

testsNeedTcl     8.4
testsNeedTcltest 2

support {
    useAccel [useTcllibC] struct/tree.tcl  struct::tree
    TestAccelInit                          struct::tree

    use struct/list.tcl          struct::list
    use snit/snit.tcl            snit
    use fileutil/fileutil.tcl    fileutil

    use log/logger.tcl           logger
    use pluginmgr/pluginmgr.tcl  pluginmgr

    use doctools2base/config.tcl          doctools::config
    use doctools2base/paths.tcl           doctools::paths
    useLocal export.tcl      doctools::toc::export
    useLocal import.tcl      doctools::toc::import
    use doctools2base/nroff_manmacros.tcl doctools::nroff::man_macros

    source [tcllibPath doctools2base/tests/common]
}
testing {


|

<
<







|









>




|







1
2
3
4
5


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# -*- tcl -*-
# toc.test:  Tests for the doctools::toc package. ToC management.
#
# Copyright (c) 2009-2019 by Andreas Kupries <[email protected]>
# All rights reserved.



# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

testsNeedTcl     8.5
testsNeedTcltest 2

support {
    useAccel [useTcllibC] struct/tree.tcl  struct::tree
    TestAccelInit                          struct::tree

    use struct/list.tcl          struct::list
    use snit/snit.tcl            snit
    use fileutil/fileutil.tcl    fileutil
    use fileutil/paths.tcl       fileutil::paths
    use log/logger.tcl           logger
    use pluginmgr/pluginmgr.tcl  pluginmgr

    use doctools2base/config.tcl          doctools::config

    useLocal export.tcl      doctools::toc::export
    useLocal import.tcl      doctools::toc::import
    use doctools2base/nroff_manmacros.tcl doctools::nroff::man_macros

    source [tcllibPath doctools2base/tests/common]
}
testing {

Changes to modules/doctools2toc/import.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
..
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
...
183
184
185
186
187
188
189
190
191
# import.tcl --
#
#	Importing indices into other formats.
#
# Copyright (c) 2009-2018 Andreas Kupries <[email protected]>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
# 
# RCS: @(#) $Id: import.tcl,v 1.3 2011/11/17 08:00:45 andreas_kupries Exp $

# Each object manages a set of plugins for the conversion of keyword
# indices into some textual representation. I.e. this object manages
# the conversion to specialized serializations of keyword indices.

# ### ### ### ######### ######### #########
## Requisites

package require Tcl 8.4
package require doctools::config
package require doctools::toc::structure
package require doctools::paths
package require pluginmgr
package require snit

# ### ### ### ######### ######### #########
## API

snit::type ::doctools::toc::import {
................................................................................
    ## Options :: None

    # ### ### ### ######### ######### #########
    ## Creation, destruction.

    constructor {} {
	install myconfig  using ::doctools::config ${selfns}::config
	install myinclude using ::doctools::paths  ${selfns}::include
	return
    }

    destructor {
	$myconfig  destroy
	$myinclude destroy
	# Clear the cache of loaded import plugins.
................................................................................
    ##
    # ### ### ### ######### ######### #########
}

# ### ### ### ######### ######### #########
## Ready

package provide doctools::toc::import 0.2
return



|



<
<








|


|







 







|







 







|

1
2
3
4
5
6
7
8


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
...
181
182
183
184
185
186
187
188
189
# import.tcl --
#
#	Importing indices into other formats.
#
# Copyright (c) 2009-2019 Andreas Kupries <[email protected]>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.



# Each object manages a set of plugins for the conversion of keyword
# indices into some textual representation. I.e. this object manages
# the conversion to specialized serializations of keyword indices.

# ### ### ### ######### ######### #########
## Requisites

package require Tcl 8.5
package require doctools::config
package require doctools::toc::structure
package require fileutil::paths
package require pluginmgr
package require snit

# ### ### ### ######### ######### #########
## API

snit::type ::doctools::toc::import {
................................................................................
    ## Options :: None

    # ### ### ### ######### ######### #########
    ## Creation, destruction.

    constructor {} {
	install myconfig  using ::doctools::config ${selfns}::config
	install myinclude using ::fileutil::paths  ${selfns}::include
	return
    }

    destructor {
	$myconfig  destroy
	$myinclude destroy
	# Clear the cache of loaded import plugins.
................................................................................
    ##
    # ### ### ### ######### ######### #########
}

# ### ### ### ######### ######### #########
## Ready

package provide doctools::toc::import 0.2.1
return

Changes to modules/doctools2toc/import.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

23
24
25
26
27
28
29
30
31
32
33
34
...
148
149
150
151
152
153
154



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# -*- tcl -*-
# -- toc_import.test:
# -- Tests for package "doctools::toc::import": Management of import plugins.
#
# Copyright (c) 2009 by Andreas Kupries <[email protected]>
# All rights reserved.
#
# RCS: @(#) $Id: import.test,v 1.1 2009/04/18 21:14:18 andreas_kupries Exp $

# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

testsNeedTcl     8.4
testsNeedTcltest 2

support {
    use struct/list.tcl         struct::list
    use snit/snit.tcl           snit
    use fileutil/fileutil.tcl   fileutil

    use log/logger.tcl          logger
    use pluginmgr/pluginmgr.tcl pluginmgr

    use      doctools2base/config.tcl    doctools::config
    use      doctools2base/paths.tcl     doctools::paths

    source [tcllibPath doctools2base/tests/common]
}
testing {
    useLocalKeep import.tcl doctools::toc::import
}

................................................................................
    I config set N V X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::config::Snit_methodset type selfns win self name ?value?"}

# config unset - accepts any number of arguments.




test doctools-toc-import-8.0 {include paths, wrong#args} -setup {
    doctools::toc::import I
} -body {
    I include paths X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::paths::Snit_methodpaths type selfns win self"}

test doctools-toc-import-9.0 {include clear, wrong#args} -setup {
    doctools::toc::import I
} -body {
    I include clear X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::paths::Snit_methodclear type selfns win self"}

test doctools-toc-import-10.0 {include add, wrong#args} -setup {
    doctools::toc::import I
} -body {
    I include add
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::paths::Snit_methodadd type selfns win self path"}

test doctools-toc-import-10.1 {include add, wrong#args} -setup {
    doctools::toc::import I
} -body {
    I include add P X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::paths::Snit_methodadd type selfns win self path"}

test doctools-toc-import-11.0 {include remove, wrong#args} -setup {
    doctools::toc::import I
} -body {
    I include remove
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::paths::Snit_methodremove type selfns win self path"}

test doctools-toc-import-11.1 {include remove, wrong#args} -setup {
    doctools::toc::import I
} -body {
    I include remove P X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::paths::Snit_methodremove type selfns win self path"}

# -------------------------------------------------------------------------

test doctools-toc-import-12.0 {config set, define single var} -setup {
    doctools::toc::import I
} -body {
    I config set N V



|

<
<







|






>




<







 







>
>
>






|







|







|







|







|







|







1
2
3
4
5
6


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
...
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# -*- tcl -*-
# -- toc_import.test:
# -- Tests for package "doctools::toc::import": Management of import plugins.
#
# Copyright (c) 2009-2019 by Andreas Kupries <[email protected]>
# All rights reserved.



# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

testsNeedTcl     8.5
testsNeedTcltest 2

support {
    use struct/list.tcl         struct::list
    use snit/snit.tcl           snit
    use fileutil/fileutil.tcl   fileutil
    use fileutil/paths.tcl      fileutil::paths
    use log/logger.tcl          logger
    use pluginmgr/pluginmgr.tcl pluginmgr

    use      doctools2base/config.tcl    doctools::config


    source [tcllibPath doctools2base/tests/common]
}
testing {
    useLocalKeep import.tcl doctools::toc::import
}

................................................................................
    I config set N V X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::doctools::config::Snit_methodset type selfns win self name ?value?"}

# config unset - accepts any number of arguments.

# -------------------------------------------------------------------------
## `include paths` component, provided via fileutil::paths, search path for includes

test doctools-toc-import-8.0 {include paths, wrong#args} -setup {
    doctools::toc::import I
} -body {
    I include paths X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodpaths type selfns win self"}

test doctools-toc-import-9.0 {include clear, wrong#args} -setup {
    doctools::toc::import I
} -body {
    I include clear X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodclear type selfns win self"}

test doctools-toc-import-10.0 {include add, wrong#args} -setup {
    doctools::toc::import I
} -body {
    I include add
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodadd type selfns win self path"}

test doctools-toc-import-10.1 {include add, wrong#args} -setup {
    doctools::toc::import I
} -body {
    I include add P X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodadd type selfns win self path"}

test doctools-toc-import-11.0 {include remove, wrong#args} -setup {
    doctools::toc::import I
} -body {
    I include remove
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodremove type selfns win self path"}

test doctools-toc-import-11.1 {include remove, wrong#args} -setup {
    doctools::toc::import I
} -body {
    I include remove P X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodremove type selfns win self path"}

# -------------------------------------------------------------------------

test doctools-toc-import-12.0 {config set, define single var} -setup {
    doctools::toc::import I
} -body {
    I config set N V

Changes to modules/doctools2toc/include/import/plugin.inc.

1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
[comment {-*- tcl -*- --- !doctools ---}]

[manpage_begin doctools::toc::import::[vset PACKAGE] n 0.1]
[copyright {2009 Andreas Kupries <[email protected]>}]
[moddesc   {Documentation tools}]
[titledesc "[vset NAME] import plugin"]
[category  {Text formatter plugin}]
[require Tcl 8.4]
[require doctools::toc::import::[vset PACKAGE] [opt 0.1]]
[include format/[vset REQUIRE].inc]
[keywords doctools toc {table of contents} deserialization import [vset NAME]]
[description]

This package implements the doctools table of contents import plugin
for the parsing of [vset NAME] markup.

>
|
|



|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[comment {-*- tcl -*- --- !doctools ---}]
[vset VERSION 0.2.1]
[manpage_begin doctools::toc::import::[vset PACKAGE] n [vset VERSION]]
[copyright {2009-2019 Andreas Kupries <[email protected]>}]
[moddesc   {Documentation tools}]
[titledesc "[vset NAME] import plugin"]
[category  {Text formatter plugin}]
[require Tcl 8.5]
[require doctools::toc::import::[vset PACKAGE] [opt [vset VERSION]]]
[include format/[vset REQUIRE].inc]
[keywords doctools toc {table of contents} deserialization import [vset NAME]]
[description]

This package implements the doctools table of contents import plugin
for the parsing of [vset NAME] markup.

Changes to modules/doctools2toc/pkgIndex.tcl.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
..
27
28
29
30
31
32
33




# - Index container, mutable toc objects
# - Export and import management
# - Export and import plugins
# - Parser for doctoc markup, and handling serializations
# - Message catalogs for the parser

package ifneeded doctools::toc                 2   [list source [file join $dir container.tcl]]

package ifneeded doctools::toc::export         0.2 [list source [file join $dir export.tcl]]
package ifneeded doctools::toc::import         0.2 [list source [file join $dir import.tcl]]

package ifneeded doctools::toc::export::doctoc 0.1 [list source [file join $dir export_doctoc.tcl]]
package ifneeded doctools::toc::export::html   0.1 [list source [file join $dir export_html.tcl]]
package ifneeded doctools::toc::export::json   0.1 [list source [file join $dir export_json.tcl]]
package ifneeded doctools::toc::export::nroff  0.2 [list source [file join $dir export_nroff.tcl]]
package ifneeded doctools::toc::export::text   0.1 [list source [file join $dir export_text.tcl]]
package ifneeded doctools::toc::export::wiki   0.1 [list source [file join $dir export_wiki.tcl]]
................................................................................
package ifneeded doctools::toc::parse          0.1 [list source [file join $dir parse.tcl]]
package ifneeded doctools::toc::structure      0.1 [list source [file join $dir structure.tcl]]

package ifneeded doctools::msgcat::toc::c      0.1 [list source [file join $dir msgcat_c.tcl]]
package ifneeded doctools::msgcat::toc::de     0.1 [list source [file join $dir msgcat_de.tcl]]
package ifneeded doctools::msgcat::toc::en     0.1 [list source [file join $dir msgcat_en.tcl]]
package ifneeded doctools::msgcat::toc::fr     0.1 [list source [file join $dir msgcat_fr.tcl]]










<

<







 







>
>
>
>
6
7
8
9
10
11
12

13

14
15
16
17
18
19
20
..
25
26
27
28
29
30
31
32
33
34
35
# - Index container, mutable toc objects
# - Export and import management
# - Export and import plugins
# - Parser for doctoc markup, and handling serializations
# - Message catalogs for the parser

package ifneeded doctools::toc                 2   [list source [file join $dir container.tcl]]

package ifneeded doctools::toc::export         0.2 [list source [file join $dir export.tcl]]


package ifneeded doctools::toc::export::doctoc 0.1 [list source [file join $dir export_doctoc.tcl]]
package ifneeded doctools::toc::export::html   0.1 [list source [file join $dir export_html.tcl]]
package ifneeded doctools::toc::export::json   0.1 [list source [file join $dir export_json.tcl]]
package ifneeded doctools::toc::export::nroff  0.2 [list source [file join $dir export_nroff.tcl]]
package ifneeded doctools::toc::export::text   0.1 [list source [file join $dir export_text.tcl]]
package ifneeded doctools::toc::export::wiki   0.1 [list source [file join $dir export_wiki.tcl]]
................................................................................
package ifneeded doctools::toc::parse          0.1 [list source [file join $dir parse.tcl]]
package ifneeded doctools::toc::structure      0.1 [list source [file join $dir structure.tcl]]

package ifneeded doctools::msgcat::toc::c      0.1 [list source [file join $dir msgcat_c.tcl]]
package ifneeded doctools::msgcat::toc::de     0.1 [list source [file join $dir msgcat_de.tcl]]
package ifneeded doctools::msgcat::toc::en     0.1 [list source [file join $dir msgcat_en.tcl]]
package ifneeded doctools::msgcat::toc::fr     0.1 [list source [file join $dir msgcat_fr.tcl]]

if {![package vsatisfies [package provide Tcl] 8.5]} {return}

package ifneeded doctools::toc::import         0.2.1 [list source [file join $dir import.tcl]]

Added modules/fileutil/paths.man.






















































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
[comment {-*- text -*- doctools manpage}]
[vset VERSION 1]
[manpage_begin fileutil::paths n [vset VERSION]]
[titledesc {Managed of search path pools}]
[require fileutil::paths [opt [vset VERSION]]]
[description]

Provides a snit class whose instances manage a list of (search) paths.

[section API]

The main command provides construction of search path pools:

[list_begin definitions]

[call [cmd ::fileutil::paths] [arg poolName]]

Creates a new, empty pool of search paths with an associated global
Tcl command whose name is [arg poolName].

It may be used to invoke various operations on the pool.

It has the following general form:

[list_begin definitions]
[call [cmd poolName] [method method] [opt [arg "arg arg ..."]]]
[method method] and [arg arg]uments determine the exact behavior of
the command.
[list_end][comment --instance-command--]

If [arg poolName] is specified as [const %AUTO%] a unique name will be
generated by the package itself.

The result of the command is the fully-qualified name of the instance
command. 

[list_end][comment --class-command--]

[para]

The following commands are possible for pool objects:

[list_begin definitions]

[call [arg poolName] [method add] [arg path]]

Adds the [arg path] to the pool.

Nothing is done if the [arg path] is already known to the pool.

The result of the command is the empty string.

[call [arg poolName] [method clear]]

Clears the entire pool. In other words, removes all paths from it.

The result of the command is the empty string.

[call [arg poolName] [method paths]]

Returns the list of all paths known to the pool, in the order they
were added.

[call [arg poolName] [method remove] [arg path]]

Removes the [arg path] from the pool, if it is known to the pool.

Unknown paths are ignored without error.

The result of the command is the empty string.

[list_end]

[include ../doctools2base/include/feedback.inc]
[manpage_end]

Name change from modules/pt/paths.tcl to modules/fileutil/paths.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
..
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
..
67
68
69
70
71
72
73
74
75
# paths.tcl --
#
#	Generic path list management, for use by import management.
#
# Copyright (c) 2009 Andreas Kupries <[email protected]>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
# 
# RCS: @(#) $Id: paths.tcl,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $

# Each object manages a list of paths.

# ### ### ### ######### ######### #########
## Requisites

package require Tcl 8.5
package require snit

# ### ### ### ######### ######### #########
## API

snit::type ::paths {

    # ### ### ### ######### ######### #########
    ## Options :: None

    # ### ### ### ######### ######### #########
    ## Creation, destruction

................................................................................
	lappend mypaths $path
	return
    }

    method remove {path} {
	set pos [lsearch $mypaths $path]
	if {$pos < 0} return
	set  mypaths [lreplace $mypaths $pos $pos]
	return
    }

    method clear {} {
	set mypaths {}
	return
    }
................................................................................
    ##
    # ### ### ### ######### ######### #########
}

# ### ### ### ######### ######### #########
## Ready

package provide paths 1
return

|

|



|
<
<
|










|







 







|







 







|

1
2
3
4
5
6
7
8
9


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
..
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
..
65
66
67
68
69
70
71
72
73
# paths.tcl --
#
#	Manage lists of search paths.
#
# Copyright (c) 2009-2019 Andreas Kupries <[email protected]>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.



# Each object instance manages a list of paths.

# ### ### ### ######### ######### #########
## Requisites

package require Tcl 8.5
package require snit

# ### ### ### ######### ######### #########
## API

snit::type ::fileutil::paths {

    # ### ### ### ######### ######### #########
    ## Options :: None

    # ### ### ### ######### ######### #########
    ## Creation, destruction

................................................................................
	lappend mypaths $path
	return
    }

    method remove {path} {
	set pos [lsearch $mypaths $path]
	if {$pos < 0} return
	set mypaths [lreplace $mypaths $pos $pos]
	return
    }

    method clear {} {
	set mypaths {}
	return
    }
................................................................................
    ##
    # ### ### ### ######### ######### #########
}

# ### ### ### ######### ######### #########
## Ready

package provide fileutil::paths 1
return

Added modules/fileutil/paths.test.








































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# -*- tcl -*-
# paths.test:  Testsuite for package fileutil::paths
#
# Copyright (c) 2019 by Andreas Kupries <[email protected]>
# All rights reserved.

# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

testsNeedTcl     8.5
testsNeedTcltest 2.0

testing {
    useLocal paths.tcl fileutil::paths
}

# ---------------------------------------------------------------------
# [] constructor
# [] destructor
# [] paths
# [] add
# [] remove
# [] clear

#----------------------------------------------------------------------
## Constructor, destructor

test fileutil-paths-1.0 {constructor, wrong args, too many} -body {
    fileutil::paths P X
} -returnCodes error -result {Error in constructor: wrong # args: should be "::fileutil::paths::Snit_constructor type selfns win self"}

test fileutil-paths-1.1 {instance, bogus method} -setup {
    fileutil::paths P
} -cleanup {
    P destroy
} -body {
    P bogus
} -returnCodes error -result {"::P bogus" is not defined}

#----------------------------------------------------------------------
## paths

test fileutil-paths-2.0 {paths, wrong args, too many} -setup {
    fileutil::paths P
} -cleanup {
    P destroy
} -body {
    P paths X
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodpaths type selfns win self"}

test fileutil-paths-2.1 {paths, base state, none} -setup {
    fileutil::paths P
} -cleanup {
    P destroy
} -body {
    P paths
} -result {}

#----------------------------------------------------------------------
## add

test fileutil-paths-3.0 {add, wrong args, not enough} -setup {
    fileutil::paths P
} -cleanup {
    P destroy
} -body {
    P add
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodadd type selfns win self path"}

test fileutil-paths-3.1 {add, wrong args, too many} -setup {
    fileutil::paths P
} -cleanup {
    P destroy
} -body {
    P add F X
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodadd type selfns win self path"}

test fileutil-paths-3.2 {add, state change, result} -setup {
    fileutil::paths P
} -cleanup {
    P destroy
} -body {
    list [P add F] [P paths]
} -result {{} F}

#----------------------------------------------------------------------
## remove

test fileutil-paths-4.0 {remove, wrong args, not enough} -setup {
    fileutil::paths P
} -cleanup {
    P destroy
} -body {
    P remove
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodremove type selfns win self path"}

test fileutil-paths-4.1 {remove, wrong args, too many} -setup {
    fileutil::paths P
} -cleanup {
    P destroy
} -body {
    P remove F X
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodremove type selfns win self path"}

test fileutil-paths-4.2 {remove, known path, state change, result} -setup {
    fileutil::paths P
    P add F
} -cleanup {
    P destroy
} -body {
    list [P remove F] [P paths]
} -result {{} {}}

test fileutil-paths-4.3 {remove, missing path, no state change, result} -setup {
    fileutil::paths P
    P add Z
} -cleanup {
    P destroy
} -body {
    list [P remove F] [P paths]
} -result {{} Z}

#----------------------------------------------------------------------
## clear

test fileutil-paths-5.0 {clear, wrong args, too many} -setup {
    fileutil::paths P
} -cleanup {
    P destroy
} -body {
    P clear X
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodclear type selfns win self"}

test fileutil-paths-5.1 {clear, return to base state} -setup {
    fileutil::paths P
    P add F
} -cleanup {
    P destroy
} -body {
    list [P clear] [P paths]
} -result {{} {}}

#----------------------------------------------------------------------
testsuiteCleanup
return

Changes to modules/fileutil/pkgIndex.tcl.

4
5
6
7
8
9
10



if {![package vsatisfies [package provide Tcl] 8.3]} {return}
package ifneeded fileutil::traverse 0.6 [list source [file join $dir traverse.tcl]]

if {![package vsatisfies [package provide Tcl] 8.4]} {return}
package ifneeded fileutil::multi     0.1   [list source [file join $dir multi.tcl]]
package ifneeded fileutil::multi::op 0.5.3 [list source [file join $dir multiop.tcl]]
package ifneeded fileutil::decode    0.2.1 [list source [file join $dir decode.tcl]]









>
>
>
4
5
6
7
8
9
10
11
12
13
if {![package vsatisfies [package provide Tcl] 8.3]} {return}
package ifneeded fileutil::traverse 0.6 [list source [file join $dir traverse.tcl]]

if {![package vsatisfies [package provide Tcl] 8.4]} {return}
package ifneeded fileutil::multi     0.1   [list source [file join $dir multi.tcl]]
package ifneeded fileutil::multi::op 0.5.3 [list source [file join $dir multiop.tcl]]
package ifneeded fileutil::decode    0.2.1 [list source [file join $dir decode.tcl]]

if {![package vsatisfies [package provide Tcl] 8.5]} return
package ifneeded fileutil::paths 1 [list source [file join $dir paths.tcl]]

Changes to modules/pt/pkgIndex.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
..
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
if {![package vsatisfies [package provide Tcl] 8.5]} return

# General utilities.
package ifneeded char          1.0.1 [list source [file join $dir char.tcl]]
package ifneeded configuration 1 [list source [file join $dir configuration.tcl]]
package ifneeded paths         1 [list source [file join $dir paths.tcl]]
package ifneeded text::write   1 [list source [file join $dir text_write.tcl]]

# AST support
package ifneeded pt::ast     1.1 [list source [file join $dir pt_astree.tcl]]

# General parser support. Currently only conversion of structured
# syntax errors (or parts thereof) into a human-readable form.
................................................................................
package ifneeded pt::peg::container     1 [list source [file join $dir pt_peg_container.tcl]]
package ifneeded pt::peg::interp    1.0.1 [list source [file join $dir pt_peg_interp.tcl]]
package ifneeded pt::peg::op        1.1.0 [list source [file join $dir pt_peg_op.tcl]]
package ifneeded pt::parse::peg     1.0.1 [list source [file join $dir pt_parse_peg.tcl]]


# Export/import managers. Assumes an untrusted environment.
package ifneeded pt::peg::export            1 [list source [file join $dir pt_peg_export.tcl]]
package ifneeded pt::peg::import            1 [list source [file join $dir pt_peg_import.tcl]]

# Export plugins, connecting manager to the core conversion packages.
package ifneeded pt::peg::export::container 1 [list source [file join $dir pt_peg_export_container.tcl]]
package ifneeded pt::peg::export::json      1 [list source [file join $dir pt_peg_export_json.tcl]]
package ifneeded pt::peg::export::peg       1 [list source [file join $dir pt_peg_export_peg.tcl]]

# Import plugins, connecting manager to the core conversion packages.




<







 







|
|







1
2
3
4
5

6
7
8
9
10
11
12
..
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
if {![package vsatisfies [package provide Tcl] 8.5]} return

# General utilities.
package ifneeded char          1.0.1 [list source [file join $dir char.tcl]]
package ifneeded configuration 1 [list source [file join $dir configuration.tcl]]

package ifneeded text::write   1 [list source [file join $dir text_write.tcl]]

# AST support
package ifneeded pt::ast     1.1 [list source [file join $dir pt_astree.tcl]]

# General parser support. Currently only conversion of structured
# syntax errors (or parts thereof) into a human-readable form.
................................................................................
package ifneeded pt::peg::container     1 [list source [file join $dir pt_peg_container.tcl]]
package ifneeded pt::peg::interp    1.0.1 [list source [file join $dir pt_peg_interp.tcl]]
package ifneeded pt::peg::op        1.1.0 [list source [file join $dir pt_peg_op.tcl]]
package ifneeded pt::parse::peg     1.0.1 [list source [file join $dir pt_parse_peg.tcl]]


# Export/import managers. Assumes an untrusted environment.
package ifneeded pt::peg::export            1     [list source [file join $dir pt_peg_export.tcl]]
package ifneeded pt::peg::import            1.0.1 [list source [file join $dir pt_peg_import.tcl]]

# Export plugins, connecting manager to the core conversion packages.
package ifneeded pt::peg::export::container 1 [list source [file join $dir pt_peg_export_container.tcl]]
package ifneeded pt::peg::export::json      1 [list source [file join $dir pt_peg_export_json.tcl]]
package ifneeded pt::peg::export::peg       1 [list source [file join $dir pt_peg_export_peg.tcl]]

# Import plugins, connecting manager to the core conversion packages.

Changes to modules/pt/pt_peg_import.man.

1
2
3
4
5

6
7
8
9
10
11
12
[comment {-*- tcl -*- doctools manpage}]
[manpage_begin pt::peg::import n 1]
[include include/module.inc]
[titledesc {PEG Import}]
[require snit]

[require configuration]
[require pt::peg]
[require pluginmgr]
[require pt::peg::import [opt 1]]
[description]
[include include/ref_intro.inc]





>







1
2
3
4
5
6
7
8
9
10
11
12
13
[comment {-*- tcl -*- doctools manpage}]
[manpage_begin pt::peg::import n 1]
[include include/module.inc]
[titledesc {PEG Import}]
[require snit]
[require fileutil::paths]
[require configuration]
[require pt::peg]
[require pluginmgr]
[require pt::peg::import [opt 1]]
[description]
[include include/ref_intro.inc]

Changes to modules/pt/pt_peg_import.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
..
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
...
182
183
184
185
186
187
188
189
190
# import.tcl --
#
#	Importing parsing expression grammars from other formats.
#
# Copyright (c) 2009 Andreas Kupries <[email protected]>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
# 
# RCS: @(#) $Id: pt_peg_import.tcl,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $

# Each object manages a set of plugins for the creation of parsing
# expression grammars from some textual representation. I.e. this
# object manages the conversion from specialized serializations of
# parsing expression grammars into their standard form.

# ### ### ### ######### ######### #########
## Requisites

package require Tcl 8.5
package require paths
package require pt::peg
package require pluginmgr
package require snit

# ### ### ### ######### ######### #########
## API

................................................................................
    # ### ### ### ######### ######### #########
    ## Options :: None

    # ### ### ### ######### ######### #########
    ## Creation, destruction.

    constructor {} {
	install myinclude using ::paths         ${selfns}::INCLUDE
	return
    }

    destructor {
	$myinclude destroy
	# Clear the cache of loaded import plugins.
	foreach k [array names myplugin] {
................................................................................
    ##
    # ### ### ### ######### ######### #########
}

# ### ### ### ######### ######### #########
## Ready

package provide pt::peg::import 1
return



|



<
<










|







 







|







 







|

1
2
3
4
5
6
7
8


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
..
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
...
180
181
182
183
184
185
186
187
188
# import.tcl --
#
#	Importing parsing expression grammars from other formats.
#
# Copyright (c) 2009-2019 Andreas Kupries <[email protected]>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.



# Each object manages a set of plugins for the creation of parsing
# expression grammars from some textual representation. I.e. this
# object manages the conversion from specialized serializations of
# parsing expression grammars into their standard form.

# ### ### ### ######### ######### #########
## Requisites

package require Tcl 8.5
package require fileutil::paths
package require pt::peg
package require pluginmgr
package require snit

# ### ### ### ######### ######### #########
## API

................................................................................
    # ### ### ### ######### ######### #########
    ## Options :: None

    # ### ### ### ######### ######### #########
    ## Creation, destruction.

    constructor {} {
	install myinclude using ::fileutil::paths ${selfns}::INCLUDE
	return
    }

    destructor {
	$myinclude destroy
	# Clear the cache of loaded import plugins.
	foreach k [array names myplugin] {
................................................................................
    ##
    # ### ### ### ######### ######### #########
}

# ### ### ### ######### ######### #########
## Ready

package provide pt::peg::import 1.0.1
return

Changes to modules/pt/pt_peg_import.test.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

21
22
23
24
25
26
27
28
29
30
# -*- tcl -*-
# peg_import.test:  tests for the pt::peg::import package.
#
# Copyright (c) 2009 by Andreas Kupries <[email protected]>
# All rights reserved.
#
# RCS: @(#) $Id: pt_peg_import.test,v 1.1 2010/03/26 05:07:24 andreas_kupries Exp $

# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

testsNeedTcl     8.5
testsNeedTcltest 2

support {
    use fileutil/fileutil.tcl      fileutil      ;# tests/common
    use snit/snit.tcl              snit

    use pluginmgr/pluginmgr.tcl    pluginmgr

    useLocal paths.tcl             paths
    useLocal pt_pexpression.tcl    pt::pe
    useLocal pt_pegrammar.tcl      pt::peg

    source [localPath tests/common]
}
testing {
    useLocalKeep pt_peg_import.tcl pt::peg::import


|

<
<













>


<







1
2
3
4
5


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

22
23
24
25
26
27
28
# -*- tcl -*-
# peg_import.test:  tests for the pt::peg::import package.
#
# Copyright (c) 2009-2019 by Andreas Kupries <[email protected]>
# All rights reserved.



# -------------------------------------------------------------------------

source [file join \
	[file dirname [file dirname [file join [pwd] [info script]]]] \
	devtools testutilities.tcl]

testsNeedTcl     8.5
testsNeedTcltest 2

support {
    use fileutil/fileutil.tcl      fileutil      ;# tests/common
    use snit/snit.tcl              snit
    use fileutil/paths.tcl         fileutil::paths
    use pluginmgr/pluginmgr.tcl    pluginmgr


    useLocal pt_pexpression.tcl    pt::pe
    useLocal pt_pegrammar.tcl      pt::peg

    source [localPath tests/common]
}
testing {
    useLocalKeep pt_peg_import.tcl pt::peg::import

Changes to modules/pt/tests/pt_peg_import.tests.

78
79
80
81
82
83
84



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
    I import object file O P F XXX
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::pt::peg::import::Snit_hmethodimport_object_file type selfns win self obj path ?format?"}

# config unset - accepts any number of arguments.




test pt-peg-import-5.0 {include paths, wrong#args} -setup {
    pt::peg::import I
} -body {
    I include paths X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::paths::Snit_methodpaths type selfns win self"}

test pt-peg-import-6.0 {include clear, wrong#args} -setup {
    pt::peg::import I
} -body {
    I include clear X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::paths::Snit_methodclear type selfns win self"}

test pt-peg-import-7.0 {include add, wrong#args} -setup {
    pt::peg::import I
} -body {
    I include add
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::paths::Snit_methodadd type selfns win self path"}

test pt-peg-import-7.1 {include add, wrong#args} -setup {
    pt::peg::import I
} -body {
    I include add P X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::paths::Snit_methodadd type selfns win self path"}

test pt-peg-import-8.0 {include remove, wrong#args} -setup {
    pt::peg::import I
} -body {
    I include remove
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::paths::Snit_methodremove type selfns win self path"}

test pt-peg-import-8.1 {include remove, wrong#args} -setup {
    pt::peg::import I
} -body {
    I include remove P X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::paths::Snit_methodremove type selfns win self path"}

# -------------------------------------------------------------------------

test pt-peg-import9.0 {include paths, empty} -setup {
    pt::peg::import I
} -body {
    I include paths






>
>
>






|







|







|







|







|







|







78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
    I import object file O P F XXX
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::pt::peg::import::Snit_hmethodimport_object_file type selfns win self obj path ?format?"}

# config unset - accepts any number of arguments.

# -------------------------------------------------------------------------
## `include` component, provided via fileutil::paths, search path for includes

test pt-peg-import-5.0 {include paths, wrong#args} -setup {
    pt::peg::import I
} -body {
    I include paths X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodpaths type selfns win self"}

test pt-peg-import-6.0 {include clear, wrong#args} -setup {
    pt::peg::import I
} -body {
    I include clear X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodclear type selfns win self"}

test pt-peg-import-7.0 {include add, wrong#args} -setup {
    pt::peg::import I
} -body {
    I include add
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodadd type selfns win self path"}

test pt-peg-import-7.1 {include add, wrong#args} -setup {
    pt::peg::import I
} -body {
    I include add P X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodadd type selfns win self path"}

test pt-peg-import-8.0 {include remove, wrong#args} -setup {
    pt::peg::import I
} -body {
    I include remove
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodremove type selfns win self path"}

test pt-peg-import-8.1 {include remove, wrong#args} -setup {
    pt::peg::import I
} -body {
    I include remove P X
} -cleanup {
    I destroy
} -returnCodes error -result {wrong # args: should be "::fileutil::paths::Snit_methodremove type selfns win self path"}

# -------------------------------------------------------------------------

test pt-peg-import9.0 {include paths, empty} -setup {
    pt::peg::import I
} -body {
    I include paths