Commit a10eaa7f authored by POTTIER Francois's avatar POTTIER Francois

Use [Misc.map_opt].

parent f41722b7
......@@ -425,15 +425,15 @@ let unthingify_parameter rules thing =
match thing with
| TargetParameterOfSortStar param ->
(* This parameter has sort [star]. Keep it. *)
[ param ]
Some param
| SourceParameterOfHigherSort param ->
(* This parameter has higher sort. It must be a symbol.
Keep it if it still appears in the expanded grammar. *)
let symbol = value (Parameters.unvar param) in
if StringMap.mem symbol rules then [ param ] else []
if StringMap.mem symbol rules then Some param else None
let unthingify_attribute_declaration rules (params, attrs) =
(List.concat ( (unthingify_parameter rules) params), attrs)
(Misc.map_opt (unthingify_parameter rules) params, attrs)
let unthingify_attribute_declarations rules decls = (unthingify_attribute_declaration rules) decls
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment