Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Side by Side Diff: third_party/sqlite/src/tool/mkopts.tcl

Issue 694353003: Get `gn gen` to succeed on Windows (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: remove GYP_DEFINES code Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/tool/mkkeywordhash.c ('k') | third_party/sqlite/src/tool/mkspeedsql.tcl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/tclsh
2 #
3 # This script is used to generate the array of strings and the enum
4 # that appear at the beginning of the C code implementation of a
5 # a TCL command and that define the available subcommands for that
6 # TCL command.
7
8 set prefix {}
9 while {![eof stdin]} {
10 set line [gets stdin]
11 if {$line==""} continue
12 regsub -all "\[ \t\n,\]+" [string trim $line] { } line
13 foreach token [split $line { }] {
14 if {![regexp {(([a-zA-Z]+)_)?([_a-zA-Z]+)} $token all px p2 name]} continue
15 lappend namelist [string tolower $name]
16 if {$px!=""} {set prefix $p2}
17 }
18 }
19
20 puts " static const char *${prefix}_strs\[\] = \173"
21 set col 0
22 proc put_item x {
23 global col
24 if {$col==0} {puts -nonewline " "}
25 if {$col<2} {
26 puts -nonewline [format " %-21s" $x]
27 incr col
28 } else {
29 puts $x
30 set col 0
31 }
32 }
33 proc finalize {} {
34 global col
35 if {$col>0} {puts {}}
36 set col 0
37 }
38
39 foreach name [lsort $namelist] {
40 put_item \"$name\",
41 }
42 put_item 0
43 finalize
44 puts " \175;"
45 puts " enum ${prefix}_enum \173"
46 foreach name [lsort $namelist] {
47 regsub -all {@} $name {} name
48 put_item ${prefix}_[string toupper $name],
49 }
50 finalize
51 puts " \175;"
OLDNEW
« no previous file with comments | « third_party/sqlite/src/tool/mkkeywordhash.c ('k') | third_party/sqlite/src/tool/mkspeedsql.tcl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698