feat(cpp): better locations after blocks end

This commit is contained in:
Simon Cruanes 2022-02-17 10:16:11 -05:00
parent 10286098c4
commit 4934b302c6
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -74,7 +74,7 @@ let preproc_lines ~file ~major ~minor (ic:in_channel) : unit =
| Eof -> fail "unexpected EOF"
| If _ -> fail "nested if not supported"
| Raw s -> print_endline s; cat_block()
| Endif -> top()
| Endif -> pp_pos(); top()
| Elseif _ | Else -> skip_block ~elseok:false ()
(* skip current block.
@ -84,7 +84,7 @@ let preproc_lines ~file ~major ~minor (ic:in_channel) : unit =
| Eof -> fail "unexpected EOF"
| If _ -> fail "nested if not supported"
| Raw _ -> skip_block ~elseok ()
| Endif -> top()
| Endif -> pp_pos(); top()
| Elseif (op,i,j) ->
if elseok && eval ~major ~minor op i j then (
pp_pos();