lib/ruote/exp/fe_cursor.rb
# Jumps to an integer position, or the name of an expression
# or a tag name of a ref name.
#
Jumps to an integer position, or the name of an expression
or a tag name of a ref name.
Jumps to an integer position or the name of an expression or a tag name of a ref name .
def jump_to(workitem, position, arg)
      pos = Integer(arg) rescue nil
      return pos if pos != nil
      tree_children.each_with_index do |c, i|
        found = [
          c[0],                                      
          c[1]['ref'],                               
          c[1]['tag'],                               
          (c[1].find { |k, v| v.nil? } || []).first  
        ].find do |v|
          v ? (dsub(v, workitem) == arg) : false
        end
        if found then pos = i; break; end
      end
      pos ? pos : position
    end
def jump_to ( workitem , position , arg ) pos = Integer ( arg ) rescue nil return pos if pos != nil tree_children . each_with_index do | c , i | found = [ c [ 0 ] , c [ 1 ] [ 'ref' ] , c [ 1 ] [ 'tag' ] , ( c [ 1 ] . find { | k , v | v . nil? } || [ ] ) . first ] . find do | v | v ? ( dsub ( v , workitem ) == arg ) : false end if found then pos = i ; break ; end end pos ? pos : position end
Jumps to an integer position, or the name of an expression
or a tag name of a ref name.
Jumps to an integer position or the name of an expression or a tag name of a ref name .
# exp_name # ref # tag # participant 'xxx'
workitem
position
arg