]> 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>
Tue, 13 Apr 2010 21:32:00 +0000 (23:32 +0200)
* tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex.

ChangeLog
tests/calc.at

index 81817c755fc895ad52930254be409c04f0b3c710..86d3f3c10eca18aba06be9136e1346a96ff329f9 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 fddddee422313165ae90e9b1c30f955684121239..1a3096e7c0d49df3af28e49d278e5fc9ecc9b0d2 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))