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

Unified Diff: third_party/sqlite/src/tool/vdbe-compress.tcl

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/tool/tostr.awk ('k') | third_party/sqlite/src/tool/vdbe_profile.tcl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/tool/vdbe-compress.tcl
diff --git a/third_party/sqlite/src/tool/vdbe-compress.tcl b/third_party/sqlite/src/tool/vdbe-compress.tcl
index 3bcff9e5f0b3da01bdb873714f2d9e51602d6761..9477f4afe62a4aaaec5265faf6f3a96d0af66741 100644
--- a/third_party/sqlite/src/tool/vdbe-compress.tcl
+++ b/third_party/sqlite/src/tool/vdbe-compress.tcl
@@ -13,7 +13,7 @@
# Script usage:
#
# mv vdbe.c vdbe.c.template
-# tclsh vdbe-compress.tcl <vdbe.c.template >vdbe.c
+# tclsh vdbe-compress.tcl $CFLAGS <vdbe.c.template >vdbe.c
#
# Modifications made:
#
@@ -42,6 +42,16 @@ set unionDef {} ;# C code of the union
set afterUnion {} ;# C code after the union
set sCtr 0 ;# Context counter
+# If the SQLITE_SMALL_STACK compile-time option is missing, then
+# this transformation becomes a no-op.
+#
+if {![regexp {SQLITE_SMALL_STACK} $argv]} {
+ while {![eof stdin]} {
+ puts [gets stdin]
+ }
+ exit
+}
+
# Read program text up to the spot where the union should be
# inserted.
#
@@ -79,6 +89,9 @@ while {![eof stdin]} {
append unionDef " $line\n"
append afterUnion $line\n
lappend vlist $vname
+ } elseif {[regexp {^#(if|endif)} $line] && [llength $vlist]>0} {
+ append unionDef "$line\n"
+ append afterUnion $line\n
} else {
break
}
@@ -97,6 +110,11 @@ while {![eof stdin]} {
foreach v $vlist {
regsub -all "(\[^a-zA-Z0-9>.\])${v}(\\W)" $line "\\1u.$sname.$v\\2" line
regsub -all "(\[^a-zA-Z0-9>.\])${v}(\\W)" $line "\\1u.$sname.$v\\2" line
+
+ # The expressions above fail to catch instance of variable "abc" in
+ # expressions like (32>abc). The following expression makes those
+ # substitutions.
+ regsub -all "(\[^-\])>${v}(\\W)" $line "\\1>u.$sname.$v\\2" line
}
append afterUnion [string trimright $line]\n
} elseif {$line=="" && [eof stdin]} {
« no previous file with comments | « third_party/sqlite/src/tool/tostr.awk ('k') | third_party/sqlite/src/tool/vdbe_profile.tcl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698