* bug 15053 fixed: remaining _str2code() references made mfile2sci failing 68/19168/4
Samuel GOUGEON [Sat, 11 Mar 2017 01:44:19 +0000 (02:44 +0100)]
  http://bugzilla.scilab.org/15053

  Search "str2code" (16 hits in 11 files)
  Only 2 remaining references (likely unrelevant), with no replacement:
  scilab\modules\xcos\tests\nonreg_tests\utils\renameIO.sci (1 hit)
    Line 65:     iparIO = [iparIO(1:4) ; _str2code(newName) ; iparIO(5+lfil:$)];

  scilab\modules\xcos\tests\nonreg_tests\utils\setW2Fformat.sci (1 hit)
    Line 66:     ipar = [ipar(1:5+lfil-1) ; _str2code(formatStr)];

Change-Id: I6ef0ca0d3b79d8d88eff5a643a1981dc2921ffe7

scilab/CHANGES.md
scilab/modules/core/tests/nonreg_tests/bug_7033.dia.ref [deleted file]
scilab/modules/core/tests/nonreg_tests/bug_7033.tst
scilab/modules/m2sci/macros/kernel/isinstring.sci
scilab/modules/m2sci/macros/kernel/m2sci_syntax.sci
scilab/modules/string/locales/ja_JP.po
scilab/modules/string/locales/zh_TW.po
scilab/modules/string/sci_gateway/string_gateway.xml

