From: Colin P. A. <co...@co...> - 2008-02-15 12:30:36
|
>>>>> "Colin" == Colin Paul Adams <co...@co...> writes: Colin> I found a bug in Gexslt, which was due to not enough digits Colin> in an MA_DECIMAL. Colin> So I changed from using {MA_DECIMAL_TEXT_PARSER}.parse to Colin> {MA_DECIMAL_TEXT_PARSER}.parse_ctx, supplying a context Colin> created using: Colin> create l_ctx.make (a_priority_attribute.count, Colin> round_half_up) Colin> (a_priority_attribute) is the string I want to parse as a Colin> decimal, so this sounds like a safe way of not losing any Colin> information from the string. Colin> However, I still get the same bug. When i started to debug, Colin> I find that Colin> {MA_DECIMAL_TEXT_PARSER}.parse_ctx Colin> is ignoring the passed context and just using the shared Colin> decimal context. Colin> I'm assuming that was just a copy-and-paste error? I changed it so that it now reads: parse_ctx (s: STRING; ctx: MA_DECIMAL_CONTEXT; parse_comma_as_decimal_point: BOOLEAN) is -- Parse `s' using `ctx' wrt `parse_comma_as_decimal_point'. require s_not_void: s /= Void s_not_empty: not s.is_empty local old_allowed: BOOLEAN do old_allowed := is_comma_allowed is_comma_allowed := parse_comma_as_decimal_point parse_and_create_last_decimal (s, ctx) is_comma_allowed := old_allowed ensure no_mode_change: is_comma_allowed = old is_comma_allowed last_parsed_string_affected: last_parsed = s last_decimal_not_void_when_no_error: not error implies last_decimal /= Void end and that fixes my bug in gexslt. May I commit this change? -- Colin Adams Preston Lancashire |