tests: calc: minor refactoring.

* tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
(cherry picked from commit 67f1a2c254)
This commit is contained in:
Akim Demaille
2010-04-13 23:09:14 +02:00
parent ed228e60b2
commit ecbca7db4b
2 changed files with 8 additions and 7 deletions

View File

@@ -1,3 +1,8 @@
2010-04-13 Akim Demaille <demaille@gostai.com>
tests: calc: minor refactoring.
* tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
2010-04-13 Akim Demaille <demaille@gostai.com>
tests: calc: simplify location management.

View File

@@ -122,19 +122,15 @@ int
])[
}
]AT_LOCATION_IF([
AT_LOC_FIRST_COLUMN = AT_LOC_LAST_COLUMN;
AT_LOC_FIRST_LINE = AT_LOC_LAST_LINE;
])[
/* Skip white space. */
while ((c = get_char (]AT_LEX_ARGS[)) == ' ' || c == '\t')
/* Skip current token, then white spaces. */
do
{
]AT_LOCATION_IF(
[ AT_LOC_FIRST_COLUMN = AT_LOC_LAST_COLUMN;
AT_LOC_FIRST_LINE = AT_LOC_LAST_LINE;
])[
}
while ((c = get_char (]AT_LEX_ARGS[)) == ' ' || c == '\t');
/* process numbers */
if (c == '.' || isdigit (c))