index 0e21891..cacebe4 100644 (file)
@@ -357,6 +357,7 @@ the [development mailing list](dev@lists.scilab.org) for a particular toolbox.
 * [#15023](http://bugzilla.scilab.org/show_bug.cgi?id=15023): `clf()` wrongly reset `figure_id`.
 * [#15039](http://bugzilla.scilab.org/show_bug.cgi?id=15039): Added demos to showcase Xcos' new graphical features
 * [#15052](http://bugzilla.scilab.org/show_bug.cgi?id=15052): `getpid` wasn't available anymore
+* [#15053](http://bugzilla.scilab.org/show_bug.cgi?id=15053): `_str2code` was removed with no proper equivalence and made `mfile2sci` failing.
 * [#15054](http://bugzilla.scilab.org/show_bug.cgi?id=15054): The callbacks of `wfir_gui()` were not prioritary.
 * [#15057](http://bugzilla.scilab.org/show_bug.cgi?id=15057): Matplot .data assignation did not take care of >2 dimension
 * [#15060](http://bugzilla.scilab.org/show_bug.cgi?id=15060): `fplot3d` did not draw because of an addition with an empty matrix which now returns an empty matrix.
diff --git a/scilab/modules/core/tests/nonreg_tests/bug_7033.dia.ref b/scilab/modules/core/tests/nonreg_tests/bug_7033.dia.ref
deleted file mode 100644 (file)
index 3c9a93e..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2010 - DIGITEO - Bernard HUGUENEY
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-// <-- Non-regression test for bug 7033 -->
-//
-// <-- Bugzilla URL -->
-// http://bugzilla.scilab.org/show_bug.cgi?id=7033
-//
-// <-- Short Description -->
-// Random crash (more often in 64 bits) in sci_newfun / getMatrixOfString / str2code
-// trying to write to unallocated memory.
-// <-- CLI SHELL MODE -->
-exec SCI/modules/core/tests/unit_tests/newfun.tst;
index ee2af60..e284c46 100644 (file)
 // http://bugzilla.scilab.org/show_bug.cgi?id=7033
 //
 // <-- Short Description -->
-// Random crash (more often in 64 bits) in sci_newfun / getMatrixOfString / str2code
+// Random crash (more often in 64 bits) in sci_newfun / getMatrixOfString
 // trying to write to unallocated memory.
 
 // <-- CLI SHELL MODE -->
+// <-- NO CHECK REF -->
 
 exec SCI/modules/core/tests/unit_tests/newfun.tst;
index 703c4c5..0473dd8 100644 (file)
@@ -67,7 +67,7 @@ function r=isinstring(str,pos)
             end
         elseif sym==quote then
             // Check if transpose or beginning of a string
-            if abs(_str2code(psym))>=36&psym<>")"&psym<>"]"&psym<>"."&psym<>quote then // Not a transpose
+            if ~isalphanum(psym) & psym<>")" & psym<>"]" & psym<>"." & psym<>quote then // Not a transpose
                 strcnt=1
             elseif bcount<>0 then // Inside a matrix definition
                 if part(str,ksym-1)==" " then strcnt=1,end
index 9e8aaa2..2cd3a58 100644 (file)
@@ -145,17 +145,6 @@ function [helppart,txt,batch]=m2sci_syntax(txt)
             end
         end
 
-        // Insert a blank when a digit is followed by a dotted operator
-        // So that point is associated to operator and not to digit
-        // Because if it is associated to digit, dot is suppressed by comp()
-        kdot=strindex(tk,[".*","./",".\",".^",".''"])
-        if kdot<>[] then
-            kdgt=kdot(find(abs(_str2code(part(tk,kdot-1)))<9))
-            for kk=size(kdgt,"*"):-1:1
-                tk=part(tk,1:kdgt(kk)-1)+" "+part(tk,kdgt(kk):length(tk));
-            end
-        end
-
         // Modify struct like x.(fieldname) which become x(fieldname)
         tk=strsubst(tk,".(","(")
 
index da81ad2..e247d5d 100644 (file)
@@ -58,7 +58,6 @@ msgstr ""
 #
 # File: sci_gateway/c/sci_convstr.c, line: 103
 # File: sci_gateway/c/sci_convstr.c, line: 109
-# File: sci_gateway/c/sci_str2code.c, line: 90
 # File: sci_gateway/c/sci_strchr.c, line: 92
 # File: sci_gateway/c/sci_strcmp.c, line: 126
 # File: sci_gateway/c/sci_strcmp.c, line: 130
@@ -94,7 +93,6 @@ msgstr "%s: 出力引数で不正な数: %d を想定します。\n"
 #
 # File: sci_gateway/c/sci_convstr.c, line: 103
 # File: sci_gateway/c/sci_convstr.c, line: 109
-# File: sci_gateway/c/sci_str2code.c, line: 90
 # File: sci_gateway/c/sci_strchr.c, line: 92
 # File: sci_gateway/c/sci_strcmp.c, line: 126
 # File: sci_gateway/c/sci_strcmp.c, line: 130
@@ -144,7 +142,6 @@ msgstr "%s: 入力引数 #%d で不正な値: 空でない文字列を想定し
 # File: sci_gateway/c/sci_isascii.c, line: 102
 # File: sci_gateway/c/sci_part.c, line: 117
 # File: sci_gateway/c/sci_regexp.c, line: 168
-# File: sci_gateway/c/sci_str2code.c, line: 84
 # File: sci_gateway/c/sci_strcat.c, line: 128
 # File: sci_gateway/c/sci_strcat.c, line: 142
 # File: sci_gateway/c/sci_strcat.c, line: 150
index 5736083..96d0afd 100644 (file)
@@ -56,7 +56,6 @@ msgstr ""
 # File: sci_gateway/c/sci_strcmp.c, line: 127
 # File: sci_gateway/c/sci_strcmp.c, line: 131
 # File: sci_gateway/c/sci_strsplit.c, line: 205
-# File: sci_gateway/c/sci_str2code.c, line: 91
 # File: sci_gateway/c/sci_strrev.c, line: 62
 # File: sci_gateway/c/sci_strrchr.c, line: 94
 # File: sci_gateway/c/sci_strspn.c, line: 83
@@ -90,7 +89,6 @@ msgstr "%s: 輸出參數之數目錯誤: 應為 %d.\n"
 # File: sci_gateway/c/sci_strcmp.c, line: 127
 # File: sci_gateway/c/sci_strcmp.c, line: 131
 # File: sci_gateway/c/sci_strsplit.c, line: 205
-# File: sci_gateway/c/sci_str2code.c, line: 91
 # File: sci_gateway/c/sci_strrev.c, line: 62
 # File: sci_gateway/c/sci_strrchr.c, line: 94
 # File: sci_gateway/c/sci_strspn.c, line: 83
@@ -146,7 +144,6 @@ msgstr "%s: Wrong values for input argument #%d: 應為非空字串.\n"
 # File: sci_gateway/c/sci_strtod.c, line: 61
 # File: sci_gateway/c/sci_strtod.c, line: 78
 # File: sci_gateway/c/sci_isascii.c, line: 103
-# File: sci_gateway/c/sci_str2code.c, line: 85
 # File: sci_gateway/c/sci_code2str.c, line: 60
 # File: sci_gateway/c/sci_code2str.c, line: 74
 # File: sci_gateway/c/sci_strrev.c, line: 56
index 4930929..252a26c 100644 (file)
@@ -43,7 +43,6 @@
     <PRIMITIVE gatewayId="21" primitiveId="3" primitiveName="string" />
     <PRIMITIVE gatewayId="21" primitiveId="4" primitiveName="convstr" />
     <PRIMITIVE gatewayId="21" primitiveId="5" primitiveName="emptystr" />
-    <PRIMITIVE gatewayId="21" primitiveId="6" primitiveName="str2code" />
     <PRIMITIVE gatewayId="21" primitiveId="7" primitiveName="code2str" />
     <PRIMITIVE gatewayId="21" primitiveId="8" primitiveName="strcat" />
     <PRIMITIVE gatewayId="21" primitiveId="9" primitiveName="strindex" />
@@ -68,7 +67,6 @@
     <PRIMITIVE gatewayId="21" primitiveId="28" primitiveName="strspn" />
     <PRIMITIVE gatewayId="21" primitiveId="29" primitiveName="strtod" />
     <PRIMITIVE gatewayId="21" primitiveId="30" primitiveName="regexp" />
-    <PRIMITIVE gatewayId="21" primitiveId="31" primitiveName="_str2code" />
     <PRIMITIVE gatewayId="21" primitiveId="32" primitiveName="_code2str" />
     <PRIMITIVE gatewayId="21" primitiveId="33" primitiveName="isnum" />
     <PRIMITIVE gatewayId="21" primitiveId="34" primitiveName="csvIsnum" />