From b960c83725d7e185ac5c6e3c0d6043c7dcd2f556 Mon Sep 17 00:00:00 2001 From: Jacques-Henri Jourdan Date: Sun, 1 Nov 2015 22:32:23 +0100 Subject: Better handling of old-style K&R function declarations: - Added a Cabs.PROTO_OLD constructor to Cabs.decl_type - Refactored the Parser.vy and pre_parser.mly grammars - Rewritten the conversion of old function definitions to new-style --- cparser/Cabshelper.ml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'cparser/Cabshelper.ml') diff --git a/cparser/Cabshelper.ml b/cparser/Cabshelper.ml index 5e6a19d0..b3782ba8 100644 --- a/cparser/Cabshelper.ml +++ b/cparser/Cabshelper.ml @@ -46,8 +46,7 @@ let rec isTypedef = function let get_definitionloc (d : definition) : cabsloc = match d with - | FUNDEF(_, _, _, l) -> l - | KRFUNDEF(_, _, _, _, _, l) -> l + | FUNDEF(_, _, _, _, l) -> l | DECDEF(_, l) -> l | PRAGMA(_, l) -> l @@ -78,10 +77,3 @@ let string_of_cabsloc l = let format_cabsloc pp l = Format.fprintf pp "%s:%d" l.filename l.lineno - -let rec append_decltype dt1 dt2 = - match dt1 with - | JUSTBASE -> dt2 - | ARRAY(dt, attr, sz) -> ARRAY(append_decltype dt dt2, attr, sz) - | PTR(attr, dt) -> PTR(attr, append_decltype dt dt2) - | PROTO(dt, params) -> PROTO(append_decltype dt dt2, params) -- cgit