You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by mx...@apache.org on 2012/05/13 02:26:20 UTC

svn commit: r1337750 - in /tcl/rivet/trunk: ChangeLog rivet/packages/tclrivet/parse.tcl rivet/packages/tclrivet/tclrivetparser.tcl

Author: mxmanghi
Date: Sun May 13 00:26:20 2012
New Revision: 1337750

URL: http://svn.apache.org/viewvc?rev=1337750&view=rev
Log:
    * rivet/packages/tclrivet/tclrivetparser.tcl: Tcl parser implements new shorthand echo syntax (closes
    bug #53217)
    * doc/xml/entities.xml: New manual page for package RivetEntities


Modified:
    tcl/rivet/trunk/ChangeLog
    tcl/rivet/trunk/rivet/packages/tclrivet/parse.tcl
    tcl/rivet/trunk/rivet/packages/tclrivet/tclrivetparser.tcl

Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=1337750&r1=1337749&r2=1337750&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Sun May 13 00:26:20 2012
@@ -1,3 +1,8 @@
+2012-05-13 Massimo Manghi <mx...@apache.org>
+    * rivet/packages/tclrivet/tclrivetparser.tcl: Tcl parser implements new shorthand echo syntax (closes
+    bug #53217)
+    * doc/xml/entities.xml: New manual page for package RivetEntities
+
 2012-05-12 Massimo Manghi <mx...@apache.org>
     * src/rivetParser.c: add shorthand expression <?= ... ?> for <? puts -nonewline "..." ?> (contributed 
     by Jeff Lawson, addresses #53217, tclrivetparser still to be fixed)

Modified: tcl/rivet/trunk/rivet/packages/tclrivet/parse.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/packages/tclrivet/parse.tcl?rev=1337750&r1=1337749&r2=1337750&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/packages/tclrivet/parse.tcl (original)
+++ tcl/rivet/trunk/rivet/packages/tclrivet/parse.tcl Sun May 13 00:26:20 2012
@@ -12,11 +12,11 @@ package require tclrivet
 proc main {} {
     global argv
     for {set i 0} {$i < [llength $argv] - 1} {incr i} {
-	source [lindex $argv $i]
+        source [lindex $argv $i]
     }
     set script [rivet::parserivet [lindex $argv end]]
     if { [catch {eval $script } err] } {
-	puts "Error: $err"
+        puts "Error: $err"
     }
 }
 

Modified: tcl/rivet/trunk/rivet/packages/tclrivet/tclrivetparser.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/rivet/packages/tclrivet/tclrivetparser.tcl?rev=1337750&r1=1337749&r2=1337750&view=diff
==============================================================================
--- tcl/rivet/trunk/rivet/packages/tclrivet/tclrivetparser.tcl (original)
+++ tcl/rivet/trunk/rivet/packages/tclrivet/tclrivetparser.tcl Sun May 13 00:26:20 2012
@@ -71,7 +71,8 @@ proc tclrivetparser::parse { data outbuf
     variable outputcmd
     variable starttag
     variable endtag
-    set inside 0
+    set inside      0
+    set shorthand   0
 
     upvar $outbufvar outbuf
 
@@ -88,7 +89,17 @@ proc tclrivetparser::parse { data outbuf
             if { $cur == [string index $starttag $p] } {
                 incr p
                 if { $p == [string length $starttag] } {
-                    append outbuf "\"\n"
+
+                    if {$next == "="} {
+#                       puts stderr "shorthand begin detected"
+                        append outbuf "\"\n $outputcmd "
+                        set shorthand   1
+                        incr i
+                        set next [string index $data $i]
+                    } else {
+                        append outbuf "\"\n"
+                    }
+
                     set inside 1
                     set p 0
                     continue
@@ -131,6 +142,10 @@ proc tclrivetparser::parse { data outbuf
             if { $cur == [string index $endtag $p] } {
                 incr p
                 if { $p == [string length $endtag] } {
+                    if {$shorthand} {
+#                       puts stderr "shorthand end detected"
+                        set shorthand 0
+                    } 
                     append outbuf "\n$outputcmd \""
                     set inside 0
                     set p 0



---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-cvs-help@tcl.apache.org