D29327: Improve a bit parse error dignosis

Jarosław Staniek noreply at phabricator.kde.org
Fri May 1 23:15:27 BST 2020


staniek added inline comments.

INLINE COMMENTS

> KDbSqlScanner.l:155
>      ECOUNT;
> -    sqlParserDebug() << "### begin DATE_OR_TIME" << yytext << "(" << yyleng << ")";
> +    sqlParserDebug() << "### end DATE_OR_TIME" << yytext << "(" << yyleng << ")";
>      BEGIN(DATE_OR_TIME_caller);

Why it is "end" now when we're calling BEGIN() here?

> KDbSqlScanner.l:160
>  
> +. {
> +    sqlParserDebug() << "char: '" << yytext[0] << "'";

Very good, how about also adding a comment here to explain all readons behind this rule, as you nicely did in the description?

> KDbSqlScanner.l:379
>  
> -[\~\!\@\#\^\&\|\`\?,()\[\]\.;\:\+\-\*\/\%\^\<\>\=] {
> +. {
>      sqlParserDebug() << "char: '" << yytext[0] << "'";

This is nice but how about keeping the

  [\~\!\@\#\^\&\|\`\?,()\[\]\.;\:\+\-\*\/\%\^\<\>\=] { ... }

which just defines all single-character tokens and adding the . { } afterwards?
In the . {} we may also add a debug explaining that the yytext[0] is unsupported.
Doing so at flex level can have its value too.

REPOSITORY
  R15 KDb

REVISION DETAIL
  https://phabricator.kde.org/D29327

To: jfita, staniek, piggz
Cc: Kexi-Devel-list, barman, wicik, staniek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kexi-devel/attachments/20200501/c4a5cf00/attachment.html>


More information about the Kexi-devel mailing list