# HG changeset patch # User Mario de Sousa # Date 1351165141 -3600 # Node ID 9b87606d4c075fb77724656ea13f7593821a41ba # Parent 5b19e376cc94ea5b94df6c8bdfd32be233a8ee8a Fix processing of TIME literals (submited by Andreas) diff -r 5b19e376cc94 -r 9b87606d4c07 stage1_2/iec_flex.ll --- a/stage1_2/iec_flex.ll Thu Oct 25 12:05:31 2012 +0100 +++ b/stage1_2/iec_flex.ll Thu Oct 25 12:39:01 2012 +0100 @@ -728,9 +728,9 @@ */ interval_ms_X ({integer_0_999}(\.{integer})?)ms -interval_s_X {integer_0_59}s(_?{interval_ms_X})? -interval_m_X {integer_0_59}m(_?{interval_s_X})? -interval_h_X {integer_0_23}h(_?{interval_m_X})? +interval_s_X {integer_0_59}s(_?{interval_ms_X})?|({integer_0_59}(\.{integer})?s) +interval_m_X {integer_0_59}m(_?{interval_s_X})?|({integer_0_59}(\.{integer})?m) +interval_h_X {integer_0_23}h(_?{interval_m_X})?|({integer_0_23}(\.{integer})?h) interval_ms {integer}ms|({fixed_point}ms) interval_s {integer}s(_?{interval_ms_X})?|({fixed_point}s) @@ -740,6 +740,7 @@ interval {interval_ms}|{interval_s}|{interval_m}|{interval_h}|{interval_d} + /* to help provide nice error messages, we also parse an incorrect but plausible interval... */ /* NOTE that this erroneous interval will be parsed outside the time_literal_state, so must not * be able to parse any other legal lexcial construct (besides a legal interval, but that diff -r 5b19e376cc94 -r 9b87606d4c07 stage3/forced_narrow_candidate_datatypes.cc --- a/stage3/forced_narrow_candidate_datatypes.cc Thu Oct 25 12:05:31 2012 +0100 +++ b/stage3/forced_narrow_candidate_datatypes.cc Thu Oct 25 12:39:01 2012 +0100 @@ -149,6 +149,10 @@ ERROR; } */ +printf("\n\n result of forced_narrow...\n"); +print_ast_c::print(symbol); +// for(int i = 0; i < symbol->n; i++) print_symbol_c::print(symbol->elements[i]); + return NULL; }