From: <sch...@us...> - 2010-07-28 00:40:17
|
Revision: 7486 http://octave.svn.sourceforge.net/octave/?rev=7486&view=rev Author: schloegl Date: 2010-07-28 00:40:10 +0000 (Wed, 28 Jul 2010) Log Message: ----------- conversion of a.(k) to set/getfield disabled because it is not needed; log loop over structs Modified Paths: -------------- trunk/octave-forge/extra/oct2mat/inst/oct2mat trunk/octave-forge/extra/oct2mat/inst/test_oct2mat.m Modified: trunk/octave-forge/extra/oct2mat/inst/oct2mat =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/oct2mat 2010-07-25 21:02:19 UTC (rev 7485) +++ trunk/octave-forge/extra/oct2mat/inst/oct2mat 2010-07-28 00:40:10 UTC (rev 7486) @@ -350,9 +350,9 @@ } #### replace "=dd.ee.(kk)" with "=getfield(dd.ee,kk)" -------------- - $0 = gensub(/^([^=]*=[^=]*)(\<[[:alnum:]_\.]*)\.\((\<[^\(]*)\)/,"\\1getfield(\\2,\\3)", "g"); + # $0 = gensub(/^([^=]*=[^=]*)(\<[[:alnum:]_\.]*)\.\((\<[^\(]*)\)/,"\\1getfield(\\2,\\3)", "g"); #### replace "dd.ee.(kk) = vv;" with "setfield(dd.ee,kk,vv);" -------------- - $0 = gensub(/^([ \t]*)(\<[[:alnum:]_\.]*)\.\((\<[^\(]*)\)[ \t]*=[ \t]*([^;]*);[ \t]*$/,"\\1setfield(\\2,\\3,\\4)", "g"); + # $0 = gensub(/^([ \t]*)(\<[[:alnum:]_\.]*)\.\((\<[^\(]*)\)[ \t]*=[ \t]*([^;]*);[ \t]*$/,"\\1setfield(\\2,\\3,\\4)", "g"); #### keywords gsub(/\<endfunction\>/,""); @@ -571,7 +571,7 @@ print "do:\t" FILENAME " line " NR "+: " $0 >> "/tmp/oct2mat.log" } if (/\.\(/) { - print "set/getfield:\t" FILENAME " line " NR "+: " $0 >> "/tmp/oct2mat.log" + # print "set/getfield:\t" FILENAME " line " NR "+: " $0 >> "/tmp/oct2mat.log" } if (/[ \t]*\[.~.\][ \t]*=/) { print "ignored LHS arg:\t" FILENAME " line " NR "+: " $0 >> "/tmp/oct2mat.log" @@ -585,6 +585,9 @@ if (/\<columns[ \t]*\(/) { print "columns:\t" FILENAME " line " NR "+: " $0 >> "/tmp/oct2mat.log" } + if (/\<for[ \t]*\[[^=]*,[^=]*\][ \t]*=[ \t]*[[:alpha:]_]/) { + print "loop over fields from structs:\t" FILENAME " line " NR "+: " $0 >> "/tmp/oct2mat.log" + } ##### Restore Comments ##### if (length(COMMENTS)>0) { Modified: trunk/octave-forge/extra/oct2mat/inst/test_oct2mat.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/test_oct2mat.m 2010-07-25 21:02:19 UTC (rev 7485) +++ trunk/octave-forge/extra/oct2mat/inst/test_oct2mat.m 2010-07-28 00:40:10 UTC (rev 7486) @@ -224,4 +224,7 @@ mx = vec ( xx + xx' )/2; - \ No newline at end of file + +for [k,v]=x, +for [ k , v ] = x, +end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |