* [Cocci] [PATCH] parsing_cocci: parse_cocci: Extend is_permissible_proto list
@ 2020-07-11 7:00 Jaskaran Singh
2020-07-11 7:57 ` Julia Lawall
0 siblings, 1 reply; 3+ messages in thread
From: Jaskaran Singh @ 2020-07-11 7:00 UTC (permalink / raw)
To: cocci
Add more tokens (binary operators and colon) to the match ladder in
is_permissible_proto. These cases would otherwise cause parsing errors
for function calls after these tokens.
Signed-off-by: Jaskaran Singh <jaskaran.singh@collabora.com>
---
parsing_cocci/parse_cocci.ml | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/parsing_cocci/parse_cocci.ml b/parsing_cocci/parse_cocci.ml
index 598cdc0b..e30039dc 100644
--- a/parsing_cocci/parse_cocci.ml
+++ b/parsing_cocci/parse_cocci.ml
@@ -1052,7 +1052,8 @@ let find_function_names l =
((PC.TMid0(_),_) | (PC.TAnd0(_),_))::
(PC.TOPar0(_),_)::_ -> false
| (PC.TOPar0(_),_)::rest
- | (PC.TCPar0(_),_)::rest -> is_permissible_proto rest
+ | (PC.TCPar0(_),_)::rest
+ | (PC.TMul(_),_)::rest -> is_permissible_proto rest
| x::rest when is_mid x ->
let rec loop = function
[] -> false
@@ -1076,6 +1077,21 @@ let find_function_names l =
| (PC.TMetaId(_),_)::_
| (PC.TMetaLocalIdExp(_),_)::_
| (PC.TEq(_),_)::_
+ | (PC.TEqEq(_),_)::_
+ | (PC.TNotEq(_),_)::_
+ | (PC.TShROp(_),_)::_
+ | (PC.TShLOp(_),_)::_
+ | (PC.TSub(_),_)::_
+ | (PC.TPlus(_),_)::_
+ | (PC.TMinus(_),_)::_
+ | (PC.TDmOp(_),_)::_
+ | (PC.TAnd(_),_)::_
+ | (PC.TOr(_),_)::_
+ | (PC.TXor(_),_)::_
+ | (PC.TLogOp(_),_)::_
+ | (PC.TAndLog(_),_)::_
+ | (PC.TOrLog(_),_)::_
+ | (PC.TDotDot(_),_)::_
| (PC.TPtrOp(_),_)::_
| (PC.TEllipsis(_),_)::_
| (PC.TOEllipsis(_),_)::_
@@ -1086,6 +1102,7 @@ let find_function_names l =
| (PC.TOBrace(_),_)::_
| (PC.TCBrace(_),_)::_
| (PC.TOPar(_),_)::_
+ | (PC.TOCro(_),_)::_
| (PC.TIdent(_),_)::_ -> false
| _ -> true in
let decl_or_proto clt info bef aft =
--
2.21.3
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Cocci] [PATCH] parsing_cocci: parse_cocci: Extend is_permissible_proto list
2020-07-11 7:00 [Cocci] [PATCH] parsing_cocci: parse_cocci: Extend is_permissible_proto list Jaskaran Singh
@ 2020-07-11 7:57 ` Julia Lawall
2020-07-11 8:02 ` Jaskaran Singh
0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2020-07-11 7:57 UTC (permalink / raw)
To: Jaskaran Singh; +Cc: cocci
On Sat, 11 Jul 2020, Jaskaran Singh wrote:
> Add more tokens (binary operators and colon) to the match ladder in
> is_permissible_proto. These cases would otherwise cause parsing errors
> for function calls after these tokens.
Thanks, but it doesn't apply:
Applying: parsing_cocci: parse_cocci: Extend is_permissible_proto list
error: parsing_cocci/parse_cocci.ml: does not match index
julia
>
> Signed-off-by: Jaskaran Singh <jaskaran.singh@collabora.com>
> ---
> parsing_cocci/parse_cocci.ml | 19 ++++++++++++++++++-
> 1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/parsing_cocci/parse_cocci.ml b/parsing_cocci/parse_cocci.ml
> index 598cdc0b..e30039dc 100644
> --- a/parsing_cocci/parse_cocci.ml
> +++ b/parsing_cocci/parse_cocci.ml
> @@ -1052,7 +1052,8 @@ let find_function_names l =
> ((PC.TMid0(_),_) | (PC.TAnd0(_),_))::
> (PC.TOPar0(_),_)::_ -> false
> | (PC.TOPar0(_),_)::rest
> - | (PC.TCPar0(_),_)::rest -> is_permissible_proto rest
> + | (PC.TCPar0(_),_)::rest
> + | (PC.TMul(_),_)::rest -> is_permissible_proto rest
> | x::rest when is_mid x ->
> let rec loop = function
> [] -> false
> @@ -1076,6 +1077,21 @@ let find_function_names l =
> | (PC.TMetaId(_),_)::_
> | (PC.TMetaLocalIdExp(_),_)::_
> | (PC.TEq(_),_)::_
> + | (PC.TEqEq(_),_)::_
> + | (PC.TNotEq(_),_)::_
> + | (PC.TShROp(_),_)::_
> + | (PC.TShLOp(_),_)::_
> + | (PC.TSub(_),_)::_
> + | (PC.TPlus(_),_)::_
> + | (PC.TMinus(_),_)::_
> + | (PC.TDmOp(_),_)::_
> + | (PC.TAnd(_),_)::_
> + | (PC.TOr(_),_)::_
> + | (PC.TXor(_),_)::_
> + | (PC.TLogOp(_),_)::_
> + | (PC.TAndLog(_),_)::_
> + | (PC.TOrLog(_),_)::_
> + | (PC.TDotDot(_),_)::_
> | (PC.TPtrOp(_),_)::_
> | (PC.TEllipsis(_),_)::_
> | (PC.TOEllipsis(_),_)::_
> @@ -1086,6 +1102,7 @@ let find_function_names l =
> | (PC.TOBrace(_),_)::_
> | (PC.TCBrace(_),_)::_
> | (PC.TOPar(_),_)::_
> + | (PC.TOCro(_),_)::_
> | (PC.TIdent(_),_)::_ -> false
> | _ -> true in
> let decl_or_proto clt info bef aft =
> --
> 2.21.3
>
>
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Cocci] [PATCH] parsing_cocci: parse_cocci: Extend is_permissible_proto list
2020-07-11 7:57 ` Julia Lawall
@ 2020-07-11 8:02 ` Jaskaran Singh
0 siblings, 0 replies; 3+ messages in thread
From: Jaskaran Singh @ 2020-07-11 8:02 UTC (permalink / raw)
To: Julia Lawall; +Cc: cocci
On Sat, 2020-07-11 at 09:57 +0200, Julia Lawall wrote:
>
> On Sat, 11 Jul 2020, Jaskaran Singh wrote:
>
> > Add more tokens (binary operators and colon) to the match ladder in
> > is_permissible_proto. These cases would otherwise cause parsing
> > errors
> > for function calls after these tokens.
>
> Thanks, but it doesn't apply:
>
> Applying: parsing_cocci: parse_cocci: Extend is_permissible_proto
> list
> error: parsing_cocci/parse_cocci.ml: does not match index
>
That's weird, it applies fine on gitlab/master for me.
Maybe do a git am --abort and try again?
Cheers,
Jaskaran.
> julia
>
> > Signed-off-by: Jaskaran Singh <jaskaran.singh@collabora.com>
> > ---
> > parsing_cocci/parse_cocci.ml | 19 ++++++++++++++++++-
> > 1 file changed, 18 insertions(+), 1 deletion(-)
> >
> > diff --git a/parsing_cocci/parse_cocci.ml
> > b/parsing_cocci/parse_cocci.ml
> > index 598cdc0b..e30039dc 100644
> > --- a/parsing_cocci/parse_cocci.ml
> > +++ b/parsing_cocci/parse_cocci.ml
> > @@ -1052,7 +1052,8 @@ let find_function_names l =
> > ((PC.TMid0(_),_) | (PC.TAnd0(_),_))::
> > (PC.TOPar0(_),_)::_ -> false
> > | (PC.TOPar0(_),_)::rest
> > - | (PC.TCPar0(_),_)::rest -> is_permissible_proto rest
> > + | (PC.TCPar0(_),_)::rest
> > + | (PC.TMul(_),_)::rest -> is_permissible_proto rest
> > | x::rest when is_mid x ->
> > let rec loop = function
> > [] -> false
> > @@ -1076,6 +1077,21 @@ let find_function_names l =
> > | (PC.TMetaId(_),_)::_
> > | (PC.TMetaLocalIdExp(_),_)::_
> > | (PC.TEq(_),_)::_
> > + | (PC.TEqEq(_),_)::_
> > + | (PC.TNotEq(_),_)::_
> > + | (PC.TShROp(_),_)::_
> > + | (PC.TShLOp(_),_)::_
> > + | (PC.TSub(_),_)::_
> > + | (PC.TPlus(_),_)::_
> > + | (PC.TMinus(_),_)::_
> > + | (PC.TDmOp(_),_)::_
> > + | (PC.TAnd(_),_)::_
> > + | (PC.TOr(_),_)::_
> > + | (PC.TXor(_),_)::_
> > + | (PC.TLogOp(_),_)::_
> > + | (PC.TAndLog(_),_)::_
> > + | (PC.TOrLog(_),_)::_
> > + | (PC.TDotDot(_),_)::_
> > | (PC.TPtrOp(_),_)::_
> > | (PC.TEllipsis(_),_)::_
> > | (PC.TOEllipsis(_),_)::_
> > @@ -1086,6 +1102,7 @@ let find_function_names l =
> > | (PC.TOBrace(_),_)::_
> > | (PC.TCBrace(_),_)::_
> > | (PC.TOPar(_),_)::_
> > + | (PC.TOCro(_),_)::_
> > | (PC.TIdent(_),_)::_ -> false
> > | _ -> true in
> > let decl_or_proto clt info bef aft =
> > --
> > 2.21.3
> >
> >
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-11 8:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-11 7:00 [Cocci] [PATCH] parsing_cocci: parse_cocci: Extend is_permissible_proto list Jaskaran Singh
2020-07-11 7:57 ` Julia Lawall
2020-07-11 8:02 ` Jaskaran Singh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).