From c59bc37a40f634b89cac93e5b485a323b1a977b8 Mon Sep 17 00:00:00 2001 From: jvelilla Date: Fri, 8 Aug 2008 11:17:32 +0000 Subject: [PATCH] Fix Bug in quey 'is_a_valid_number' Remove the space after : in the regular expression "-?(?: 0|[1-9]\d*)(?: \.\d+)?(?: [eE][+-]?\d+)?\b" --- json/scanner/json_parser.e | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/json/scanner/json_parser.e b/json/scanner/json_parser.e index 200dc5ae..d5e67efa 100644 --- a/json/scanner/json_parser.e +++ b/json/scanner/json_parser.e @@ -341,13 +341,14 @@ feature {NONE} -- Implementation do create regexp.make create word_set.make_empty + a_number.right_adjust + a_number.left_adjust word_set.add_string ("0123456789.eE+-") regexp.set_word_set (word_set) - number_regex := "-?(?: 0|[1-9]\d*)(?: \.\d+)?(?: [eE][+-]?\d+)?\b" + number_regex := "-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?\b" regexp.compile (number_regex) if regexp.matches (a_number) then - a_number.right_adjust - if a_number.is_equal (regexp.captured_substring (0)) then + if a_number.is_equal (regexp.captured_substring (0)) then Result := true end end