Changeset f4b77f2 for src/Parser


Ignore:
Timestamp:
Sep 11, 2017, 5:09:29 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
15697ff
Parents:
de9285f
Message:

fix rules for parsing floating-point literals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/lex.ll

    rde9285f rf4b77f2  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Sun Sep 10 11:15:37 2017
    13  * Update Count     : 617
     12 * Last Modified On : Sun Sep 10 22:29:15 2017
     13 * Update Count     : 620
    1414 */
    1515
     
    108108
    109109                                // GCC: D (double) and iI (imaginary) suffixes, and DL (long double)
    110 floating_suffix_opt ("_"?(([fFdDlL]?[iI]?)|([iI][lLfFdD])|"DL"))?{user_suffix_opt}
     110exponent "_"?[eE]"_"?[+-]?{decimal_digits}
     111floating_suffix ([fFdDlL]?[iI]?)|([iI][lLfFdD])
     112floating_suffix_opt ("_"?({floating_suffix}|"DL"))?{user_suffix_opt}
    111113decimal_digits ({decimal})|({decimal}({decimal}|"_")*{decimal})
    112 exponent "_"?[eE]"_"?[+-]?{decimal_digits}
    113114floating_decimal {decimal_digits}"."{exponent}?{floating_suffix_opt}
    114115floating_fraction "."{decimal_digits}{exponent}?{floating_suffix_opt}
     
    116117
    117118binary_exponent "_"?[pP]"_"?[+-]?{decimal_digits}
     119hex_floating_suffix_opt ("_"?({floating_suffix}))?{user_suffix_opt}
    118120hex_floating_fraction ({hex_digits}?"."{hex_digits})|({hex_digits}".")
    119 hex_floating_constant {hex_prefix}(({hex_floating_fraction}{binary_exponent})|({hex_digits}{binary_exponent})){floating_suffix_opt}
     121hex_floating_constant {hex_prefix}(({hex_floating_fraction}{binary_exponent})|({hex_digits}{binary_exponent})){hex_floating_suffix_opt}
    120122
    121123                                // character escape sequence, GCC: \e => esc character
Note: See TracChangeset for help on using the changeset viewer.