Tarantool development patches archive
 help / color / mirror / Atom feed
From: Imeev Mergen <imeevma@tarantool.org>
To: "n.pettik" <korablev@tarantool.org>, tarantool-patches@freelists.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:33:21 +0300	[thread overview]
Message-ID: <114523ac-bf18-097d-fcd4-9cead7027b43@tarantool.org> (raw)
In-Reply-To: <50DB5A78-5190-40D5-A3D6-2FFD7BA0A3E3@tarantool.org>

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


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.

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

  reply	other threads:[~2019-05-15 19:33 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 [this message]
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=114523ac-bf18-097d-fcd4-9cead7027b43@tarantool.org \
    --to=imeevma@tarantool.org \
    --cc=korablev@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