geirm       01/01/28 22:10:34

  Modified:    test/templates arithmetic.vm block.vm diabolical.vm
                        equality.vm escape.vm escape2.vm foreach-array.vm
                        formal.vm include.vm interpolation.vm logical.vm
                        loop.vm parse1.vm pedantic.vm quotes.vm
                        reference.vm subclass.vm test.vm velocimacro.vm
               test/templates/compare escape.cmp include.cmp
  Log:
  Removed all deprecated #set forms, replacing with the normalized form #set().
  
  I had to change two cmp files, escape, to test the escaping of the new #set(), and
  include, because the include.vm includes iteself, so the output changed.
  
  Other than that, it appears the #set() perfectly replaces the old #set, including
  all whitespaceing issues, for better or worse.
  
  Revision  Changes    Path
  1.4       +5 -5      jakarta-velocity/test/templates/arithmetic.vm
  
  Index: arithmetic.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/arithmetic.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- arithmetic.vm     2000/12/08 03:20:03     1.3
  +++ arithmetic.vm     2001/01/29 06:09:24     1.4
  @@ -9,17 +9,17 @@
   
   *#
   
  -#set $foo = 5
  -#set $foo = $foo + 1
  +#set($foo = 5)
  +#set($foo = $foo + 1)
   $foo
   
  -#set $foo = $foo - 1
  +#set($foo = $foo - 1)
   $foo
   
  -#set $foo = $foo * 2
  +#set($foo = $foo * 2)
   $foo
   
  -#set $foo = $foo / 2
  +#set($foo = $foo / 2)
   $foo
   
   And the whole thing again with inline set statements
  
  
  
  1.7       +2 -2      jakarta-velocity/test/templates/block.vm
  
  Index: block.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/block.vm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- block.vm  2000/12/06 19:50:31     1.6
  +++ block.vm  2001/01/29 06:09:26     1.7
  @@ -11,7 +11,7 @@
   First test : spacing between stuff.  Note that spacing preceeding the directives 
