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: Fri, 17 May 2019 02:05:34 +0300 [thread overview]
Message-ID: <125E170E-686D-4AA6-BA76-D0F7B01C96B8@tarantool.org> (raw)
In-Reply-To: <114523ac-bf18-097d-fcd4-9cead7027b43@tarantool.org>
[-- Attachment #1: Type: text/plain, Size: 1327 bytes --]
> On 15 May 2019, at 22:33, Imeev Mergen <imeevma@tarantool.org> wrote:
> On 5/15/19 10:28 PM, n.pettik wrote:
>>
>>> 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.
>>
> Currently, pParse is not used directly in a template (lempar.c).
> I tried to keep this practice.
OK, then LGTM.
[-- Attachment #2: Type: text/html, Size: 26810 bytes --]
next prev parent reply other threads:[~2019-05-16 23:05 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
2019-05-15 19:33 ` Imeev Mergen
2019-05-16 23:05 ` n.pettik [this message]
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=125E170E-686D-4AA6-BA76-D0F7B01C96B8@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