poke-devel
[Top][All Lists]
Advanced

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

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


From: Mohammad-Reza Nabipoor
Subject: [PATCH] pkl-lex.l: accept lower-case b as suffix of integer literals
Date: Mon, 8 Aug 2022 03:39:01 +0430

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.
---
 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
-- 
2.37.1




reply via email to

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