Skip to content

Commit

Permalink
[flight plans] require deroute for exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr authored and fvantienen committed Sep 13, 2015
1 parent f0bc865 commit 1a75358
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions sw/tools/generators/gen_flight_plan.ml
Expand Up @@ -158,13 +158,16 @@ let get_index_block = fun x ->

let print_exception = fun x ->
let c = parsed_attrib x "cond" in
begin
try
let i = get_index_block (ExtXml.attrib x "deroute") in
lprintf "if ((nav_block != %d) && %s) { GotoBlock(%d); return; }\n" i c i
with
ExtXml.Error _ ->
let f = ExtXml.attrib x "exec" in
lprintf "if (%s) { %s; return; }\n" c f
lprintf "if (%s) { %s; }\n" c f
with
ExtXml.Error _ -> ()
end;
let i = get_index_block (ExtXml.attrib x "deroute") in
lprintf "if ((nav_block != %d) && %s) { GotoBlock(%d); return; }\n" i c i


let element = fun a b c -> Xml.Element (a, b, c)
let goto l = element "goto" ["name",l] []
Expand Down

0 comments on commit 1a75358

Please sign in to comment.