perm filename EEDIT4.2[EAL,HE] blob sn#704723 filedate 1983-04-04 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00003 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	{$NOMAIN	Editor: Part of editStmnt }
C00003 00003	procedure eEditOther (n: nodep l,indent,e0,elen: integer 
C00007 ENDMK
C⊗;
{$NOMAIN	Editor: Part of editStmnt }

%include eedit.hdr;

{ Externally defined routines from elsewhere: }

	(* From EEXPED *)
function exprEditor(line,lstart,llength,estart: integer;
	var elength: integer; off: integer): ascii;		external;

	(* From EPAR3B *)
procedure clabelParse(n: nodep);				external;

	(* From EPAR3C *)
function procParse(n: nodep; indent,l: integer): ascii;		external;

	(* From EPAR3E *)
procedure mClauseParse(n: nodep);				external;

	(* From EEDITS *)
procedure echarDo (echar: ascii; var again: boolean);		external;

procedure eEditOther (n: nodep; l,indent,e0,elen: integer; 
	var echar: ascii; var again: boolean); external;
procedure eEditOther;
 var nv: nodep; b: boolean; i: integer;

 procedure goEd;
  begin
  with lines[l]↑ do			(* go edit it *)
   echar := exprEditor(l-firstDline+1,start,length,e0,elen,0);
  end;

 begin
 with n↑ do
  if ntype = procdefnode then
    begin
    (* *** check that procedure is not currently active ??? *** *)
    echar := procParse(n,indent,l);
    end
   else if ntype = clistnode then
    begin					(* edit the label *)
    e0 := indent + 1;
    with lines[l]↑ do
     begin					(* go edit it *)
     elen := length - e0 + 1;
     end;
    goEd;
    clabelParse(n);
    end
   else if ((ntype = viaptnode) or (ntype = byptnode)) and
	   (fieldNum > 1) then
    begin					(* WHERE clause in VIA/BY *)
    e0 := 8 + indent;
    with lines[l]↑ do
     begin					(* go edit it *)
     elen := length - e0 + 1;
     if listing[start+length-1] = ';' then elen := elen - 1;
     end;
    goEd;
    nv := n;
    b := true;
    while b and (nv↑.next <> nil) do		(* find last VIA/BY in list *)
     with nv↑.next↑ do
      if (ntype = nv↑.ntype) and vlist then nv := nv↑.next else b := false;
    nv := nv↑.vclauses;
    for i := 3 to fieldNum do nv := nv↑.next;	(* find WHERE clause *)
    mClauseParse(nv);
    end
   else if (cursorStack[cursor].cline < cursorLine) and
	   (fieldNum = 1) then echar := chr(15B)  (* just skip past THEN *)
   else
    begin					(* a motion clause *)
    case ntype of
destnode,
byptnode:	e0 := 3;
viaptnode:	e0 := 4;
cwnode:		e0 := 0;
commentnode:	e0 := 0;	(* *** should be a little smarter here *** *)
otherwise	e0 := 5;			(* a WITH clause *)
     end;
    e0 := e0 + indent;
    with lines[l]↑ do
     begin					(* go edit it *)
     elen := length - e0 + 1;
     if listing[start+length-1] = ';' then elen := elen - 1;
     end;
    goEd;
    mClauseParse(n);
    end;
 echarDo(echar,again);
 end;