counts!
   One blank line follows
   
  -#set $foo = false
  +#set($foo = false)
   #if ($foo)
       this is true
   #elseif ($bar)
  @@ -42,7 +42,7 @@
   
   -- Second Test : no spacing between anything (1 blank line follows)
   
  -#set $foo = false
  +#set($foo = false)
   #if ($foo)
       this is true
   #elseif ($bar)
  
  
  
  1.10      +3 -3      jakarta-velocity/test/templates/diabolical.vm
  
  Index: diabolical.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/diabolical.vm,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- diabolical.vm     2001/01/24 16:06:46     1.9
  +++ diabolical.vm     2001/01/29 06:09:27     1.10
  @@ -14,7 +14,7 @@
   $f.
   $f
   $f. $f
  -#set $f = "foo"
  +#set($f = "foo")
   $f.
   $f
   $f. $f
  @@ -52,9 +52,9 @@
   $tstrings.chop($generator.parse("sql/mysql/columns", "", "table", $tbl),1)
   $provider.chop("stringy",1)
   
  -#set $foo = "foo" 
  +#set($foo = "foo") 
   #if ($foo.length()>0)$foo#end 
  -#set $bar = "bar" 
  +#set($bar = "bar") 
   #if ($bar.length()>0)$bar#end 
   
   
  
  
  
  1.4       +4 -4      jakarta-velocity/test/templates/equality.vm
  
  Index: equality.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/equality.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- equality.vm       2000/10/31 16:07:26     1.3
  +++ equality.vm       2001/01/29 06:09:29     1.4
  @@ -9,9 +9,9 @@
   
   *#
   
  -#set $user = "jason"
  -#set $login = false
  -#set $count = 5
  +#set($user = "jason")
  +#set($login = false)
  +#set($count = 5)
   
   #if ($user == "jason")
       the user $user is logged in!
  @@ -28,4 +28,4 @@
   
   #if ($count != 3)
       \$count is not equal to 3
  -#end
  \ No newline at end of file
  +#end
  
  
  
  1.4       +5 -5      jakarta-velocity/test/templates/escape.vm
  
  Index: escape.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/escape.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- escape.vm 2000/11/03 03:28:26     1.3
  +++ escape.vm 2001/01/29 06:09:30     1.4
  @@ -11,8 +11,8 @@
   
   \A
   
  -\#set $woo = "bar"
  -#set $woo = "bar"
  +\#set($woo = "bar")
  +#set($woo = "bar")
   
   \$woo => $woo
   
  @@ -22,8 +22,8 @@
   "\r"
   
   Now, test the built in directives. Note that $foo isn't in the context :
  -\#set $foo = $foo + 1
  -\#set \$foo = $foo + 1
  +\#set($foo = $foo + 1)
  +\#set(\$foo = $foo + 1)
   \#if($foo)
   \#if ( $foo )
   \#else
  @@ -36,7 +36,7 @@
   \#if(\$foo)
   
   Put it in :
  -#set $foo = 1
  +#set($foo = 1)
   \$foo -> $foo
   \#if($foo)
   \#if(\$foo)
  
  
  
  1.2       +1 -1      jakarta-velocity/test/templates/escape2.vm
  
  Index: escape2.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/escape2.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- escape2.vm        2000/11/07 21:35:32     1.1
  +++ escape2.vm        2001/01/29 06:09:31     1.2
  @@ -21,7 +21,7 @@
   \\\#woogie
   
   Now put $foo in the context :
  -#set $foo = "bar"
  +#set($foo = "bar")
   \$foo = $foo
   \\\$foo =\\$foo
   \\\\\$foo =\\\\$foo
  
  
  
  1.5       +1 -1      jakarta-velocity/test/templates/foreach-array.vm
  
  Index: foreach-array.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/foreach-array.vm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- foreach-array.vm  2000/10/31 19:17:54     1.4
  +++ foreach-array.vm  2001/01/29 06:09:32     1.5
  @@ -33,7 +33,7 @@
   
   -- And when we declare the array in-template :
   
  -#set $colors=["red","blue","green"]
  +#set($colors=["red","blue","green"])
   Choose among :
   #foreach( $color in $colors )
        $color
  
  
  
  1.4       +2 -2      jakarta-velocity/test/templates/formal.vm
  
  Index: formal.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/formal.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- formal.vm 2000/11/04 15:31:45     1.3
  +++ formal.vm 2001/01/29 06:09:34     1.4
  @@ -23,8 +23,8 @@
   
   ${provider.Title}.map.${provider.Title}MapBuilder
   
  -#set $this = "this"
  -#set $that = "that"
  +#set($this = "this")
  +#set($that = "that")
   
   ${this}${that}
   
  
  
  
  1.2       +1 -1      jakarta-velocity/test/templates/include.vm
  
  Index: include.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/include.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- include.vm        2000/11/06 05:42:12     1.1
  +++ include.vm        2001/01/29 06:09:35     1.2
  @@ -11,7 +11,7 @@
   
   #include("include.vm" "include.vm")
   
  -#set $foo = "subdir/test.txt"
  +#set($foo = "subdir/test.txt")
   
   #include($foo)
   
  
  
  
  1.3       +11 -11    jakarta-velocity/test/templates/interpolation.vm
  
  Index: interpolation.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/interpolation.vm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- interpolation.vm  2000/12/21 05:52:15     1.2
  +++ interpolation.vm  2001/01/29 06:09:37     1.3
  @@ -11,28 +11,28 @@
   
   Start with simple string interpolation :
   
  -#set $name = "jason"
  +#set($name = "jason")
   $provider.concat("it will cost you $10.00", "")
   
  -#set $image = "dog"
  +#set($image = "dog")
   $provider.concat("${image}.jpg", "")
   
  -#set $foo-bar = "foobar"
  +#set($foo-bar = "foobar")
   $provider.concat("${foo-bar}.jpg", "")
   
  -#set $foo_bar = "foobar"
  +#set($foo_bar = "foobar")
   $provider.concat("${foo_bar}.jpg", "")
   
  -#set $one = 1
  -#set $two = 2
  -#set $three = 3
  +#set($one = 1)
  +#set($two = 2)
  +#set($three = 3)
   $provider.concat("${one}${two}${three}", "")
   $provider.concat("$one $two $three", "")
   
   How about a directive?  Sure :
   
  -#set $arr = ["a","b","c"]
  -#set $foo = "#foreach($a in $arr) >$a< #end"
  +#set($arr = ["a","b","c"])
  +#set($foo = "#foreach($a in $arr) >$a< #end")
   
   $foo 
   
  @@ -42,13 +42,13 @@
     Hi, I'm a VM!
   #end
   
  -#set $ivm = "#interpfoo()"
  +#set($ivm = "#interpfoo()")
   
   $ivm
   
   And now, for something completely different :
   
  -#set $code = "#if(false) True #else False #end"
  +#set($code = "#if(false) True #else False #end")
   
   $code
   
  
  
  
  1.5       +2 -2      jakarta-velocity/test/templates/logical.vm
  
  Index: logical.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/logical.vm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- logical.vm        2000/12/28 17:23:50     1.4
  +++ logical.vm        2001/01/29 06:09:38     1.5
  @@ -9,7 +9,7 @@
   
   *#
   
  -#set $foo = 5
  +#set($foo = 5)
   
   #if ($foo > 1)
       \$foo is greater then 1
  @@ -27,7 +27,7 @@
       \$foo is less than or equal to 5
   #end
   
  -#set $foo = false
  +#set($foo = false)
   
   #if (!($foo == true))
       foo is false
  
  
  
  1.4       +1 -1      jakarta-velocity/test/templates/loop.vm
  
  Index: loop.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/loop.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- loop.vm   2000/11/01 01:13:20     1.3
  +++ loop.vm   2001/01/29 06:09:40     1.4
  @@ -10,6 +10,6 @@
   *#
   
   #foreach ($element in $list)
  -    #set $foo = $provider.concat(["<", $element, ">"])
  +    #set($foo = $provider.concat(["<", $element, ">"]))
       $provider.concat("hello", $foo)
   #end
  
  
  
  1.2       +1 -1      jakarta-velocity/test/templates/parse1.vm
  
  Index: parse1.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/parse1.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- parse1.vm 2000/11/12 06:43:20     1.1
  +++ parse1.vm 2001/01/29 06:09:42     1.2
  @@ -15,7 +15,7 @@
   #end
   
   Now using a reference to get the next one :
  -#set $foo = "parse2.vm"
  +#set($foo = "parse2.vm")
      --
   #parse($foo)
      --
  
  
  
  1.6       +4 -4      jakarta-velocity/test/templates/pedantic.vm
  
  Index: pedantic.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/pedantic.vm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- pedantic.vm       2000/12/08 03:20:03     1.5
  +++ pedantic.vm       2001/01/29 06:09:43     1.6
  @@ -8,7 +8,7 @@
   test doesn't fail incorrectly.
   
   *#
  -#set $pedantic = "pedantic"
  +#set( $pedantic = "pedantic")
   
   This is a test of the new #if($pedantic)$pedantic#end mode.
   
  @@ -74,14 +74,14 @@
   
   2) set statement has no output, incuding preceeding whitespace
   #foreach($a in $stringarray)
  -             #set    $b = $a
  +             #set($b = $a)
    $a is $b
   #end
   
        public void foo( String lala )
        {
   #foreach($a in $stringarray)
  -             #set    $b = $a
  +             #set($b = $a)
                System.out.println("$b"); 
   #end
        }
  @@ -89,7 +89,7 @@
        public void foo( String lala )
        {
        #foreach($a in $stringarray)
  -             #set    $b = $a
  +             #set($b = $a)
        System.out.println("$b"); 
        #end
        }
  
  
  
  1.5       +1 -1      jakarta-velocity/test/templates/quotes.vm
  
  Index: quotes.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/quotes.vm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- quotes.vm 2000/12/22 12:12:32     1.4
  +++ quotes.vm 2001/01/29 06:09:45     1.5
  @@ -9,7 +9,7 @@
   
   *#
   
  -#set $this = "that"
  +#set($this = "that")
   
   #if (true)
       "what is $this"
  
  
  
  1.6       +1 -1      jakarta-velocity/test/templates/reference.vm
  
  Index: reference.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/reference.vm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- reference.vm      2000/12/27 23:52:10     1.5
  +++ reference.vm      2001/01/29 06:09:46     1.6
  @@ -9,7 +9,7 @@
   
   *#
   
  -#set $_foo = "bar"
  +#set($_foo = "bar")
   $_foo
   #if ($_foo.equals("bar"))
      \$_foo equals "bar" : $_foo
  
  
  
  1.2       +2 -2      jakarta-velocity/test/templates/subclass.vm
  
  Index: subclass.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/subclass.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- subclass.vm       2000/11/01 18:40:21     1.1
  +++ subclass.vm       2001/01/29 06:09:48     1.2
  @@ -10,10 +10,10 @@
   *#
   
   ## This is our base class.
  -#set $person = $provider.Person
  +#set($person = $provider.Person)
   
   ## This is a subclass of Person
  -#set $child = $provider.Child
  +#set($child = $provider.Child)
   
   #*
   
  
  
  
  1.4       +14 -14    jakarta-velocity/test/templates/test.vm
  
  Index: test.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/test.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- test.vm   2000/10/31 16:07:27     1.3
  +++ test.vm   2001/01/29 06:09:49     1.4
  @@ -32,7 +32,7 @@
   $100
   
   
  -#set $foo = "bar"
  +#set($foo = "bar")
   
   This is the $foo way.
   
  @@ -70,7 +70,7 @@
   
   
   
  -#set $iam-cool = "jon"
  +#set($iam-cool = "jon")
   $iam-cool
   $!nada nothing here
   
  @@ -108,25 +108,25 @@
   
   $provider2.Title
   
  -#set $a = "x"
  +#set($a = "x")
   $a
   
  -#set $b = $a
  +#set($b = $a)
   $b
   
   <input type="text" name="email" value="">
   <input type="text" name="email" value="$!schmarg">
   
   
  -#set $c = $provider.Title
  +#set($c = $provider.Title)
   $c
   
   
  -#set $d = $provider.getTitle()
  +#set($d = $provider.getTitle())
   $d
   
   
  -#set $provider.Title = "crocodile hunter!"
  +#set($provider.Title = "crocodile hunter!")
   
   
   
  @@ -136,27 +136,27 @@
   
   <!-- look here -->
   
  -#set $provider.Title = $d
  +#set($provider.Title = $d)
   $provider.Title
   
   
   
  -#set $provider.Title = $provider.Name
  +#set($provider.Title = $provider.Name)
   $provider.Title
   
   
  -#set $provider.Title = $provider.getName()
  +#set($provider.Title = $provider.getName())
   $provider.Title
   
   
   
  -#set $a = true
  +#set($a = true)
   
  -#set $b = false
  +#set($b = false)
   
  -#set $provider.State = true
  +#set($provider.State = true)
   
  -#set $provider.State = false
  +#set($provider.State = false)
   
   
   
  
  
  
  1.5       +3 -3      jakarta-velocity/test/templates/velocimacro.vm
  
  Index: velocimacro.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/velocimacro.vm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- velocimacro.vm    2000/12/21 04:44:20     1.4
  +++ velocimacro.vm    2001/01/29 06:09:51     1.5
  @@ -19,11 +19,11 @@
   Now, use the \#quietnull example from the global library VM_global_library.vm : 
   Now, there should be nothing in the brackets : >#quietnull($nada)<
   
  -#set $foo = "hello!"
  +#set($foo = "hello!")
   Where there should be something here : >#quietnull($foo)<
   
  -#set $arr = ["$10.24","$15.32","$12.15"]
  -#set $col = "blue"
  +#set($arr = ["$10.24","$15.32","$12.15"])
  +#set($col = "blue")
   
   <table>
   #tablerow( $arr $col)
  
  
  
  1.4       +3 -3      jakarta-velocity/test/templates/compare/escape.cmp
  
  Index: escape.cmp
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/compare/escape.cmp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- escape.cmp        2000/11/03 03:28:30     1.3
  +++ escape.cmp        2001/01/29 06:10:26     1.4
  @@ -2,7 +2,7 @@
   
   \A
   
  -#set $woo = "bar"
  +#set($woo = "bar")
   
   $woo => bar
   
  @@ -12,8 +12,8 @@
   "\r"
   
   Now, test the built in directives. Note that $foo isn't in the context :
  -#set $foo = $foo + 1
  -#set \$foo = $foo + 1
  +#set($foo = $foo + 1)
  +#set(\$foo = $foo + 1)
   #if($foo)
   #if ( $foo )
   #else
  
  
  
  1.2       +2 -2      jakarta-velocity/test/templates/compare/include.cmp
  
  Index: include.cmp
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/compare/include.cmp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- include.cmp       2000/11/06 05:46:39     1.1
  +++ include.cmp       2001/01/29 06:10:28     1.2
  @@ -13,7 +13,7 @@
   
   #include("include.vm" "include.vm")
   
  -#set $foo = "subdir/test.txt"
  +#set($foo = "subdir/test.txt")
   
   #include($foo)
   
  @@ -30,7 +30,7 @@
   
   #include("include.vm" "include.vm")
   
  -#set $foo = "subdir/test.txt"
  +#set($foo = "subdir/test.txt")
   
   #include($foo)
   
  
  
  

Reply via email to