]> git.saurik.com Git - bison.git/commitdiff
tests: calc: minor refactoring.
authorAkim Demaille <demaille@gostai.com>
Tue, 13 Apr 2010 21:09:14 +0000 (23:09 +0200)
committerAkim Demaille <demaille@gostai.com>
Wed, 14 Apr 2010 10:46:30 +0000 (12:46 +0200)
* tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.
(cherry picked from commit 67f1a2c254e71e15125a1f4f64fae8f68deaa4fd)

ChangeLog
tests/calc.at

index dcc3716ffd5ca283adc5645abff83ab74e3b1e45..5c8a9c5e3284498af691053cd3c7d3ed7381a2c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 4c2431747b6f60642a79dfb87bdb6ed1becb4de3..5bb746f788ceda9c2c92445463b5302ef99f4e64 100644 (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))