From: <hi...@us...> - 2010-05-07 19:16:18
|
Revision: 7290 http://octave.svn.sourceforge.net/octave/?rev=7290&view=rev Author: highegg Date: 2010-05-07 19:16:10 +0000 (Fri, 07 May 2010) Log Message: ----------- avoid using \s in oct2mat Modified Paths: -------------- trunk/octave-forge/extra/oct2mat/inst/oct2mat Modified: trunk/octave-forge/extra/oct2mat/inst/oct2mat =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/oct2mat 2010-05-07 09:01:30 UTC (rev 7289) +++ trunk/octave-forge/extra/oct2mat/inst/oct2mat 2010-05-07 19:16:10 UTC (rev 7290) @@ -216,7 +216,7 @@ } ## strip leading whitespace. - if (match(line, /^\s+/)) { + if (match(line, /^[ \t]+/)) { n = RLENGTH; spc = substr(line, 1, n); line = substr(line, n+1); @@ -245,7 +245,7 @@ if (par == ")") { ## Attempt to include an indexed token. - if (match(rem, /^\s*\w+/)) + if (match(rem, /^[ \t]*\w+/)) n += RLENGTH; } @@ -309,33 +309,33 @@ if ($0 ~ /(\+|-|\.?\*|\.?\/|\.?\^)=/) { ## try to substitute computed assignments. ## +=, -=, &=, |= don't generally need extra parens. - $0 = gensub(/([^ ;]*[a-zA-Z0-9\)\}])(\s*)(\+|-|\&|\|)=/, "\\1\\2=\\2\\1\\2\\3", "g"); + $0 = gensub(/([^ ;]*[a-zA-Z0-9\)\}])([ \t]*)(\+|-|\&|\|)=/, "\\1\\2=\\2\\1\\2\\3", "g"); ## *=, /=, ^= and their dotted counterparts need parenthesizing the RHS. - $0 = gensub(/([^ ;]*[a-zA-Z0-9\)\}])(\s*)(\.?\*|\.?\/|\.?\^)=(\s*)([^;]+)/, + $0 = gensub(/([^ ;]*[a-zA-Z0-9\)\}])([ \t]*)(\.?\*|\.?\/|\.?\^)=([ \t]*)([^;]+)/, "\\1\\2=\\2\\1\\2\\3\\4(\\5)", "g"); } ## match expression indexing. bad = 0; - while (match($0, /\)\s*\(/) && !bad) { + while (match($0, /\)[ \t]*\(/) && !bad) { # (expr)(index) or name(expr)(index) $0 = subst_indexed_expr($0, RSTART); } bad = 0; - while (match($0, /\)\s*\{/) && !bad) { + while (match($0, /\)[ \t]*\{/) && !bad) { # (expr){index} or name(expr){index} $0 = subst_indexed_expr($0, RSTART); } bad = 0; - while (match($0, /\]\s*\(/) && !bad) { + while (match($0, /\][ \t]*\(/) && !bad) { # [expr](index) $0 = subst_indexed_expr($0, RSTART); } bad = 0; - while (match($0, /\]\s*\{/) && !bad) { + while (match($0, /\][ \t]*\{/) && !bad) { # [expr]{index} $0 = subst_indexed_expr($0, RSTART); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |