From: Akim Demaille Date: Tue, 13 Apr 2010 21:09:14 +0000 (+0200) Subject: tests: calc: minor refactoring. X-Git-Tag: v2.5_rc1~88 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/ecbca7db4b65178157d09e658fa759d0d9b79a52?ds=sidebyside tests: calc: minor refactoring. * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex. (cherry picked from commit 67f1a2c254e71e15125a1f4f64fae8f68deaa4fd) --- diff --git a/ChangeLog b/ChangeLog index dcc3716f..5c8a9c5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-04-13 Akim Demaille + + tests: calc: minor refactoring. + * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex. + 2010-04-13 Akim Demaille tests: calc: simplify location management. diff --git a/tests/calc.at b/tests/calc.at index 4c243174..5bb746f7 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -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))