@@ -70,7 +70,7 @@ func (c *converter) ProgramEnd() error {
7070 "local _l=$(_slh ${2})" ,
7171 "local _n=$(eval \" echo \\ ${${1}}\" )" ,
7272 "while [ ${_i} -lt ${_l} ]; do" ,
73- fmt .Sprintf ("local _v=%s" , c .sliceEvaluationString ("${2}" , "${_i}" , false )),
73+ fmt .Sprintf ("local _v=%s" , c .sliceEvaluationString ("${2}" , "${_i}" )),
7474 c .sliceAssignmentString ("${_n}" , "${_i}" , "${_v}" , false ),
7575 "_i=$(expr ${_i} + 1)" ,
7676 "done" ,
@@ -373,36 +373,35 @@ func (c *converter) SliceInstantiation(values []string, valueUsed bool) (string,
373373 return helper , nil
374374}
375375
376- func (c * converter ) SliceEvaluation (name string , index string , valueUsed bool , global bool ) (string , error ) {
376+ func (c * converter ) SliceEvaluation (name string , index string , valueUsed bool ) (string , error ) {
377377 helper := c .nextHelperVar ()
378378 c .VarAssignment (
379379 helper ,
380- c .sliceEvaluationString (name , index , global ),
380+ c .sliceEvaluationString (name , index ),
381381 false ,
382382 )
383383 return c .VarEvaluation (helper , valueUsed , false )
384384}
385385
386- func (c * converter ) SliceLen (name string , valueUsed bool , global bool ) (string , error ) {
386+ func (c * converter ) SliceLen (name string , valueUsed bool ) (string , error ) {
387387 helper := c .nextHelperVar ()
388388 c .sliceLenHelperRequired = true
389- // TODO: Is global flag even required here? Because value is already passed to function.
389+
390390 c .VarAssignment (helper , c .sliceLenString (name ), false )
391391
392392 return c .VarEvaluation (helper , valueUsed , false )
393393}
394394
395- func (c * converter ) StringSubscript (value string , index string , valueUsed bool , global bool ) (string , error ) {
395+ func (c * converter ) StringSubscript (value string , index string , valueUsed bool ) (string , error ) {
396396 helper := c .nextHelperVar ()
397397
398- // TODO: Is global flag even required here? Because value is already passed to function.
399398 c .VarAssignment (helper , fmt .Sprintf ("$(_ssh %s %s)" , value , index ), false ) // https://www.baeldung.com/linux/bash-substring#1-using-thecut-command
400399 c .stringSubscriptHelperRequired = true
401400
402401 return c .varEvaluationString (helper , false ), nil
403402}
404403
405- func (c * converter ) StringLen (value string , valueUsed bool , global bool ) (string , error ) {
404+ func (c * converter ) StringLen (value string , valueUsed bool ) (string , error ) {
406405 helper := c .nextHelperVar ()
407406
408407 c .VarAssignment (helper , value , false )
@@ -510,13 +509,13 @@ func (c *converter) varEvaluationString(name string, global bool) string {
510509}
511510
512511func (c * converter ) sliceAssignmentString (name string , index string , value string , global bool ) string {
513- // TODO: Is global flag even required here? Because value is already passed to function.
512+
514513 return fmt .Sprintf ("eval %s_%s=\" %s\" " , name , index , value )
515514}
516515
517- func (c * converter ) sliceEvaluationString (name string , index string , global bool ) string {
516+ func (c * converter ) sliceEvaluationString (name string , index string ) string {
518517 return fmt .Sprintf ("$(eval \" echo \\ ${%s_%s}\" )" ,
519- name , // TODO: Is global flag even required here? Because value is already passed to function.
518+ name ,
520519 index ,
521520 )
522521}
0 commit comments