Project

General

Profile

« Previous | Next » 

Revision 3b2bd83d

Added by Teme Kahsai about 8 years ago

updating to onera version 30f766a:2016-12-04

View differences:

src/location.ml
34 34
    Lexing.pos_bol = 0;
35 35
    Lexing.pos_cnum = 0;
36 36
  }
37
      
37

  
38
let shift_pos pos1 pos2 =
39
  assert (pos1.Lexing.pos_fname = pos2.Lexing.pos_fname);
40
  {Lexing.pos_fname = pos1.Lexing.pos_fname;
41
    Lexing.pos_lnum = pos1.Lexing.pos_lnum + pos2.Lexing.pos_lnum;
42
    Lexing.pos_bol = pos1.Lexing.pos_bol + pos2.Lexing.pos_bol;
43
    Lexing.pos_cnum =if pos2.Lexing.pos_lnum = 1 then pos1.Lexing.pos_cnum + pos2.Lexing.pos_cnum else pos2.Lexing.pos_cnum
44
  }
45

  
46
let shift loc1 loc2 =
47
  {loc_start = shift_pos loc1.loc_start loc2.loc_start;
48
    loc_end  = shift_pos loc1.loc_start loc2.loc_end
49
  }
50
    
38 51
let symbol_rloc () = 
39 52
  {
40 53
    loc_start = Parsing.symbol_start_pos ();

Also available in: Unified diff