Re: [PATCH 4/5, V2, nft] Simplify parser rule_spec tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 08, 2016 at 02:42:34PM +0200, Carlos Falgueras García wrote:
> @@ -1250,35 +1247,41 @@ set_identifier		:	identifier
>  			}
>  			;
>  
> -handle_spec		:	/* empty */
> +handle_spec		:	HANDLE		NUM
>  			{
> -				memset(&$$, 0, sizeof($$));
> +				$$.handle.location	= @$;
> +				$$.handle.id		= $2;
>  			}
> -			|	HANDLE		NUM
> +			;
> +
> +position_spec		:	POSITION	NUM
>  			{
> -				memset(&$$, 0, sizeof($$));
> -				$$.location	= @$;
> -				$$.id		= $2;
> +				$$.position.location	= @$;
> +				$$.position.id		= $2;
>  			}
>  			;
>  
> -position_spec		:	/* empty */
> +rule_position		:	chain_spec
>  			{
> -				memset(&$$, 0, sizeof($$));
> +				$$ = $1;
>  			}
> -			|	POSITION	NUM
> +			|	chain_spec position_spec
>  			{
> -				memset(&$$, 0, sizeof($$));
> -				$$.location	= @$;
> -				$$.id		= $2;
> +				$$ = $1;
> +				handle_merge(&$$, &$2);
> +			}
> +			|	chain_spec error
> +			{
> +				erec_queue(error(&@2, "Expected `position' or nothing"),

In what case we display this error message after this patch?

Please, include examples in your patch description.

You can also explicitly indicate that tests pass succesfully.

> +					   state->msgs);
> +				$$ = $1;
>  			}
>  			;
>  
> -ruleid_spec		:	chain_spec	handle_spec	position_spec
> +ruleid_spec		:	chain_spec handle_spec
>  			{
> -				$$		= $1;
> -				$$.handle	= $2;
> -				$$.position	= $3;
> +				$$ = $1;
> +				handle_merge(&$$, &$2);
>  			}
>  			;
>  
> -- 
> 2.8.3
> 
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux