@@ -659,9 +659,8 @@ and hash = parse
659659 E. warn "Bad line number in preprocessed file: %s" s ;
660660 (-1)
661661 in
662- E. setCurrentLine (lineno - 1);
663662 (* A file name may follow *)
664- file lexbuf }
663+ file (lineno - 1) lexbuf }
665664| "line" { addWhite lexbuf; hash lexbuf } (* MSVC line number info *)
666665 (* For pragmas with irregular syntax, like #pragma warning,
667666 * we parse them as a whole line. *)
@@ -672,15 +671,15 @@ and hash = parse
672671| "pragma" { pragmaLine := true; PRAGMA (currentLoc ()) }
673672| _ { addWhite lexbuf; endline lexbuf}
674673
675- and file = parse
676- '\n' {addWhite lexbuf; E. newline (); initial lexbuf}
677- | blank {addWhite lexbuf; file lexbuf}
674+ and file lineno = parse
675+ '\n' {addWhite lexbuf; E. setCurrent ~file:None ~line:lineno; E. newline (); initial lexbuf}
676+ | blank {addWhite lexbuf; file lineno lexbuf}
678677| '"' ([^ '\012' '\t' '"' ]* as filename ) '"' ((' ' ['1' -'4' ])* as flags )
679678 { addWhite lexbuf; (* '"' *)
680- E. setCurrentFile filename ( String. contains flags '3');
679+ E. setCurrent ~file:(Some (filename, String. contains flags '3')) ~line:lineno ;
681680 endline lexbuf}
682681
683- | _ {addWhite lexbuf; endline lexbuf}
682+ | _ {addWhite lexbuf; E. setCurrent ~file:None ~line:lineno; endline lexbuf}
684683
685684and endline = parse
686685 '\n' { addWhite lexbuf; E. newline (); initial lexbuf}
0 commit comments