Commit 40b38929 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Removed [Action.parenthesize] and [Action.parenthesize_stretch].

Every semantic action stretch was already parenthesized by the lexer,
so this led only to redundant parentheses.
parent 20e29e92
......@@ -21,7 +21,7 @@ list___anonymous_1_:
{let x =
let y = y0 in
let x = x0 in
( ( x + y ))
( x + y )
in
( x :: xs )}
......@@ -31,19 +31,19 @@ list___anonymous_0_:
| x0 = A xs = list___anonymous_0_
{let x =
let x = x0 in
( ( x ))
( x )
in
( x :: xs )}
| x0 = B xs = list___anonymous_0_
{let x =
let x = x0 in
( ( x ))
( x )
in
( x :: xs )}
| x0 = C xs = list___anonymous_0_
{let x =
let x = x0 in
( ( x ))
( x )
in
( x :: xs )}
......
......@@ -20,7 +20,7 @@ clauses:
| xs0 = loption_separated_nonempty_list_DOT_clause__ _2 = EOF
{let clauses =
let xs = xs0 in
( ( xs ))
( xs )
in
( clauses )}
......@@ -41,9 +41,9 @@ params:
let _1 = _10 in
let x =
let xs = xs0 in
( ( xs ))
( xs )
in
( ( x ))
( x )
in
( terms )}
......@@ -81,7 +81,7 @@ clause:
| tm = term _2 = INFERS xs0 = loption_separated_nonempty_list_COMMA_term__
{let ts =
let xs = xs0 in
( ( xs ))
( xs )
in
( (tm, ts) )}
| fact = term
......
......@@ -29,9 +29,9 @@ expr:
let _10 = _100 in
let x =
let _1 = _10 in
( ( (+) ))
( (+) )
in
( ( x ))
( x )
in
( op e1 e2 )}
| e1 = expr _100 = MINUS e2 = expr
......@@ -39,9 +39,9 @@ in
let _10 = _100 in
let x =
let _1 = _10 in
( ( (-) ))
( (-) )
in
( ( x ))
( x )
in
( op e1 e2 )}
| e1 = expr _100 = TIMES e2 = expr
......@@ -49,9 +49,9 @@ in
let _10 = _100 in
let x =
let _1 = _10 in
( ( ( * ) ))
( ( * ) )
in
( ( x ))
( x )
in
( op e1 e2 )}
| e1 = expr _100 = DIV e2 = expr
......@@ -59,9 +59,9 @@ in
let _10 = _100 in
let x =
let _1 = _10 in
( ( (/) ))
( (/) )
in
( ( x ))
( x )
in
( op e1 e2 )}
| _1 = MINUS e = expr %prec UMINUS
......
......@@ -137,7 +137,7 @@ definitiveIdentifier:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -172,7 +172,7 @@ tagDefault:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -181,7 +181,7 @@ extensionDefault:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -190,7 +190,7 @@ moduleBody:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -201,7 +201,7 @@ exports:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -210,7 +210,7 @@ symbolsExported:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -219,7 +219,7 @@ imports:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -228,7 +228,7 @@ symbolsImported:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -253,7 +253,7 @@ assignedIdentifier:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -568,14 +568,14 @@ optionalExtensionMarker:
{ ()}
|
{let _1 =
( ())
()
in
()}
versionNumber:
|
{let _1 =
( ())
()
in
()}
| _1 = Number _2 = Colon
......@@ -796,7 +796,7 @@ extensionAdditionAlternatives:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -841,7 +841,7 @@ class_x:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -878,7 +878,7 @@ extensionAdditions:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -1173,7 +1173,7 @@ valueConstraint:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -1340,7 +1340,7 @@ exceptionSpec:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -1417,7 +1417,7 @@ includes:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -1466,7 +1466,7 @@ presenceConstraint:
{ ()}
|
{let _1 =
( ())
()
in
()}
......@@ -1614,7 +1614,7 @@ defaultSyntax:
| _1 = LeftBrace xs0 = loption_separated_nonempty_list_Comma_fieldSetting__ _3 = RightBrace
{let _2 =
let xs = xs0 in
( ( xs ))
( xs )
in
()}
......@@ -1740,7 +1740,7 @@ userDefinedConstraint:
| _1 = CONSTRAINED _2 = BY _3 = LeftBrace xs0 = loption_separated_nonempty_list_Comma_userDefinedConstraintParameter__ _5 = RightBrace
{let _4 =
let xs = xs0 in
( ( xs ))
( xs )
in
()}
......@@ -1783,7 +1783,7 @@ level:
{ ()}
|
{let _1 =
( ())
()
in
()}
......
......@@ -246,7 +246,7 @@ list_pair_edots_when_TEllipsis_eexpr__dexpr__:
{let x =
let y = y0 in
let x = x0 in
( ( (x, y) ))
( (x, y) )
in
( x :: xs )}
......@@ -257,7 +257,7 @@ list_pair_dots_when_TEllipsis_pre_post_decl_statement_or_expression_rule_elem_st
{let x =
let y = y0 in
let x = x0 in
( ( (x, y) ))
( (x, y) )
in
( x :: xs )}
......@@ -315,9 +315,9 @@ metadec:
| ar = arity ispure = pure _10 = TIdentifier ids = comma_list_pure_ident_or_meta_ident_ _5 = TMPtVirg
{let kindfn =
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaIdDecl(arity,name)) in
!Data.add_id_meta name pure; tok) ))
!Data.add_id_meta name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -335,9 +335,9 @@ in
{let kindfn =
let _2 = _20 in
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaFreshIdDecl(arity,name)) in
!Data.add_id_meta name pure; tok) ))
!Data.add_id_meta name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -354,9 +354,9 @@ in
| ar = arity ispure = pure _10 = TType ids = comma_list_pure_ident_or_meta_ident_ _5 = TMPtVirg
{let kindfn =
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaTypeDecl(arity,name)) in
!Data.add_type_meta name pure; tok) ))
!Data.add_type_meta name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -373,9 +373,9 @@ in
| ar = arity ispure = pure _10 = TParameter ids = comma_list_pure_ident_or_meta_ident_ _5 = TMPtVirg
{let kindfn =
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaParamDecl(arity,name)) in
!Data.add_param_meta name pure; tok) ))
!Data.add_param_meta name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -393,9 +393,9 @@ in
{let kindfn =
let _2 = _20 in
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaParamListDecl(arity,name)) in
!Data.add_paramlist_meta name pure; tok)))
!Data.add_paramlist_meta name pure; tok))
in
( function current_rule ->
List.concat
......@@ -412,9 +412,9 @@ in
| ar = arity ispure = pure _10 = TError ids = comma_list_pure_ident_or_meta_ident_ _5 = TMPtVirg
{let kindfn =
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaErrDecl(arity,name)) in
!Data.add_err_meta name pure; tok) ))
!Data.add_err_meta name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -431,9 +431,9 @@ in
| ar = arity ispure = pure _10 = TExpression ids = comma_list_pure_ident_or_meta_ident_ _5 = TMPtVirg
{let kindfn =
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaExpDecl(arity,name,None)) in
!Data.add_exp_meta None name pure; tok) ))
!Data.add_exp_meta None name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -451,9 +451,9 @@ in
{let kindfn =
let _2 = _20 in
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaExpListDecl(arity,name)) in
!Data.add_explist_meta name pure; tok) ))
!Data.add_explist_meta name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -471,10 +471,10 @@ in
{let kindfn =
let m = m0 in
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let ty = Some [P.ty_pointerify Type_cocci.Unknown m] in
let tok = check_meta(Ast.MetaExpDecl(arity,name,ty)) in
!Data.add_exp_meta ty name pure; tok) ))
!Data.add_exp_meta ty name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -491,9 +491,9 @@ in
| ar = arity ispure = pure _10 = TStatement ids = comma_list_pure_ident_or_meta_ident_ _5 = TMPtVirg
{let kindfn =
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaStmDecl(arity,name)) in
!Data.add_stm_meta name pure; tok) ))
!Data.add_stm_meta name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -511,9 +511,9 @@ in
{let kindfn =
let _2 = _20 in
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaStmListDecl(arity,name)) in
!Data.add_stmlist_meta name pure; tok) ))
!Data.add_stmlist_meta name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -530,9 +530,9 @@ in
| ar = arity ispure = pure _10 = TFunction ids = comma_list_pure_ident_or_meta_ident_ _5 = TMPtVirg
{let kindfn =
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaFuncDecl(arity,name)) in
!Data.add_func_meta name pure; tok) ))
!Data.add_func_meta name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -550,10 +550,10 @@ in
{let kindfn =
let _2 = _20 in
let _1 = _10 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaLocalFuncDecl(arity,name)) in
!Data.add_local_func_meta name pure;
tok) ))
tok) )
in
( function current_rule ->
List.concat
......@@ -570,10 +570,10 @@ in
| ar = arity ispure = pure vl0 = meta_exp_type ids = comma_list_pure_ident_or_meta_ident_ _5 = TMPtVirg
{let kindfn =
let vl = vl0 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let ty = Some vl in
let tok = check_meta(Ast.MetaExpDecl(arity,name,ty)) in
!Data.add_exp_meta ty name pure; tok) ))
!Data.add_exp_meta ty name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -592,10 +592,10 @@ in
let _3 = _30 in
let _2 = _20 in
let vl = vl0 in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let ty = Some (List.map (function x -> Type_cocci.Array x) vl) in
let tok = check_meta(Ast.MetaExpDecl(arity,name,ty)) in
!Data.add_exp_meta ty name pure; tok) ))
!Data.add_exp_meta ty name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -613,11 +613,11 @@ in
{let kindfn =
let _1 = _10 in
let ty =
( ( None ))
( None )
in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaConstDecl(arity,name,ty)) in
!Data.add_const_meta ty name pure; tok) ))
!Data.add_const_meta ty name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -637,11 +637,11 @@ in
let _1 = _10 in
let ty =
let x = x0 in
( ( Some x ))
( Some x )
in
( ( (fun arity name pure check_meta ->
( (fun arity name pure check_meta ->
let tok = check_meta(Ast.MetaConstDecl(arity,name,ty)) in
!Data.add_const_meta ty name pure; tok) ))
!Data.add_const_meta ty name pure; tok) )
in
( function current_rule ->
List.concat
......@@ -658,10 +658,10 @@ in
| ar = arity ispure = pure _10 = TTypedef ids = comma_list_pure_ident_or_meta_ident_ _5 = TMPtVirg
{let kindfn =
let _1 = _10 in
( ( (fun arity (_,name) pure check_meta ->
( (fun arity (_,name) pure check_meta ->
if arity = Ast.NONE && pure = Ast0.Impure
then (!Data.add_type_name name; [])
else raise (Semantic_cocci.Semantic "bad typedef")) ))
else raise (Semantic_cocci.Semantic "bad typedef")) )
in
( function current_rule ->
List.concat
......@@ -678,10 +678,10 @@ in
| ar = arity ispure = pure _10 = TDeclarer ids = comma_list_pure_ident_or_meta_ident_ _5 = TMPtVirg
{let kindfn =
let _1 = _10 in
( ( (fun arity (_,name) pure check_meta ->
( (fun arity (_,name) pure check_meta ->
if arity = Ast.NONE && pure = Ast0.Impure
then (!Data.add_declarer_name name; [])
else raise (Semantic_cocci.Semantic "bad declarer")) ))
else raise (Semantic_cocci.Semantic "bad declarer")) )
in
( function current_rule ->
List.concat
......@@ -718,7 +718,7 @@ struct_decl:
Ast0.wrap(Ast0.UnInit(None,fn t,id,P.clt2mcode ";" pv)) )}
| i = pure_ident d = d_ident pv = TPtVirg
{let cv =
( ( None ))
( None )
in
( let (id,fn) = d in
let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
......@@ -726,7 +726,7 @@ in
| x0 = const_vol i = pure_ident d = d_ident pv = TPtVirg
{let cv =
let x = x0 in
( ( Some x ))
( Some x )
in
( let (id,fn) = d in
let idtype = P.make_cv cv (Ast0.wrap (Ast0.TypeName(P.id2mcode i))) in
......@@ -887,7 +887,7 @@ pure:
rule_name:
| nm = pure_ident _2 = extends d = depends _5 = TArob
{let i =
( ( None ))
( None )
in
( let n = P.id2name nm in
(try let _ = Hashtbl.find Data.all_metadecls n in
......@@ -897,7 +897,7 @@ in
| nm = pure_ident _2 = extends d = depends x0 = choose_iso _5 = TArob
{let i =
let x = x0 in
( ( Some x ))
( Some x )
in
( let n = P.id2name nm in
(try let _ = Hashtbl.find Data.all_metadecls n in
......@@ -942,35 +942,35 @@ generic_ctype:
{ ( Ast0.wrap(Ast0.ImplicitInt(q)) )}
| ty = Tchar
{let q =
( ( None ))
( None )
in
( Ast0.wrap(Ast0.BaseType(P.clt2mcode Ast.CharType ty, q)) )}
| x0 = ctype_qualif ty = Tchar
{let q =
let x = x0 in
( ( Some x ))
( Some x )
in
( Ast0.wrap(Ast0.BaseType(P.clt2mcode Ast.CharType ty, q)) )}
| ty = Tshort
{let q =
( ( None ))
( None )
in
( Ast0.wrap(Ast0.BaseType(P.clt2mcode Ast.ShortType ty, q)) )}
| x0 = ctype_qualif ty = Tshort
{let q =
let x = x0 in
( ( Some x ))
( Some x )
in
( Ast0.wrap(Ast0.BaseType(P.clt2mcode Ast.ShortType ty, q)) )}
| ty = Tint
{let q =
( ( None ))
( None )
in
( Ast0.wrap(Ast0.BaseType(P.clt2mcode Ast.IntType ty, q)) )}
| x0 = ctype_qualif ty = Tint
{let q =
let x = x0 in
( ( Some x ))
( Some x )
in
( Ast0.wrap(Ast0.BaseType(P.clt2mcode Ast.IntType ty, q)) )}
| t = Tdouble
......@@ -979,13 +979,13 @@ in
{ ( Ast0.wrap(Ast0.BaseType(P.clt2mcode Ast.FloatType t, None)) )}
| ty = Tlong
{let q =
( ( None ))
( None )
in
( Ast0.wrap(Ast0.BaseType(P.clt2mcode Ast.LongType ty, q)) )}
| x0 = ctype_qualif ty = Tlong
{let q =
let x = x0 in
( ( Some x ))
( Some x )
in
( Ast0.wrap(Ast0.BaseType(P.clt2mcode Ast.LongType ty, q)) )}
| s = struct_or_union i = ident
......@@ -1023,18 +1023,18 @@ continue_struct_decl_list:
ctype:
| ty = generic_ctype m = list_TMul_
{let cv =
( ( None ))
( None )
in
( P.pointerify (P.make_cv cv ty) m )}
| x0 = const_vol ty = generic_ctype m = list_TMul_
{let cv =
let x = x0 in
( ( Some x ))
( Some x )
in
( P.pointerify (P.make_cv cv ty) m )}
| t = Tvoid m = nonempty_list_TMul_
{let cv =
( ( None ))
( None )
in
( let ty =
Ast0.wrap(Ast0.BaseType(P.clt2mcode Ast.VoidType t, None)) in
......@@ -1042,7 +1042,7 @@ in
| x0 = const_vol t = Tvoid m = nonempty_list_TMul_
{let cv =
let x = x0 in
( ( Some x ))
( Some x )
in
( let ty =
Ast0.wrap(Ast0.BaseType(P.clt2mcode Ast.VoidType t, None)) in
......@@ -1241,7 +1241,7 @@ define_param_list_option:
funproto:
| t = ctype id = func_ident lp = TOPar d = decl_list_decl_ rp = TCPar pt = TPtVirg
{let s =
( ( None ))
( None )
in
( Ast0.wrap
(Ast0.UnInit
......@@ -1253,7 +1253,7 @@ in
| x0 = storage t = ctype id = func_ident lp = TOPar d = decl_list_decl_ rp = TCPar pt = TPtVirg
{let s =
let x = x0 in
( ( Some x ))
( Some x )