System.Data.SQLite
Check-in [5a46d020f4]
Not logged in

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

Overview
Comment:Further enhance backward compatibility of the 'vtab.tcl' doc tool.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5a46d020f42c82834270b65f3a855d3b9034f80c
User & Date: mistachkin 2016-09-12 21:35:16
Context
2016-09-13
21:54
Minor simplification of the 'vtab.tcl' doc tool. check-in: f318af97f7 user: mistachkin tags: trunk
2016-09-12
21:35
Further enhance backward compatibility of the 'vtab.tcl' doc tool. check-in: 5a46d020f4 user: mistachkin tags: trunk
21:28
Pickup the SQLite core library 3.14.2 docs from upstream. check-in: 0d2c14e945 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Doc/vtab.tcl.

    44     44         lappend result $element
    45     45       }
    46     46     }
    47     47   
    48     48     return $result
    49     49   }
    50     50   
    51         -proc processLine { line prefix } {
           51  +proc processLine { line prefix ltAndGt } {
    52     52     if {[string length [string trim $line]] == 0 || \
    53     53         [regexp -- {<h\d(?: |>)} [string range $line 0 3]] || \
    54     54         [regexp -- {</p>\n<h\d(?: |>)} [string range $line 0 8]]} then {
    55     55       return ""
    56     56     }
    57     57   
    58     58     set result $line
................................................................................
    74     74     }
    75     75   
    76     76     set indent "        /// "
    77     77   
    78     78     regsub -all -- {&ne;} $result {\&#8800;} result
    79     79     regsub -all -- {&#91(?:;)?} $result {[} result
    80     80     regsub -all -- {&#93(?:;)?} $result {]} result
    81         -  # regsub -all -- {<( |\"|\d|=)} $result {\&lt;\1} result
    82         -  # regsub -all -- {( |\"|\d|=)>} $result {\1\&gt;} result
           81  +
           82  +  if {$ltAndGt} then {
           83  +    regsub -all -- {<( |\"|\d|=)} $result {\&lt;\1} result
           84  +    regsub -all -- {( |\"|\d|=)>} $result {\1\&gt;} result
           85  +  }
    83     86   
    84     87     regsub -all -- {<div class="codeblock"><pre>} $result \
    85     88         <para><code>\n$indent result
    86     89   
    87     90     regsub -all -- {</pre></div>} $result </code></para> result
    88     91     regsub -all -- {<blockquote><pre>} $result <para><code> result
    89     92     regsub -all -- {</pre></blockquote>} $result </code></para> result
    90     93     regsub -all -- {<blockquote>} $result <para><code> result
    91     94     regsub -all -- {</blockquote>} $result </code></para> result
    92     95   
    93     96     return $result
    94     97   }
    95     98   
    96         -proc extractMethod { name lines pattern prefix indexVarName methodsVarName } {
           99  +proc extractMethod {
          100  +        name lines pattern prefix indexVarName methodsVarName ltAndGt } {
    97    101     upvar 1 $indexVarName index
    98    102     upvar 1 $methodsVarName methods
    99    103   
   100    104     array set levels {p 0}
   101    105     set length [llength $lines]
   102    106   
   103    107     while {$index < $length} {
................................................................................
   119    123           }
   120    124   
   121    125           incr levels(p) -1
   122    126         } elseif {[string range $trimLine 0 2] eq "<p>" || \
   123    127             [string range $trimLine 0 6] eq "</p><p>"} then {
   124    128           # open tag ... maybe one line?
   125    129           if {[string range $trimLine end-3 end] eq "</p>"} then {
   126         -          set newLine [processLine $line $prefix]
          130  +          set newLine [processLine $line $prefix $ltAndGt]
   127    131   
   128    132             if {[string length $newLine] > 0} then {
   129    133               # one line tag, wrap.
   130    134               if {[info exists methods($name)]} then {
   131    135                 # non-first line, leading line separator.
   132    136                 append data \n $prefix <para>
   133    137               } else {
................................................................................
   143    147               # non-first line, leading line separator.
   144    148               append data \n $prefix <para>
   145    149             } else {
   146    150               # first line, no leading line separator.
   147    151               append data $prefix <para>
   148    152             }
   149    153   
   150         -          set newLine [processLine $line $prefix]
          154  +          set newLine [processLine $line $prefix $ltAndGt]
   151    155   
   152    156             if {[string length $newLine] > 0} then {
   153    157               append data \n $prefix $newLine
   154    158             }
   155    159   
   156    160             incr levels(p)
   157    161           }
   158    162         } else {
   159         -        set newLine [processLine $line $prefix]
          163  +        set newLine [processLine $line $prefix $ltAndGt]
   160    164   
   161    165           if {[string length $newLine] > 0} then {
   162    166             if {[info exists methods($name)]} then {
   163    167               # non-first line, leading line separator.
   164    168               append data \n $prefix $newLine
   165    169             } else {
   166    170               # first line, no leading line separator.
................................................................................
   201    205   
   202    206   set inputData [readFile $inputFileName]
   203    207   
   204    208   set inputData [string map [list \
   205    209       {<font size="6" color="red">*** DRAFT ***</font>} ""] $inputData]
   206    210   
   207    211   set inputData [string map [list {<p align="center"></p>} ""] $inputData]
          212  +
          213  +if {[string first &lt\; $inputData] != -1 || \
          214  +    [string first &gt\; $inputData] != -1} then {
          215  +  set ltAndGt false
          216  +} else {
          217  +  set ltAndGt true
          218  +}
   208    219   
   209    220   set lines [split [string map [list \r\n \n] $inputData] \n]
   210    221   
   211    222   set patterns(start) [string trim {
   212    223     ^(?:</p>\n)?<h1>(?:<span>)?2\. (?:</span>)?Virtual Table Methods</h1>$
   213    224   }]
   214    225   
................................................................................
   223    234     set line [preProcessLine [lindex $lines $index]]
   224    235   
   225    236     if {$start} then {
   226    237       if {[regexp -- $patterns(method) $line dummy capture]} then {
   227    238         foreach method [englishToList $capture] {
   228    239           set methodIndex [expr {$index + 1}]
   229    240   
   230         -        extractMethod \
   231         -            $method $lines $patterns(method) $prefix methodIndex methods
          241  +        extractMethod $method $lines $patterns(method) $prefix \
          242  +            methodIndex methods $ltAndGt
   232    243         }
   233    244   
   234    245         set index $methodIndex
   235    246       } else {
   236    247         incr index
   237    248       }
   238    249     } elseif {[regexp -- $patterns(start) $line]} then {