[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/6] tests: remove useless support of '.' in integers
From: |
Akim Demaille |
Subject: |
[PATCH 1/6] tests: remove useless support of '.' in integers |
Date: |
Sun, 9 Jun 2019 11:13:07 +0200 |
* tests/calc.at: here.
* doc/bison.texi: Avoid uninitialized variables.
---
doc/bison.texi | 6 +++---
tests/calc.at | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/doc/bison.texi b/doc/bison.texi
index 0301a96c..927b9374 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -2715,11 +2715,11 @@ operators in @code{yylex}.
int
yylex (void)
@{
- int c;
+ int c = getchar ();
/* Ignore white space, get first nonwhite character. */
- while ((c = getchar ()) == ' ' || c == '\t')
- continue;
+ while (c == ' ' || c == '\t')
+ c = getchar ();
if (c == EOF)
return 0;
diff --git a/tests/calc.at b/tests/calc.at
index 38f85dcd..ba33592a 100644
--- a/tests/calc.at
+++ b/tests/calc.at
@@ -168,7 +168,7 @@ class CalcLexer(R) : Lexer
return YYTokenType.EOF;
// Numbers.
- if (input.front == '.' || input.front.isNumber)
+ if (input.front.isNumber)
{
import std.conv : parse;
semanticVal_.ival = input.parse!int;
@@ -257,8 +257,8 @@ read_integer (]AT_YYLEX_FORMALS[)
}
while ((c = get_char (]AT_YYLEX_ARGS[)) == ' ' || c == '\t');
- /* Process numbers */
- if (c == '.' || isdigit (c))
+ /* Process numbers. */
+ if (isdigit (c))
{
unget_char (]AT_YYLEX_PRE_ARGS[ c);
]AT_VAL[.ival = read_integer (]AT_YYLEX_ARGS[);
--
2.21.0
- [PATCH 0/6] Clean up tests, Akim Demaille, 2019/06/09
- [PATCH 1/6] tests: remove useless support of '.' in integers,
Akim Demaille <=
- [PATCH 2/6] tests: main: support -s and -p, Akim Demaille, 2019/06/09
- [PATCH 3/6] tests: make sure the default action properly works in C++, Akim Demaille, 2019/06/09
- [PATCH 4/6] traces: add some colors, Akim Demaille, 2019/06/09
- [PATCH 5/6] lr0: more debug traces, Akim Demaille, 2019/06/09
- [PATCH 6/6] CI: factor, Akim Demaille, 2019/06/09