poke-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] pkl-lex.l: accept lower-case b as suffix of integer literals


From: Jose E. Marchesi
Subject: Re: [PATCH] pkl-lex.l: accept lower-case b as suffix of integer literals
Date: Tue, 16 Aug 2022 12:27:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi Mohammad.

> 2022-08-08  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
>
>       * libpoke/pkl-lex.l (IS): Add lower-case b to `IS' definition.
>       (Integer literal rule): Accept lower-case b as a valid suffix.


This is OK for master, provided you include an update for the manual and
also a test.

Maybe also update doc/learn-poke-language-in-y-minutes.pk?

Thanks.

> ---
>  ChangeLog         |  5 +++++
>  libpoke/pkl-lex.l | 11 ++++++-----
>  2 files changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index ef9187f5..20dc3b10 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,8 @@
> +2022-08-08  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
> +
> +     * libpoke/pkl-lex.l (IS): Add lower-case b to `IS' definition.
> +     (Integer literal rule): Accept lower-case b as a valid suffix.
> +
>  2022-07-25  Jose E. Marchesi  <jemarch@gnu.org>
>  
>       * configure.ac: Bump version to 2.4.
> diff --git a/libpoke/pkl-lex.l b/libpoke/pkl-lex.l
> index 78f1ce1d..522f9c37 100644
> --- a/libpoke/pkl-lex.l
> +++ b/libpoke/pkl-lex.l
> @@ -143,7 +143,7 @@ HEXCST                   0[xX][0-9a-fA-F][0-9a-fA-F_]*
>  BINCST                   0[bB][01][01_]*
>  OCTCST             0[oO][0-7_]*
>  DECCST             [0-9][0-9_]*
> -IS                   ((u|U)|(u|U)?(l|L|B|h|H|n|N)|(l|L|B|h|H|n|N)(u|U))
> +IS                   ((u|U)|(u|U)?(l|L|b|B|h|H|n|N)|(l|L|b|B|h|H|n|N)(u|U))
>  
>  L [a-zA-Z_]
>  D [0-9]
> @@ -608,15 +608,16 @@ S ::
>  
>    width = 0;
>    if (*end == 'l' || *end == 'L'
> -      || ((*end != '\0') && ((*(end + 1) == 'l' || *(end + 1) == 'L'))))
> +      || ((*end != '\0') && (*(end + 1) == 'l' || *(end + 1) == 'L')))
>      width = 64;
>    else  if (*end == 'h' || *end == 'H'
> -      || ((*end != '\0') && ((*(end + 1) == 'h' || *(end + 1) == 'H'))))
> +      || ((*end != '\0') && (*(end + 1) == 'h' || *(end + 1) == 'H')))
>      width = 16;
> -  else  if (*end == 'B' || ((*end != '\0') && *(end + 1) == 'B'))
> +  else  if (*end == 'b' || *end == 'B'
> +      || ((*end != '\0') && (*(end + 1) == 'b' || *(end + 1) == 'B')))
>      width = 8;
>    else if (*end == 'n' || *end == 'N'
> -      || ((*end != '\0') && ((*(end + 1) == 'n' || *(end + 1) == 'N'))))
> +      || ((*end != '\0') && (*(end + 1) == 'n' || *(end + 1) == 'N')))
>      width = 4;
>  
>    /* If not specified with the 'l' or 'L' suffix, the type of the



reply via email to

[Prev in Thread] Current Thread [Next in Thread]