Tarantool development patches archive
 help / color / mirror / Atom feed
From: "n.pettik" <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Imeev Mergen <imeevma@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH v1 1/1] sql: do not replace the error with a syntax error
Date: Wed, 15 May 2019 22:28:54 +0300	[thread overview]
Message-ID: <50DB5A78-5190-40D5-A3D6-2FFD7BA0A3E3@tarantool.org> (raw)
In-Reply-To: <20190515185225.GA21356@tarantool.org>

[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]


> diff --git a/extra/lempar.c b/extra/lempar.c
> index d043e39..595f89e 100644
> --- a/extra/lempar.c
> +++ b/extra/lempar.c
> @@ -935,7 +935,8 @@ void Parse(
>       yymajor = YYNOCODE;
> #endif
>     }
> -  }while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack );
> +  }while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack
> +         PARSER_ERROR_CHECK);
> #ifndef NDEBUG
>   if( yyTraceFILE ){
>     yyStackEntry *i;
> diff --git a/src/box/sql/parse.y b/src/box/sql/parse.y
> index 3a443a0..f241b8d 100644
> --- a/src/box/sql/parse.y
> +++ b/src/box/sql/parse.y
> @@ -80,6 +80,13 @@
> #define YYMALLOCARGTYPE  u64
> 
> /*
> + * Stop the parser if an error occurs. This macro adds an
> + * additional check that allows the parser to be stopped if any
> + * error was noticed.
> + */
> +#define PARSER_ERROR_CHECK && ! pParse->is_aborted

Any arguments in favour of using macro in this case?
Why don’t simply inline this condition?
The rest is OK as obvious.


[-- Attachment #2: Type: text/html, Size: 20498 bytes --]

  reply	other threads:[~2019-05-15 19:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 16:03 [tarantool-patches] " imeevma
2019-05-11 12:39 ` [tarantool-patches] " n.pettik
2019-05-15 17:28   ` Mergen Imeev
2019-05-15 18:52     ` Mergen Imeev
2019-05-15 19:28       ` n.pettik [this message]
2019-05-15 19:33         ` Imeev Mergen
2019-05-16 23:05           ` n.pettik
2019-05-17 11:40 ` Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50DB5A78-5190-40D5-A3D6-2FFD7BA0A3E3@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v1 1/1] sql: do not replace the error with a syntax error' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox