From ecbca7db4b65178157d09e658fa759d0d9b79a52 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 13 Apr 2010 23:09:14 +0200 Subject: [PATCH] tests: calc: minor refactoring. * tests/calc.at (_AT_DATA_CALC_Y): Simplify yylex. (cherry picked from commit 67f1a2c254e71e15125a1f4f64fae8f68deaa4fd) --- ChangeLog | 5 +++++ tests/calc.at | 10 +++------- 2 files changed, 8 insertions(+), 7 deletions(-) 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)) -- 2.45.2