From e49f9de0ae3883b7dc1f3905972f98a44417bf8f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] Remove bogus '() with' (thanks Bluestorm). --- extract/codegen/kerneldb_to_parser.ml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/extract/codegen/kerneldb_to_parser.ml b/extract/codegen/kerneldb_to_parser.ml index 4bda418..f94de2f 100644 --- a/extract/codegen/kerneldb_to_parser.ml +++ b/extract/codegen/kerneldb_to_parser.ml @@ -99,10 +99,12 @@ let (//) = Filename.concat * 'concat_record_fields' concatenates a list of records fields into * a record. The list must have at least one element. * + * 'build_record' builds a record out of record fields. + * * 'build_tuple_from_exprs' builds an arbitrary length tuple from * a list of expressions of length >= 2. * - * Thanks to bluestorm on #ocaml for getting the last one working. + * Thanks to bluestorm on #ocaml for getting these working. *) let concat_str_items _loc items = match items with @@ -128,6 +130,9 @@ let concat_record_bindings _loc rbs = | rb :: rbs -> List.fold_left (fun rbs rb -> <:rec_binding< $rbs$ ; $rb$ >>) rb rbs +let build_record _loc rbs = + Ast.ExRec (_loc, rbs, Ast.ExNil _loc) + let build_tuple_from_exprs _loc exprs = match exprs with | [] | [_] -> assert false @@ -737,8 +742,9 @@ Example (from toplevel of virt-mem source tree): let fieldsigs = fields @ fields_not_present in let fsname = sprintf "fieldsig_%d" i in let fieldsigs = concat_record_bindings _loc fieldsigs in + let fieldsigs = build_record _loc fieldsigs in <:str_item< - let $lid:fsname$ = { () with $fieldsigs$ } + let $lid:fsname$ = $fieldsigs$ >> ) parsers in -- 1.8.3.1