Skip to content

Commit

Permalink
[ocaml][flightplan] No lexer when variable does not contain ocml func…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
dewagter committed Sep 8, 2014
1 parent 48fd4b2 commit a17422a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sw/lib/ocaml/fp_proc.ml
Expand Up @@ -43,7 +43,7 @@ let parse_expression = fun s ->
s (Lexing.lexeme_char lexbuf 0);
exit 1
| Parsing.Parse_error ->
fprintf stderr "Parsing error in '%s', token '%s' ?\n"
fprintf stderr "Procedure Parsing error in '%s', token '%s' ?\n"
s (Lexing.lexeme lexbuf);
exit 1

Expand All @@ -70,11 +70,10 @@ let transform_expression = fun env e ->
let transform_values = fun attribs_not_modified env attribs ->
List.map
(fun (a, v) ->
let e = parse_expression v in
let v' =
if List.mem (String.lowercase a) attribs_not_modified
then v
else transform_expression env e in
else transform_expression env (parse_expression v) in
(a, v'))
attribs

Expand Down Expand Up @@ -145,7 +144,7 @@ let transform_stage = fun prefix reroutes env xml ->
let attribs = transform_values ["wp"; "vmode"] env attribs in
Xml.Element (tag, attribs, children)
| "call" | "set" ->
let attribs = transform_values [] env attribs in
let attribs = transform_values ["var"] env attribs in
Xml.Element (tag, attribs, children)
| _ -> failwith (sprintf "Fp_proc: Unexpected tag: '%s'" tag)
end
Expand Down

0 comments on commit a17422a

Please sign in to comment.